I have tried the below code and it works fine with Samsung S5 even if I increase the font size on the phone. But when I am testing the same in Samsung S6 & S7 it is not working. The text on the buttons are not scaled correctly.
Please anyone help me out.
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
Find attached the simple test code. I have tested this code in S6 & S7 and the
text on the buttons are not showing completely. But works fine with Samsung s5.
You need to decrease the TextSize !
For a height of 28dip you need a TextSize of 8 to get the text displayed correctly.
To me, 28 dip on my Samsung S6, looks awfully small.