Hello
I have an app that I'm developing for a year now and it has a lot of labels, spinners and other views on different activities. This app runs on basically any Android 3.0+ device, no matter the screen size and scale.
So far everything worked fine, the labels are set in the designer and so far for each device that I've tested the labels' textsizes were scaled automatically to the correct values without any intervention (as far as I know this is how this process works for the views that are set inside the designer).
Recently I ran my app on a Samsung Galaxy Note 3 (1920 x 1080 px, scale=3 (480 dpi)), and still everything looks as it should.
Then I ran my app on a Samsung Galaxy Tab S 8.4 (2560 x 1600 px, scale=2 (320 dpi)), and... all labels look small!!!!
The only way I was able to solve the problem on the Tab S 8.4 was to include the following:
This set everything back to normal, but ONLY for that Tab S 8.4!
If I keep this, then everything is a lot larger for all the previous devices I've tested!
My guess is that the automatic scaling that normally takes place for the views already set inside a layout does have a limitation, maybe on high resolutions like the Tab S 8.4 has.
If anyone can test or confirm this, I'd gladly be interested in a solution for this!!!
Thank you!
Adrian
I have an app that I'm developing for a year now and it has a lot of labels, spinners and other views on different activities. This app runs on basically any Android 3.0+ device, no matter the screen size and scale.
So far everything worked fine, the labels are set in the designer and so far for each device that I've tested the labels' textsizes were scaled automatically to the correct values without any intervention (as far as I know this is how this process works for the views that are set inside the designer).
Recently I ran my app on a Samsung Galaxy Note 3 (1920 x 1080 px, scale=3 (480 dpi)), and still everything looks as it should.
Then I ran my app on a Samsung Galaxy Tab S 8.4 (2560 x 1600 px, scale=2 (320 dpi)), and... all labels look small!!!!
The only way I was able to solve the problem on the Tab S 8.4 was to include the following:
B4X:
For Each v As View In Activity.GetAllViewsRecursive
If v Is Label Then
Dim vLb As Label
vLb = v
vLb.TextSize = Round2(vLb.TextSize * GetDeviceLayoutValues.Scale, 0)
End If
If v Is Spinner Then
Dim vSp As Spinner
vSp = v
vSp.TextSize = Round2(vSp.TextSize * GetDeviceLayoutValues.Scale, 0)
End If
Next
This set everything back to normal, but ONLY for that Tab S 8.4!
If I keep this, then everything is a lot larger for all the previous devices I've tested!
My guess is that the automatic scaling that normally takes place for the views already set inside a layout does have a limitation, maybe on high resolutions like the Tab S 8.4 has.
If anyone can test or confirm this, I'd gladly be interested in a solution for this!!!
Thank you!
Adrian