Hello,
Hope you can help - I'm getting back to b4a, and been struggling with b4x pages, and keyboard when closing and opening.
On registration page, I need to push the view top by X, so it's show the input boxes behind the keyboard, I did saw there is an option to use scroll view, but I thought I try the IME from what I saw the tutorial, and other posts.
I used the code from this post : https://www.b4x.com/android/forum/threads/how-to-detect-if-ime-soft-keyboard-is-closed.141183/
My if check -
Which does what it suppose to - I can move the layout to the top and see the input boxes, and keyboard closes and it's back to bottom.
However if I press the lock screen button on phone, and come back - this stop functioning and won't move the layout back to top by X
So, is this the best practice? and What is the solution to make the the IME_HeightChange triggers again after resume?
Thank you.
Hope you can help - I'm getting back to b4a, and been struggling with b4x pages, and keyboard when closing and opening.
On registration page, I need to push the view top by X, so it's show the input boxes behind the keyboard, I did saw there is an option to use scroll view, but I thought I try the IME from what I saw the tutorial, and other posts.
I used the code from this post : https://www.b4x.com/android/forum/threads/how-to-detect-if-ime-soft-keyboard-is-closed.141183/
B4X:
Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int)
Private IsIMEKeyboardClosed As Boolean = (NewHeight = ActivityHeight)
LogColor("IsIMEKeyboardClosed >> " & IsIMEKeyboardClosed, Colors.Red)
End Sub
My if check -
B4X:
If IsIMEKeyboardClosed = True Then
contentPanel.SetLayoutAnimated(400, contentPanel.Left, OriginalTop, contentPanel.Width, contentPanel.Height)
Else
contentPanel.SetLayoutAnimated(400, contentPanel.Left, OriginalTop - 120dip, contentPanel.Width, contentPanel.Height)
End If
Which does what it suppose to - I can move the layout to the top and see the input boxes, and keyboard closes and it's back to bottom.
However if I press the lock screen button on phone, and come back - this stop functioning and won't move the layout back to top by X
So, is this the best practice? and What is the solution to make the the IME_HeightChange triggers again after resume?
Thank you.