{
private AP mAp;
private WiFi mWifi;
- private TextField passwordField;
+ private TextField mPasswordField;
+ private Button mConnectButton;
internal ConnectPage(WiFi wifi)
{
HeightSpecification = LayoutParamPolicies.WrapContent,
};
- passwordField = CreatePasswordField();
- connectView.Add(passwordField);
+ mPasswordField = CreatePasswordField();
+ mPasswordField.TextChanged += OnTextChanged;
+ connectView.Add(mPasswordField);
if(mAp.IsWps)
{
};
cancelButton.Clicked += OnCancelClicked;
- var connectButton = new Button()
+ mConnectButton = new Button()
{
Text = Resources.IDS_WIFI_BODY_CONNECT,
};
- connectButton.Clicked += OnConnectClicked;
+ mConnectButton.IsEnabled = false;
+ mConnectButton.Clicked += OnConnectClicked;
Content = new AlertDialog()
{
Title = mAp.Essid,
Content = connectView,
- Actions = new View[] { cancelButton, connectButton},
+ Actions = new View[] { cancelButton, mConnectButton},
};
}
{
Debug("Connect");
//mAp.StateInfo = Resources.IDS_WIFI_BODY_CONNECTING_ING;
- await mWifi.Connect(mAp, passwordField.Text);
+ await mWifi.Connect(mAp, mPasswordField.Text);
if(mWifi.GetConnectedAP().Equals(mAp.Essid))
{
mAp.StateInfo = Resources.IDS_WIFI_SBODY_CONNECTED_M_STATUS;
}
}
+
+ private void OnTextChanged(object sender, TextField.TextChangedEventArgs e)
+ {
+ try
+ {
+ Debug("Password field changed");
+ mConnectButton.IsEnabled = mPasswordField.Text.Length >= Constants.MIN_PASSWORD_LENGTH? true : false;
+ }
+ catch (Exception ex)
+ {
+ Debug("Exception: " + ex.Message);
+ }
+ }
}
}
+using System;
using System.Collections.Generic;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
{
private WiFi mWifi;
private APSource mApSource;
- private TextField ssidField;
private AP mAp;
Window window = NUIApplication.GetDefaultWindow();
+ private TextField ssidField;
+ private Button mFindButton;
+
internal HiddenConnectPage(WiFi wifi)
{
mWifi = wifi;
PlaceholderText = Resources.IDS_ST_BODY_NETWORK_SSID,
WidthSpecification = 400,
};
-
+ ssidField.TextChanged += OnTextChanged;
findView.Add(ssidField);
- var item = new DefaultLinearItem();
- findView.Add(item);
-
var cancelButton = CreateCancelButton();
- var findButton = CreateButton(300, 80, Resources.IDS_COM_BODY_FIND);
- findButton.Clicked += (object source, ClickedEventArgs args) =>
+
+ mFindButton = CreateButton(300, 80, Resources.IDS_COM_BODY_FIND);
+ mFindButton.IsEnabled = false;
+ mFindButton.Clicked += (object source, ClickedEventArgs args) =>
{
if (mWifi.IsActive())
{
{
Title = Resources.IDS_WIFI_BUTTON_FIND_HIDDEN_NETWORK,
Content = findView,
- Actions = new View[] { cancelButton, findButton, },
+ Actions = new View[] { cancelButton, mFindButton, },
};
return alt;
}
}
else
{
- //Debug("More than one ap found with ssid " + essid);
-
- //foreach (var item in apList)
- //{
- // Debug("More than one ap found with ssid " + essid);
- //}
+ // Not required as of now because rpi4 doesn't search for more than one AP with same ssid.
+ Debug("More than one ap found with ssid " + apList.Count);
}
}
page.CreateComponents(ap);
return page;
}
+
+ private void OnTextChanged(object sender, TextField.TextChangedEventArgs arg)
+ {
+ try
+ {
+ Debug("Text Changed Event");
+ mFindButton.IsEnabled = ssidField.Text.Length > 0 ? true : false;
+ }
+ catch(Exception e)
+ {
+ Debug("Exception: " + e.Message);
+ }
+
+ }
}
}