{ "id": "61936", "key": "TIMOB-1304", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:55:48.000+0000", "created": "2011-04-15T02:48:57.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:55:48.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

On the N1 the controls tab exhibits the problem.

\n

See \nQ&A for more information.

\n

Also:

\n

base UI>Views>Table Views (Go to P and see Pari with s on\nnext line)

{html}", "attachment": [], "flagged": false, "summary": "Android: Strange wrapping in TableView on Higher Res Screens", "creator": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125289", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I vote +1 for fixing this!
\nAnother example, KS -> Controls -> \"Butto\" with \"n\"\nwrapped

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:57.000+0000", "updated": "2011-04-15T02:48:57.000+0000" }, { "id": "125290", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I think this is to do with auto-detecting the width. As a\nworkaround, you can explicitly set a large enough width and the\ntext won't wrap. Obviously, this is not ideal, though.

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:57.000+0000", "updated": "2011-04-15T02:48:57.000+0000" }, { "id": "125291", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This is being worked on. It's a rounding error having to do with\nscaling and having int's instead of float in the API.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:57.000+0000", "updated": "2011-04-15T02:48:57.000+0000" }, { "id": "125292", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thanks for the note, Don.
\nAnother workaround is to change the fontsize. Increasing/decreasing\nby just one point can correct the problem

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:58.000+0000", "updated": "2011-04-15T02:48:58.000+0000" }, { "id": "125293", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Sorry, mistake - I should not have re-assigned. Reassigning back\nto Marshall

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:58.000+0000", "updated": "2011-04-15T02:48:58.000+0000" }, { "id": "125294", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [82d1161f123fb7a31699e07c8c76240471e46a4e])\ngrow the content area / auto generated label for tables, this fixes\nthe text cutoff problem in higher-density devices [#1304\nstate:resolved] \nhttp://github.com/appcelerator/titanium_mobile/commit/82d1161f123fb...

{html}", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:58.000+0000", "updated": "2011-04-15T02:48:58.000+0000" }, { "id": "125295", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Note: Using the latest Android build at \nhttp://builds.appcelerator.com.s3.amazonaws.com/mobile/mobilesdk-1....

\n

Marshall
\nI'm afraid this bug is not completely fixed.

\n

If you update the Kitchen\nSink/Resources/examples/table_view_api_basic.js with the following\ncode, you will see what I mean:
\nhttp://gist.github.com/485832

\n

Cheers

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:58.000+0000", "updated": "2011-04-15T02:48:58.000+0000" }, { "id": "125296", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Verified hal's test case.. The workaround I posted only really\nworks in the \"default\" table view case, because it involves growing\nthe content area of the default TableViewRow layout + The default\nlabel we create. AFAICT, This is still related to how fonts are\nmeasured when application scale is enabled, and looks very much\nlike an actual Android bug.

{html}", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:58.000+0000", "updated": "2011-04-15T02:48:58.000+0000" }, { "id": "125297", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Marshall, setting a static width for the container label could\nstill cause the text to wrap in some cases where the margin between\nthe text and the edge of the container is small. I feel when\npercentages for widths is working properly, it will allow a little\nbit of flexibility and flux to prevent this happening. Do you\nagree? Are percentages scheduled for the 1.5 release?

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:59.000+0000", "updated": "2011-04-15T02:48:59.000+0000" }, { "id": "125298", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Full fix won't be ready in 1.4

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:59.000+0000", "updated": "2011-04-15T02:48:59.000+0000" }, { "id": "125299", "author": { "name": "jicksteen", "key": "jicksteen", "displayName": "Jick Steen", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Please, also have a look at labels within views. I have this\nissue there, too.

{html}", "updateAuthor": { "name": "jicksteen", "key": "jicksteen", "displayName": "Jick Steen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:59.000+0000", "updated": "2011-04-15T02:48:59.000+0000" }, { "id": "125300", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Jick

\n

Marshall, the personable guy that he is, kindly explained to me\nvia IRC that the issue of auto-sizing views within a tableviewrow\nis not so simple to resolve. Now I have some background, the\nreasons are more understandable. Here's the transcript:

\n
\n2010-07-22 16:01:12 <marshall_law>  hal: i'm not sure if there's a way to solve this one, other than forcing the label to be a larger size\n2010-07-22 16:01:36 <marshall_law>  in this case it's actually android that has the bug.. i worked around it by auto-growing the content area for default table views\n2010-07-22 16:01:55 <marshall_law>  the problem is when you start adding your own widgets, Titanium no longer controls the view group\n2010-07-22 16:02:14 <marshall_law>  so i could hack it, and force it to grow, but that isn't what you want either\n2010-07-22 16:02:21 <marshall_law>  because then it's the entire size of the row\n2010-07-22 16:02:27 <marshall_law>  you just want it to be the size of the text right?\n2010-07-22 16:02:42 <hal>   yes, I'd imagine so\n2010-07-22 16:04:29 <hal>   marshall_law: can the width of the label just depend on the size of the text?\n2010-07-22 16:05:04 <marshall_law>  hal: that's what it's trying to do already, the problem is the app scaling\n2010-07-22 16:04:47 <hal>   marshall_law: surely it already does that at the moment, with the height?\n2010-07-22 16:05:09 <marshall_law>  it's a bug in the scaling code\n2010-07-22 16:05:15 <marshall_law>  deep inside android, not public to me\n2010-07-22 16:05:24 <marshall_law>  i have to hack to even see the values they're playing with\n2010-07-22 16:04:42 <marshall_law>  so for now your best bet is to just manually size it.. there's a _ton_ of custom logic in TextView.layout that I'm afraid I won't be able to circumvent\n2010-07-22 16:05:42 <marshall_law>  hal: i wrote a mini blog post about it actually lol\n2010-07-22 16:05:43 <marshall_law>  http://www.arcaner.com/2010/07/20/querying-applicationscale-in-android/\n2010-07-22 16:05:46 <hal>   marshall_law: then the next course of action surely should be to escalate it to google. Does appcelerator have a direct support contact with them?\n2010-07-22 16:06:29 <marshall_law>  we have some contacts i'm not sure about support though. they don't support android like we do titanium that i'm aware of. we can open a bug though\n2010-07-22 16:06:50 <marshall_law>  i'd need to boil down the example to pure java / android\n2010-07-22 16:06:55 <marshall_law>  it might take me some time\n
\n

Bearing in mind that there may not me a resolution soon, I think\nwhen dimensions in percentages work throughout the environment,\nthey will provide a workaround to this in most situations.

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:59.000+0000", "updated": "2011-04-15T02:48:59.000+0000" }, { "id": "125301", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The workaround for this is to use static sizes for now, with\nsome supporting code to fix it in most cases. The root cause is\nandroid scaling (which can also be solved by setting\nanyDensity=\"false\", and using Platform.displayCaps). Our new JSS\nsupport should also help alleviate density / resolution specific\nissues

{html}", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:49:00.000+0000", "updated": "2011-04-15T02:49:00.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }