Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24801] Android: Ti.UI.Label.minimumFontSize property changes size randomly

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-06-23T01:30:49.000+0000
Affected Version/sRelease 6.1.0
Fix Version/sRelease 6.1.1
ComponentsAndroid
Labelsandroid, regression
ReporterHans Knöchel
AssigneeJoshua Quick
Created2017-06-09T14:36:31.000+0000
Updated2017-06-23T22:11:41.000+0000

Description

We introduced the minimumFontSize property on Android in TIMOB-1618 for iOS parity. There are reports on Slack (thanks [~perdona]) that the size changes randomly. [~cornflakesuperstar] (thanks to you as well) narrowed down the issue and found out it has to do with the density-unit: {quote} I have narrowed this down some further for my app and determined it is a problem with android os 6.0.1 (marshmallow) for my app regardless of which version of the ti sdk it is built with (I have tried ti 5.5.1, 6.0.4 and 6.1.0). I removed from tiapp.xml and I also removed ‘dp’ and ‘sp’ denominations from fontSize specifications in all the tss for my app in order to fix the font size issue. It also seems related to a bizarre shrinking bug whereby the actionbar for sub-windows in the app appear to be smaller than normal and the contents of those actionbars are also shrunk. {quote}

Comments

  1. Jason Kotchoff 2017-06-09

    I was able to narrow the issue down further and identify that in my case, it was related to usage of the ti.admob module in my app (I wasn't using minimumFontSize) and that it's consistently reproduceable. Specifically, after I add any Admob.createView to my android app (in a sub-window in my case), all subsequent labels on that window and subsequent windows render as incorrectly sized for Android 6.0.1. Android 4.2.2 doesn't have any problems. I was initially able to work around this by removing the -dp- from the tiapp.xml and also removing -dp- and -sp- from all my label size definitions in all tss however I was unable to fix the label icons in my ActionBars which is causing my ActionBars to shrink and become practically unusable and so for now my workaround is just to remove ti.admob completely from my app. Note, the ti.admob module doesn't have a published 6.0.0 compatible .zip so I created one in this pull request: https://github.com/appcelerator-modules/ti.admob/pull/70 and that is what is causing this bug. I didn't make any code changes to it though so it seems like a problem with the actual admob module itself.
  2. Caio Perdona 2017-06-10

    In my case, I was unable to identify the cause. A listView was changing its row's labels fontsizes at runtime, exploding views and making text unreadable. So I set the property to null on Android and moved on. Is it relevant to say that my project is classic (no alloy) ? Also I have a video demonstrating what's going on visually on the device, but dont know the best way to attach here...
  3. Gary Mathews 2017-06-10

    [~perdona] Could you provide a test case that reproduces this issue?
  4. Caio Perdona 2017-06-13

    @Gary Mathews Unfortunately I can't. Already lost too much time fixing the issues 6.1.0.GA have brought to my classic Ti app. What I can tell you is that I'm using
     minimumFontSize: 14 
    and my app started to behave like in the video below. https://www.dropbox.com/s/l4kgfceunw25b8v/2017_06_13_14_18_59.mp4?dl=0
  5. Joshua Quick 2017-06-13

    [~perdona], thanks for the video footage. The issue here (and we're able to reproduce it) is that the label should only scale down. It should not scale up. That's why you're seeing large clipped text on Android. We're looking into fixing this issue now.
  6. Caio Perdona 2017-06-13

    @Joshua Quick sorry I wasn't able to help in a more effective way! Best of luck with this issue and thanks in advance!
  7. Jason Kotchoff 2017-06-13

    Joshua, thanks for taking this up. If you can, it would be great if you could test that your solution works with the appcelerator ti.admob module as well.
  8. Joshua Quick 2017-06-19

    PR (6.1.x): https://github.com/appcelerator/titanium_mobile/pull/9161
  9. Lokesh Choudhary 2017-06-23

    FR Passed for 6.1.1
  10. Joshua Quick 2017-06-23

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9175
  11. Lokesh Choudhary 2017-06-23

    FR passed for master.
  12. Lokesh Choudhary 2017-06-23

    Verified the fix. Test info in the PR. Closing. Studio Ver: 4.9.0.201705302345 SDK Ver: 6.2.0.v20170623140932, 6.1.1.v20170623141152 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.2 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.11 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel — Android 7.1.1 ⇨ google Nexus 5 — Android 6.0.1

JSON Source