This code will take care of Labels, EditText, Buttons, CheckBoxes, RadioBoxes and Spinners:
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
"You" (I mean someone) could add the case v is a ListView
It seems ListView does not have the TextSize property....
Dim lv As ListView
lv.SingleLineLayout.Label.TextSize
lv.TwoLinesLayout.Label.TextSize
lv.TwoLinesAndBitmap.Label.TextSize
For ListView you need to do it with
ListView1.SingleLineLayout.Label.TextSize
ListView1.TwoLinesLayout.Label.TextSize
ListView1.TwoLinesLayout.SecondLabel.TextSize
ListView1.TwoLinesAndBitmap.Label.TextSize
ListView1.TwoLinesAndBitmap.SecondLabel.TextSize
It is possible. You will need to test it to find the right values.Or maybe there are some useful coefficient I could use to increase all labels?
This code will take care of Labels, EditText, Buttons, CheckBoxes, RadioBoxes and Spinners:
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
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?