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-23501] iOS: Label.ellipsize should not return undefined #8086
Conversation
if ([TiUtils intValue:value] == 1) { | ||
[[self label] setLineBreakMode:NSLineBreakByTruncatingTail]; | ||
return; | ||
} |
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.
Cannot remove the old implementation, we need to throw at least a deprecation warning for boolean
inputs.
fced69a
to
8ad5e62
Compare
I've added the android part and set the default value to |
if ([TiUtils intValue:value] == 1) { | ||
[[self label] setLineBreakMode:NSLineBreakByTruncatingTail]; | ||
[[self label] setLineBreakMode:NSLineBreakByCharWrapping]; |
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.
Instead of this, please check if the input is a bool and leave the if-block as it is, if so.
@AngelkPetkov please cherry-pick his Android-changes into this PR and I will FT it. |
18d8c00
to
2cbf003
Compare
# Conflicts: # android/modules/ui/src/java/ti/modules/titanium/ui/LabelProxy.java
c3a9f50
to
51350be
Compare
There is an issue here @AngelkPetkov @m1ga: var label = Ti.UI.createLabel();
Ti.API.warn(label.getEllipsize()); // Should be "4" (Integer for Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END - default)
Ti.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END); // Should be "true"
Ti.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE); // Should be "false"
label.setEllipsize(Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE);
Ti.API.warn(label.getEllipsize()); // Should be "5" (Integer for Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE)
Ti.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE); // Should be "true"
Ti.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END); // Should be "false" As the constants only represent a name for a number, the above logs output numbers. On iOS, it is 4 and 5, on Android it is 2 and 1. I think, as long as the user checks agains the constants and not against the numbers, it's fine. We cannot ensure that all constants across all platforms represent the same number, so this is the way to go. Do you guys agree? |
@@ -1243,6 +1243,30 @@ properties: | |||
permission: read-only | |||
platforms: [iphone, ipad] | |||
|
|||
- name: TEXT_ELLIPSIZE_TRUNCATE_WORD_WRAP | |||
summary: Add ellipses at word boundaries, unless the word itself doesnt fit on a single line |
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.
doesnt
->doesn't
- Missing period at the end of the sentence
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.
Yeah i had it as doesn't originally however node validate doesn't like ' as its a non ASCII character, so i removed it
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.
Use the correct sign there as we do in related docs. Search UI.yml
for other usages and copy it from there.
FT passed, please address the documentation comments before merging. |
3c48f50
to
4cc0a81
Compare
c4eccbc
to
a67c5ea
Compare
CR + FT passed, PR approved. |
JIRA