Skip to content
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-24801] Android: Ti.UI.Label refactoring/fixes. #9175

Merged
merged 5 commits into from Jun 23, 2017

Conversation

jquick-axway
Copy link
Contributor

- Removed Android END ellipsis limitation. Now supports all Android ellipsis modes.
- Indicated how to disable font downscaling.
- Modified toBoolean(), toInt(), and toFloat() methods that provide a default value to handle all exceptions. (Was not handling NullPointerException before.)
…() method.

- Added bit masking via Linkify.ALL to ensure invalid bits were not getting set.
  * Note that default value of 16 is invalid on the Android side (should be 0), but was not causing any issues.
- Fixed "success" flag logic which was reversed, which is set true if links were found/added.
  * Was setting LinkMovementMethod when links were not found.
…in case it was given a null view.

* Avoid a null pointer exception upon the first time this class attempts to fetch system's DisplayMetrics.
- [TIMOB-24801] Fixed bug where height can fluctuate on every "postlayout" when "minimumFontSize" is applied.
- [TIMOB-24670] Fixed bug where "lines" property wasn't working.
  * Now correctly sets the height of the label view based on font line height.
  * Set to <= 0 or null to clear this property.
- [TIMOB-13895] Fixed bug where setting "lines" property will not apply END ellipsis to multiline truncated text.
  * Will now correctly apply ellipsis even if "wordWrap" is set true.
- Modified label to not auto-size the view width beyond the bounds of the parent if "minimumFontSize" is applied.
  * Now matches iOS' behavior.
- Fixed "minimumFontSize" to not upscale the font to fit the width. Should only downscale.
  * Used to scale larger than default font size.
  * Now matches iOS' behavior.
- Fixed "minimumFontSize" bug where it would not downscale the text enough and to fit the width, causing text to be clipped.
- Fixed "minimumFontSize" to respect the "ti.ui.defaultunit" for give font size.
  * Used to be hardcoded in pixels.
  * Now consistent with the units used by the "Label.font" property.
- Fixed "minimumFontSize" bug where label height would not be adjusted to fit its downscaled text.
  * Will only auto-adjust label height if the "height" or "lines" property have not been set.
- Fixed "minimumFontSize" bug where text can sometimes downscale lower than the minimum.
- Fixed bug where "touchEnabled" property would change to true after setting the "html" or "autoLink" properties.
  * Now preserves the original setting.
- Fixed "minimumFontSize" to show text as single-line like iOS.
  * No longer displays text as multiline. (This was a bug.)
- Fixed "minimumFontSize" to trim all text proceeding after a newline or "html" break.
  * Now matches iOS' behavior.
- Fixed bug where "ellipsize" constants START and MIDDLE would not show ellipsis.
  * Bug was introduced in 2015 due to [TIMOB-16911] fix.
  * Note: If "autoLink" is true, then label will use END instead of START and MIDDLE ellipsis due to native Android limitation.
- When setting "ellipsize" to START or MIDDLE, the label text will switch to single-line mode, like how it works with MARQUEE.
- Modified "minimumFontSize" to support ellipsize constants START, MIDDLE, END, MARQUEE, and NONE. (Used to only support END.)
@jquick-axway
Copy link
Contributor Author

@garymathews, I forgot to remove the "wasUpdated" ellipsis check in 6.1.1 PR before it was merged (it's not really an issue; just an inconsistency). But I did remove it from this PR for master.

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's okay 👍

CR: PASS

@lokeshchdhry
Copy link
Contributor

FR Passed.

1.Created an app for each test cases above to test & verified that minimumFontSize works as expected.
2.Verified fix for TIMOB-24670 & lines in label works fine.
3.Verified fix for TIMOB-13895 & setting ellipsize to a big text shows the ellipsize.

Studio Ver: 4.9.0.201705302345
SDK Ver: 6.2.0 local build
OS Ver: 10.12.3
Xcode Ver: Xcode 8.3.3
Appc NPM: 4.2.9
Appc CLI: 6.2.2
Ti CLI Ver: 5.0.14
Alloy Ver: 1.9.11
Node Ver: 6.10.1
Java Ver: 1.8.0_101
Devices: ⇨ google Nexus 5 --- Android 6.0.1
⇨ google Pixel --- Android 7.1.1
⇨ Samsung Galaxy S4 --- Android 4.4.4

@lokeshchdhry lokeshchdhry merged commit 663398f into tidev:master Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants