GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-08T20:58:14.000+0000 |
Affected Version/s | Release 2.1.0, Release 2.0.1 |
Fix Version/s | Release 3.0.0, Sprint 2012-20 Core, 2012 Sprint 20 |
Components | Android |
Labels | core, module_android, parity, qe-manualtest |
Reporter | Tim Poulsen |
Assignee | Bill Dawson |
Created | 2012-05-16T17:36:43.000+0000 |
Updated | 2014-08-08T22:01:47.000+0000 |
Expected results:
I can set the ti.ui.defaultunit property in tiapp.xml to 'dip' and have font sizes respect that setting.
Actual results:
I can explicitly set fontSize='14dip' and text will be sized appropriately. But setting the default unit in tiapp.xml and setting fontSize=14 gives px based font sizing.
See the attached screen:
dip is included in the tiapp.xml file, the field labels (URL, Username, etc.) are set with fontSize=## whereas the contents of the first text field is set with fontSize='14dip'
Tested on my Galaxy Nexus running ICS/4.0.2. I'm using the
https://github.com/gshipley/BeerShift application featured in the developer blog.
+1
Fail case / Test case
**Note**: Need a high density device to test with (that's basically any device these days) or an emulator such as WVGA854.Create a new mobile project, leave the ti.ui.defaultunit setting in tiapp.xml at "system".
Replace the app.js with the code from below.
Run the app. The text is crazy small.
Change the ti.ui.defaultunit setting in tiapp.xml to "dip".
Run the app again. In the fail case, the text is still crazy small. When testing the fix, the text should have grown up.
Notes: TextArea (another control that supports "font") uses the same view as TextField, so I haven't bothered to add it here. Anyways, all of our controls that support "font" use the exact same method in Java to style the text: TiUIHelper.styleText. Here's that app.js (I've also attached it since it's kinda long):PR ready: https://github.com/appcelerator/titanium_mobile/pull/3108
Verified the issue is no more occurring. Changing to 'dip' increased int font size. Titanium studio : 3.0.0.201211301903 SDK Version : 3.0.0.v20121204154658 CLI version : 3.0.19 OS : OSX 10.8.2 Android : 4.0.4 Samsung S3