Android Question TextField always visible in CustomListView

ThePuiu

Active Member
Licensed User
Longtime User
I have a CustomListView on the entire surface of the screen. The list contains a single item that is longer than the screen height. The panel contains several B4XFloatTextField. Navigating from one textfield to the next is done with the Next key. How can I make the current TextField always be above the keyboard when it receives focus?
 

Mahares

Expert
Licensed User
Longtime User
How can I make the current TextField always be above the keyboard when it receives focus?
With this I think you can actually raise the xCLV, which in tun allows you to bring the B4XFloatTextField above the keyboard.
Include the: IME.AddHeightChangedEvent after you initialize the IME with: IME.Initialize("ime"). Then use this event sub:
B4X:
Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
    CustomListView1.GetBase.SetLayoutAnimated(0,0,0,CustomListView1.AsView.Width,NewHeight)   '    Resize base panel
    CustomListView1.Base_Resize (CustomListView1.GetBase.Width, CustomListView1.GetBase.Height)  'call CLV.Base_Resize
End Sub
Please give your feedback after you try it, if it makes sense or need better response.
 
Upvote 0

ThePuiu

Active Member
Licensed User
Longtime User
It's ok how it works until the keyboard is hidden. How can you return to the normal size of Custom ListView but the scroll should be maintained to the last input in which it was edited?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
he scroll should be maintained to the last input in which it was edited?
If I understand you. You want to have the focus still remain at the record you just edited instead of jumping to the next box. If that is the case here it is:
B4X:
Sub f_EnterPressed  'f is the common event name for all the B4XFLoatTextFields
    Dim ff As B4XFloatTextField =Sender
    ff.RequestFocusAndShowKeyboard
    IME.HideKeyboard    
End Sub
If that is not your desired goal, then someone else may have a better answer.
 
Upvote 0
Top