Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6392] Android: Ti.UI.Button text values with too many displayable characters draw improperly

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-11-13T18:53:18.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.0.1
Fix Version/sRelease 7.0.0
ComponentsAndroid
Labelsandroid, breaking-change, button, reprod
ReporterDustin Hyde
AssigneeMaggie Chen
Created2011-11-30T14:36:42.000+0000
Updated2019-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

FileDateSize
android-2.2-button-text-display.png2011-11-30T14:36:42.000+000014012
Android - Button Text - Display Screenshots.zip2011-11-30T14:36:42.000+0000409461
ios-5.0-button-text-display.png2011-11-30T14:36:42.000+000011696

Comments

  1. Lee Morris 2017-07-12

    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
  2. Maggie Chen 2017-08-11

    PR https://github.com/appcelerator/titanium_mobile/pull/9299
  3. Lokesh Choudhary 2017-11-09

    FR Passed. Waiting for merge to get enabled.
  4. Lokesh Choudhary 2017-11-13

    PR Merged.
  5. Abir Mukherjee 2017-11-15

    Changes are seen in SDK 7.0.0.v20171114203226.
  6. Shawn Lipscomb 2019-07-26

    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.

JSON Source