Android Question the soft keyboard button don´t change the text to Next after shown

alian712

Member
Hi all.
I´m using the b4x Dialog library to show a dialog with two edit views and a label above. But I´v got this problem when the keyboard is shown: the text of the button do not change to "next". After change manually the edit views, the text do change to Next & Done. It happens only when build the edit views in the code, not in the case of loading a layout.
Dim xDlg As B4XDialog
Dim xDlgPnl As B4XView
Dim lblMsg, lblKeyMsg As Label
Dim edtNm, edtPwd, edtKey As ACEditText
Dim csb As CSBuilder
csb.Initialize

xDlg.Initialize(Activity)
xDlg.Title = csb.Typeface(Typeface.DEFAULT).Size(20).Append("Add").PopAll
xDlgPnl = xui.CreatePanel("")
xDlgPnl.SetLayoutAnimated(0, 0, 0, 90%x, 150dip)

lblMsg.Initialize("")
lblMsg.Text = "Some text here"
lblMsg.TextSize = 16
xDlgPnl.AddView(lblMsg, 10dip, 0, xDlgPnl.Width - 20dip, 30dip)

edtNm.Initialize("edtNm")
edtNm.TextSize = 16
edtNm.Hint = "Name"
edtNm.SingleLine = True
xDlgPnl.AddView(edtNm, 10dip, lblMsg.Top + lblMsg.Height, xDlgPnl.Width - 20dip, 50dip)

edtPwd.Initialize("edtPwd")
edtPwd.TextSize = 16
edtPwd.Hint = "Key"
edtPwd.SingleLine = True
edtPwd.ForceDoneButton = True
xDlgPnl.AddView(edtPwd, 10dip, lblMsg.Top + lblMsg.Height, xDlgPnl.Width - 20dip, 50dip)

edtNm.RequestFocus
iniDialog = True
Wait For (xDlg.ShowCustom(xDlgPnl, "Ok", "", "Cancel")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
...
End If


Sub edtNm_FocusChanged (HasFocus As Boolean)
If HasFocus Then
ime.AddHandleActionEvent(edtNm)
ime.ShowKeyboard(edtNm)
CheckEdtNm
End If
End Sub

Sub edtPwd_FocusChanged (HasFocus As Boolean)
If HasFocus Then
ime.AddHandleActionEvent(edtPwd)
ime.ShowKeyboard(edtPwd)
CheckEdtPwd
End If
End Sub

Sub Ime_HandleAction As Boolean
Dim btnYes As B4XView = xDlg.GetButton(xui.DialogResponse_Positive)
Dim edtTxt As EditText = Sender
Select edtTxt.Hint
Case "Name"
CheckEdtNm
Return True
Case "Key"
CheckEdtPwd
If btnYes.Enabled Then
xDlg.Close(xui.DialogResponse_Positive)
Return False
Else
Return True
End If
Case Else
Return True
End Select
End Sub
 
Top