[TIMOB-6392] Android: Ti.UI.Button text values with too many displayable characters draw improperly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-13T18:53:18.000+0000 |
Affected Version/s | Release 1.7.5, Release 1.8.0.1 |
Fix Version/s | Release 7.0.0 |
Components | Android |
Labels | android, breaking-change, button, reprod |
Reporter | Dustin Hyde |
Assignee | Maggie Chen |
Created | 2011-11-30T14:36:42.000+0000 |
Updated | 2019-07-26T15:52:54.000+0000 |
Description
Ti.UI.Button text values containing too many displayable characters are: truncated without a visual cue (Android 2.3), displayed outside the background image of the button (Android 2.2, 2.3), or cut in half horizontally (Nook). Screenshots attached.
In contrast, large text values in iOS buttons contain an ellipsis (ensuring the user is aware of the missing text).
Steps to Reproduce:
1. Create a project using the following code:
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({title:'Tab 1',backgroundColor:'#fff'});
var button = Titanium.UI.createButton({title:'Set active tab via index (Controls)',top:160,height:40,width:200});
win.add(button);
win.open();
2. Run the project using the Android Emulator 2.2 WVGA854 (a known error-observable configuration).
3. The button appears.
Expected Result:
Button text should display within the button area, be displayed in full, or displayed with an ellipsis (i.e., iOS).
Actual Result:
Button text is displayed outside the button area, horizontally cut in half, or truncated without a visual cue.
Note:
The Android runtime (V8, Rhino), TiMob SDK, or device orientation do not affect this behavior.
Attachments
File | Date | Size |
---|---|---|
android-2.2-button-text-display.png | 2011-11-30T14:36:42.000+0000 | 14012 |
Android - Button Text - Display Screenshots.zip | 2011-11-30T14:36:42.000+0000 | 409461 |
ios-5.0-button-text-display.png | 2011-11-30T14:36:42.000+0000 | 11696 |
I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131
PR https://github.com/appcelerator/titanium_mobile/pull/9299
FR Passed. Waiting for merge to get enabled.
PR Merged.
Changes are seen in SDK 7.0.0.v20171114203226.
On Android, the problem now is that a button with a title of 'Line1\nLine2', which used to display correctly (vertically stacked) is now being truncated to just show 'Line1'. This is on a button that has plenty of room to show both lines of text.