Sub btnGetWifiData_Click
Dim sf As Object = WifiDialog.ShowAsync("Enter Wifi Details", "Ok", "Cancel", "", LoadBitmap(File.DirAssets, "form.png"), True)
WifiDialog.SetSize(100%x, 400dip)
Wait For (sf) Dialog_Ready(pnl As Panel)
pnl.LoadLayout("newwifidialog")
'0x00002000 = TYPE_TEXT_FLAG_CAP_WORDS (capitalize first character of each word)
FloatLabeledEditTextSSID.EditText.InputType = Bit.Or(0x00002000, FloatLabeledEditTextSSID.EditText.InputType)
FloatLabeledEditTextPassword.EditText.InputType = Bit.Or(0x00002000, FloatLabeledEditTextPassword.EditText.InputType)
WifiDialog.GetButton(DialogResponse.POSITIVE).Enabled = False
Wait For (sf) Dialog_Result(res As Int)
'force the keyboard to hide
FloatLabeledEditTextSSID.EditText.Enabled = False
FloatLabeledEditTextPassword.EditText.Enabled = False
If res = DialogResponse.POSITIVE Then
ToastMessageShow($"${FloatLabeledEditTextSSID.Text} ${FloatLabeledEditTextPassword.Text} "$, True)
End If
End Sub
Sub CheckAllFieldsValid
Dim valid As Boolean = False
If FloatLabeledEditTextSSID.Text.Length > 0 Then
If FloatLabeledEditTextPassword.Text.Length > 0 Then
valid = True
WifiDialog.GetButton(DialogResponse.POSITIVE).Enabled = valid
End If
End If
End Sub
Sub FloatLabeledEditTextSSID_TextChanged (Old As String, New As String)
CheckAllFieldsValid
End Sub
Sub FloatLabeledEditTextPassword_TextChanged (Old As String, New As String)
CheckAllFieldsValid
End Sub