New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-24479] Android: fix TiUILabel maxLines not working #8884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR & FT PASS
259dd2f
to
1457331
Compare
@@ -329,7 +334,7 @@ public void processProperties(KrollDict d) | |||
TiUIHelper.linkifyIfEnabled(tv, d.get(TiC.PROPERTY_AUTO_LINK)); | |||
tv.invalidate(); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you do the backport manually? I don't see this line in the backport, so I was wondering. Try to cherry-pick all changes for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I did the backport manually which is linked here.
@fmerzadyan Do we know what broke this in 6.0.0? I'm curious why we now need to refresh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fmerzadyan I think the problem is with wordWrap
defaulting to true
. So when maxLines
of 1
is specified, the label enables wordWrap
after setting maxLines
, causing the line to wrap.
Try moving maxLines
so it is processed after wordWrap
if (d.containsKey(TiC.PROPERTY_WORD_WRAP)) {
wordWrap = TiConvert.toBoolean(d, TiC.PROPERTY_WORD_WRAP, true);
tv.setSingleLine(!wordWrap);
}
if (d.containsKey(TiC.PROPERTY_MAX_LINES)) {
tv.setMaxLines(TiConvert.toInt(d, TiC.PROPERTY_MAX_LINES));
}
@garymathews, the problem is that |
@fmerzadyan I think it would be best to just move |
@garymathews, No problem 👍 |
1457331
to
b5d81dd
Compare
CR & FT PASS with new changes |
FR Passed was able to set a long string to 1 line. Steps taken to test
Environment |
Test Case:
Expect the long string to be in one line meaning no word wraps.
JIRA: https://jira.appcelerator.org/browse/TIMOB-24479