Hi,
On my device (my development phone, Nexus 5x) it shows my UI correctly (it has the font size as normal), but on another persons phone (Samsung Galazy S7 edge) they have the font size set to Extra Large.
I am using the following code to make my objects in my layout display correctly regardless on the font size the user has set.
It seem to work for labels but I have some spinners in my layout and the following code doesn't seem to work.
Any ideas on what has gone wrong?
I am loading my layout before ResetUserFontScale(Activity) is called.
On my device (my development phone, Nexus 5x) it shows my UI correctly (it has the font size as normal), but on another persons phone (Samsung Galazy S7 edge) they have the font size set to Extra Large.
I am using the following code to make my objects in my layout display correctly regardless on the font size the user has set.
It seem to work for labels but I have some spinners in my layout and the following code doesn't seem to work.
Any ideas on what has gone wrong?
I am loading my layout before ResetUserFontScale(Activity) is called.
B4X:
Sub Process_Globals
Dim access As Accessiblity
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
ResetUserFontScale(Activity)
End Sub
Sub ResetUserFontScale(p As Panel)
For Each v As View In p
If v Is Panel Then
ResetUserFontScale(v)
Else If v Is Label Then
Dim lbl As Label = v
lbl.TextSize = lbl.TextSize / access.GetUserFontScale
Else If v Is Spinner Then
Dim s As Spinner = v
s.TextSize = s.TextSize / access.GetUserFontScale
End If
Next
End Sub