Private Sub PrefDialog_IsValid(TempData As Map) As Boolean
Dim number As Int = TempData.GetDefault("NumberToValidate", 0)
If number < 10 Or number > 20 Then
prefdialog.ScrollToItemWithError("NumberToValidate")
Return False
End If
Return True
End Sub
'-------------------------------------------------------------------------------------------------------------
'Note here we have vTextField from Preferences dialog library as XUIViews library was changed to supply this!!
'-------------------------------------------------------------------------------------------------------------
Private Sub PrefDialog_TextFieldClicked(vTextField As B4XView)
'vTextField.Tag will hold an Int array:
'at arr(0): Enums.eEditText.PreferencesDialogTextField(34)
'at arr(1): Type tPreferenceDialogItem (iText ,iDate ,iColor, iNumber, iDecimalNumber, iMultilineText etc.)
'Dim arr() As Int = vTextField.Tag
'Log("PrefDialog_TextFieldClicked, vTextField.Tag: " & arr(0) & ", " & arr(1))
'------------------------------------------------------------------------------
'this is needed to get a new text field if the keyboard was already visible
'note clicking in the same text field won't trigger this event, so that is good
'------------------------------------------------------------------------------
cMP.HideKeyboard
'this is used to put the keyboard top or bottom, not to cover the vTextField
'---------------------------------------------------------------------------
Dim iYPos As Int = vTextField.Parent.Parent.Parent.Top
Dim iScrollPosY As Int = prefdialog.CustomListView1.sv.ScrollViewOffsetY
Dim iYPosReal As Int = iYPos - iScrollPosY
vSelectedTextField = vTextField
SetOptionsCustomKeyboard(vTextField)
cMP.iFocussedEditText = Enums.eEditText.PreferencesDialogTextField
cMP.SetKeyboard(vTextField, iYPosReal, False)
End Sub