Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3279] Android: Add support for ellipsize modes on Ti.UI.Label

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusResolved
ResolutionFixed
Resolution Date2015-05-19T02:15:41.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterManuel Lehner
AssigneeAshraf Abu
Created2015-04-08T12:49:39.000+0000
Updated2016-03-08T07:57:41.000+0000

Description

The marquee effect of the native Android TextView is not exposed to the Ti.UI.Label

Attachments

FileDateSize
Screenshot_2015-04-10-11-55-35.png2015-04-10T11:26:21.000+000086739
Screen Shot 2015-04-16 at 1.53.44 PM.png2015-04-16T07:58:14.000+000050852
Screen Shot 2015-04-16 at 1.55.49 PM.png2015-04-16T07:58:14.000+000048746

Comments

  1. Manuel Lehner 2015-04-10

    PR: https://github.com/appcelerator/titanium_mobile/pull/6775 Test Code:
       var win = Ti.UI.createWindow({
         layout: 'vertical',
         backgroundColor: '#fff'
       });
       
       var longtext = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
       
       var label1 = Titanium.UI.createLabel({
       	color:'#000',
       	text: longtext,
       	font:{fontSize:20},
       	textAlign:'left',
       	top: 10,
       	left: 0,
       	width: 200,
       	height: 24,
       	wordWrap: false,
       	ellipsize: true
       });
       win.add(label1);
       
       var label2 = Titanium.UI.createLabel({
       	color:'#000',
         text: longtext,
         font:{fontSize:20},
         textAlign:'left',
         top: 10,
         left: 0,
         width: 200,
         height: 24,
         wordWrap: false,
         ellipsize: false
       });
       win.add(label2);
       
       var label3 = Titanium.UI.createLabel({
         color:'#000',
         text: longtext,
         font:{fontSize:20},
         textAlign:'left',
         top: 10,
         left: 0,
         width: 200,
         height: 24,
         wordWrap: false,
         ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_START
       });
       win.add(label3);
       
       var label4 = Titanium.UI.createLabel({
         color:'#000',
         text: longtext,
         font:{fontSize:20},
         textAlign:'left',
         top: 10,
         left: 0,
         width: 200,
         height: 24,
         wordWrap: false,
         ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END
       });
       win.add(label4);
       
       var label5 = Titanium.UI.createLabel({
         color:'#000',
         text: longtext,
         font:{fontSize:20},
         textAlign:'left',
         top: 10,
         left: 0,
         width: 200,
         height: 24,
         wordWrap: false,
         ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE
       });
       win.add(label5);
       
       var label6 = Titanium.UI.createLabel({
         color:'#000',
         text: longtext,
         font:{fontSize:20},
         textAlign:'left',
         top: 10,
         width: 200,
         left: 0,
         wordWrap: false,
         ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MARQUEE
       });
       win.add(label6);
       
       win.open();
       
       
  2. Manuel Lehner 2015-04-10

    Screenshot for the attached test code. Labels show the results for setting ellipsize to: - true - false - Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_START - Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END - Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE - Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MARQUEE
  3. Ashraf Abu 2015-05-19

    PR reviewed and functionally tested. Accepted and merged. Thank you.

JSON Source