Android Question XUI Views Problem in Auto Show Keyboard for Custom Input Dialog

incendio

Well-Known Member
Licensed User
Longtime User
I got problem with Custom Input Dialog, see this post
https://b4x.com/android/forum/threads/b4x-input-dialogs-with-xui-views.101197/#post-638981

Suggestion from Erel's code, has a slight error, have to change the code to this
B4X:
Sub btnCustom_Click
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 300dip, 150dip)
    p.LoadLayout("CustomDialog")
    dialog.PutAtTop = True 'put the dialog at the top of the screen
    Dim rs As ResumableSub =  dialog.ShowCustom(p, "OK", "", "CANCEL")
    fieldFirstName.TextField.RequestFocus  'add TextField
    IME.ShowKeyboard(fieldFirstName.TextField) 'add TextField
    Wait For (rs) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        dialog.Show(fieldFirstName.Text & " " & fieldLastName.Text, "OK", "", "")
    End If
End Sub

That codes, kind of solved the problem, but another problem exist.
When Dialog showed, cursor in first field, virtual keyboard showed, but the ENTER button on virtual keyboard show DONE instead of NEXT.
 

incendio

Well-Known Member
Licensed User
Longtime User
You mean v1.81 right?

Still not worked, virtual keyboard on First Field still shows DONE button, on second field, shows NEXT, and after Dialog closed, Virtual Keyboard still shows.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Still not worked, virtual keyboard on First Field still shows DONE button
This is expected. It should move to the next field when you click on that button.

and after Dialog closed, Virtual Keyboard still shows
I don't see any previous discussion about this issue.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
This is expected. It should move to the next field when you click on that button.


I don't see any previous discussion about this issue.
1. When cursor on first field, on virtual keyboard ENTER button showed DONE, whenpressed, cursor did move to the next field, on next field, button show NEXT text & when press it behave like DONE button, it is behave correctly only strange sign on Virtual Keyboard

2. It is because on the previous discussion, no issue with this. On previous discussion, virtual keyboard disappeared after Dialog closed.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Yes it helps 2 things :
1. Close the virtual keyboard after dialog closed.
2. The First field and the second field all shows DONE button, well at least it is less weird than before. Is this mean that all field - if there are more than 2 fields, beside first field must be set to ForceDoneButton = true?

Tested on Oreo and Jelly Bean.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…