Hi, does anyone know a method to set the font scale to large via code ?
Thanks in advance
John
Thanks in advance
John
AddPermission("android.permission.WRITE_SETTINGS")
Dim P As Phone
Log($"Current: ${P.GetSettings("FONT_SCALE")}"$)
Dim value As Float = 4
WriteSetting("FONT_SCALE", value)
Log($"After: ${P.GetSettings("FONT_SCALE")}"$)
Sub WriteSetting(Setting As String, Value As Float)
Dim r1 As Reflector
Dim args(3) As Object
Dim types(3) As String
r1.Target = r1.GetContext
args(0) = r1.RunMethod("getContentResolver")
types(0) = "android.content.ContentResolver"
args(1) = Setting
types(1) = "java.lang.String"
args(2) = Value
types(2) = "java.lang.float"
r1.RunStaticMethod("android.provider.Settings$System", "putFloat", args, types)
End Sub