Android Question Scale Panel (AutoScale examples)

Harris

Expert
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    DefCM.ph.SetScreenBrightness(  Max(DefCM.scrndim, 5) / 100 )   
    Activity.LoadLayout("loLogin")
'    CallSubDelayed(Main,"CheckRegisteration")
'    DoEvents
    DefCM.SetOro
'    keyb.Initialize("")
    mp.Initialize
    edtpass.RequestFocus
    InitKeyboard
    GetEmpList(1)
   
    btnCancel.Background = BDmod.CreateStateListDrawable
    btnLogin.Background  = BDmod.CreateStateListDrawable
    btnFilt.Background   = BDmod.CreateStateListDrawable
   
End Sub
Sub Activity_Resume
    btnLogin.Text = "Continue"
    Scale.SetRate(0.5)
    Scale.ScaleAll(pnlKeyboard,  True)
    pnlKeyboard.Left =  (Activity.Width - pnlKeyboard.Width) - 15dip
    pnlKeyboard.Top = 50%y - pnlKeyboard.Height / 2
End Sub

This code and the Scale code module from Klaus has an issue...
First pic is normal.
Second pic shows result after a pause and resume.
I couldn't find, in the Scale code module how it accomplished such a feat (double sizing the panel).

Thanks
numpad0.png

numpad1.png
 

Harris

Expert
Licensed User
Longtime User
You should move Scale.SetRate(0.5) and Scale.ScaleAll(pnlKeyboard, True) from Activit_Resume to Activity_Create.

Perfect, Thanks Klaus!
Nice example - works great for old guys with fat fingers...
Version 2 of this numpad will have a decimal point, backspace and the done button.
 
Upvote 0
Top