TextField ssidTextField;
View ssidUnderline;
TextLabel securityTypeLabel;
- Button securityTypeButton;
+ TextLabel selectedSecurityTypeLabel;
+ TapGestureDetector securityTypeDetector;
TextLabel usernameLabel;
TextField usernameTextField;
View usernameUnderline;
TextLabel failureLabel;
WifiUISecurityType currentSecurityType;
private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
+ private string arrowImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_back_active.png");
static Color largeTextColor => new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f);
static Color smallTextColor => new Color(0.0f, 0xC / 255.0f, 0x2B / 255.0f, 1.0f);
this.Add(ssidUnderline);
securityTypeLabel = CreateTextLabel("WIFI_SECURITY_TYPE", new Position2D(104, 144));
- this.Add(securityTypeLabel);
-
- securityTypeButton = new Button
- {
- Size = new Size(583, 30),
- Position2D = new Position2D(121, 161),
- PointSize = 22,
- Text = currentSecurityType.GetUIName(),
- BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f),
- TextAlignment = HorizontalAlignment.Begin,
- CellHorizontalAlignment = HorizontalAlignmentType.Center,
- CellVerticalAlignment = VerticalAlignmentType.Center
- };
- securityTypeButton.ClickEvent += (s, e) => OpenSecurityTypePopup();
- this.Add(securityTypeButton);
+ this.Add(securityTypeLabel);\r
+
+ this.Add(CreateSecurityTypeButton());
cancelButton = new Button(ButtonStyles.Cancel)
{
return;
}
bool success = false;
- if(aps is null || aps.Count() == 0)
+ if (aps is null || aps.Count() == 0)
{
ShowFailureSsidLabel();
return;
var orginal_task = wifiAp.ConnectAsync();
task = orginal_task as Task<bool>;
}
- catch(Exception connectionException)
+ catch (Exception connectionException)
{
Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
$"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
break;
}
}
- catch(Exception connectionException)
+ catch (Exception connectionException)
{
Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
- $"Password: {(passwordEntry is null? "not set" : "XXXXXXXX")}, " +
+ $"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
$"Security type: {currentSecurityType.GetUIName()} " +
connectionException.Message);
continue;
};
failureLabel.Hide();
this.Add(failureLabel);
- }
-
+ }\r
+\r
+ private View CreateSecurityTypeButton()\r
+ {\r
+ var view = new View()\r
+ {\r
+ Size = new Size(583, 30),\r
+ Position2D = new Position2D(121, 161),\r
+ Layout = new AbsoluteLayout(),\r
+ };\r
+ selectedSecurityTypeLabel = new TextLabel()\r
+ {\r
+ Size = new Size(200, 28),\r
+ PixelSize = 22,\r
+ TranslatableText = currentSecurityType.GetUIName(),\r
+ FontStyle = new PropertyMap().AddRegularFontStyle(),\r
+ FontFamily = "BreezeSans",\r
+ TextColor = largeTextColor,\r
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center,\r
+ };\r
+ view.Add(selectedSecurityTypeLabel);\r
+ view.Add(new View()\r
+ {\r
+ BackgroundImage = arrowImagePath,\r
+ Position = new Position(568, 2),\r
+ });\r
+ securityTypeDetector = new TapGestureDetector();\r
+ securityTypeDetector.Attach(view);\r
+ securityTypeDetector.Detected += (s, e) => OpenSecurityTypePopup();\r
+ return view;\r
+ }\r
+\r
void OpenSecurityTypePopup()
{
var view = new ChangeSecurityTypePopup(currentSecurityType);
usernameTextField = null;
}
- if(!(usernameUnderline is null))
+ if (!(usernameUnderline is null))
{
usernameUnderline.Unparent();
usernameUnderline.Dispose();
this.Add(usernameTextField);
}
- if(usernameUnderline is null)
+ if (usernameUnderline is null)
{
usernameUnderline = CreateUnderline();
this.Add(usernameUnderline);
this.Add(passwordEntry);
}
- if(passwordUnderline is null)
+ if (passwordUnderline is null)
{
passwordUnderline = CreateUnderline();
this.Add(passwordUnderline);
Tizen.Log.Debug("oobe", $"Reseting view to {securityType.GetUIName()}");
failureLabel.Hide();
currentSecurityType = securityType;
- securityTypeButton.TranslatableText = securityType.GetUIName();
+ selectedSecurityTypeLabel.TranslatableText = securityType.GetUIName();
switch (securityType)
{
case WifiUISecurityType.None: