:sign0104:is there a way to run my app during slideout of keyboard and minimize it when slide-in of keyboard?
can you help me with the code? i'm a noob at coding and stuff.
thanks in advance.
It is possible to catch the display orientation change event with agraham's SystemState library.
You will need to set an event for 'DisplayRotation' property.
It is possible to catch the display orientation change event with agraham's SystemState library.
You will need to set an event for 'DisplayRotation' property.
hi,
how or what is the code to create/set an event for display rotation property?
i don't know how to code this, i have not done any coding.
thanks for the help.
Sub Globals
End Sub
Sub App_Start
Form1.Show
flb.New1("form1",B4PObject(1))
SysState.New1("DisplayRotation")
End Sub
Sub SysState_StateChanged 'This code will be fired when the orientation will chage.
form1.Show
textbox1.Text = SysState.CurrentValue 'will return 90 or 0 depending or the orientation.
End Sub
Sub Menu1_Click
AppClose
End Sub
You will need to download the SystemState library.
thanks for the reply but i dont know how to implement the code into my app.
what i want to do is to run my app during slide out of keyboard and run in background when slide in of keyboard.
B4X:
Sub App_Start
flb.New1("landscape",B4PObject(1))
sysstate.New1("DisplayRotation")
End Sub
Sub SysState_StateChange
landscape.Show 'landscape is the name of the form
If (SysState.CurrentValue=270) Then landscape.Show 'run the form when landscape mode
If (SysState.CurrentValue=0) Then hardware.ShowTodayScreen 'run my app in background
End Sub
Sub SysState_StateChange
If SysState.CurrentValue=0 Then hardware.ShowTodayScreen
If SysState.CurrentValue=270 OR sysstate.currentValye = 90 Then Landscape.Show
End Sub
BTW, you should only upload source code and other image files. No need to upload dlls.
Sub SysState_StateChange
If SysState.CurrentValue=0 Then hardware.ShowTodayScreen
If SysState.CurrentValue=270 OR sysstate.currentValye = 90 Then Landscape.Show
End Sub
BTW, you should only upload source code and other image files. No need to upload dlls.
hi there again,
i still can't get it to work, so i made a new app (say app1) to run another app (say app2). that way i can get it to work when i slide my keyboard out and i made an event for app1 to kill the process of app2 when i slide the keyboard in.
the problem is when i slide the keyboard out again it takes a while to load/open app2.
is there a way to run and minimize or hide app2 by running app1 so that when i slide the keyboard in & out it will load fast? is there a way to combine the two apps? and is there a way to lessen the memory consumption of the apps?
thanks again and sorry for all the trouble.
attached are the source codes
Apparently the system changed event is not accurate enough.
Another solution would be to use a timer to test its value:
B4X:
Sub Globals
lastOrientation = -1
End Sub
Sub App_Start
Form1.Show
flb.New1("form1",B4PObject(1))
SysState.New1("DisplayRotation")
hardware.New1
textbox1.Text = sysstate.CurrentValue
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Sub Timer1_Tick
newOrientation = SysState.CurrentValue
If newOrientation = lastOrientation Then Return
If newOrientation = 0 Then hardware.ShowTodayScreen
If SysState.CurrentValue=270 OR SysState.CurrentValue=90 Then form1.Show
lastOrientation = newOrientation
End Sub
still not working for me, anyway thanks for the help, maybe i need to do some research & study some programming language first before i make some app, hehe.
regards,
mike
p.s.
is there a way to hide application1 by running application2? thanks.