public static ButtonStyle Next = GetNextButtonStyle();
public static ButtonStyle Previous = GetPreviousButtonStyle();
public static ButtonStyle Skip = GetSkipButtonStyle();
- public static ButtonStyle OK = GetOKButtonStyle();
- public static ButtonStyle Cancel = GetCancelButtonStyle();
- public static ButtonStyle Scan = GetScanButtonStyle();
- public static ButtonStyle TurnOnOff = GetTurnOnOffButtonStyle();
- public static ButtonStyle Reveal = GetRevealButtonStyle();
+
private static ButtonStyle GetPreviousButtonStyle() => new ButtonStyle
{
BackgroundImage = new Selector<string>
Size2D = new Size2D(240, 72),
};
- private static ButtonStyle GetCancelButtonStyle()
- {
- var style = GetPreviousButtonStyle();
- style.Text.Text = "CANCEL";
- return style;
- }
- private static ButtonStyle GetScanButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan.png",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_pressed.png",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_disabled.png",
- },
- Size2D = new Size2D(72, 32),
- };
- private static ButtonStyle GetTurnOnOffButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff.png",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff_disabled.png",
- Selected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion.png",
- DisabledSelected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion_disabled.png",
- },
- Size2D = new Size2D(72, 32),
- };
- public static ButtonStyle AddNetwork = GetAddNetworkButtonStyle();
- private static ButtonStyle GetAddNetworkButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork.png",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork_pressed.png",
- },
- Size2D = new Size2D(42, 42),
- };
-
- private static ButtonStyle GetOKButtonStyle()
- {
- var style = GetNextButtonStyle();
- style.Text.Text = "OK";
- return style;
- }
-
private static ButtonStyle GetSkipButtonStyle()
{
var style = GetNextButtonStyle();
Size2D = new Size2D(240, 72),
};
- private static ButtonStyle GetRevealButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_hidden.png"),
- Selected = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_visible.png"),
- },
- Size2D = new Size2D(72, 32),
- };
-
private static Selector<string> GetNavigationFont()
{
return new Selector<string>
-using Oobe.Common.Styles;
-using System;
+using System;
using Tizen.Network.WiFi;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
{
return "Open";
}
- else if(wifiAp.SecurityInformation.IsPassphraseRequired == false)
+ else if (wifiAp.SecurityInformation.IsPassphraseRequired == false)
{
return "Saved";
}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ public class ButtonStyles
+ {
+ public static ButtonStyle Cancel = GetCancelButtonStyle();
+ public static ButtonStyle OK = GetOKButtonStyle();
+ public static ButtonStyle Scan = GetScanButtonStyle();
+ public static ButtonStyle TurnOnOff = GetTurnOnOffButtonStyle();
+ public static ButtonStyle Reveal = GetRevealButtonStyle();
+ public static ButtonStyle AddNetwork = GetAddNetworkButtonStyle();
+
+ private static ButtonStyle GetCancelButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_action.png",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_pressed.png",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_disabled.png",
+ },
+ Text = new TextLabelStyle
+ {
+ PointSize = new Selector<float?>
+ {
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ EnableMarkup = true,
+ Text = "CANCEL", //change to TranslatableText alter adding translations
+ TextColor = new Selector<Color>
+ {
+ Normal = new Color(0.0f, 20.0f / 255.0f, 71 / 255.0f, 1.0f),
+ Pressed = new Color(41.0f / 255.0f, 91.0f / 255.0f, 178 / 255.0f, 1.0f),
+ },
+ FontFamily = GetNavigationFont(),
+ },
+ Size2D = new Size2D(240, 72),
+ };
+
+ private static ButtonStyle GetScanButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan.png",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_pressed.png",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_disabled.png",
+ },
+ Size2D = new Size2D(72, 32),
+ };
+
+ private static ButtonStyle GetTurnOnOffButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff.png",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff_disabled.png",
+ Selected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion.png",
+ DisabledSelected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion_disabled.png",
+ },
+ Size2D = new Size2D(72, 32),
+ };
+
+ private static ButtonStyle GetAddNetworkButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork.png",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork_pressed.png",
+ },
+ Size2D = new Size2D(42, 42),
+ };
+
+ private static ButtonStyle GetRevealButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_hidden.png"),
+ Selected = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_visible.png"),
+ },
+ };
+
+ private static ButtonStyle GetOKButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_active.svg",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_selected.svg",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_disabled.svg",
+ },
+ Text = new TextLabelStyle
+ {
+ PointSize = new Selector<float?>
+ {
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ TextColor = Color.White,
+ Text = "OK", //change to TranslatableText alter adding translations
+ FontFamily = GetNavigationFont(),
+ },
+ Size2D = new Size2D(240, 72),
+ };
+
+ private static Selector<string> GetNavigationFont()
+ {
+ return new Selector<string>
+ {
+ Normal = "BreezeSans",
+ };
+ }
+ }
+}
--- /dev/null
+using Tizen.NUI;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ public static class FontsStyles
+ {
+ private static PropertyMap light;
+
+ public static PropertyMap Light()
+ {
+ if (light == null)
+ {
+ light = new PropertyMap();
+ light.Add("weight", new PropertyValue("light"));
+ }
+ return light;
+ }
+
+ public static PropertyMap Regular()
+ {
+ if (light == null)
+ {
+ light = new PropertyMap();
+ light.Add("weight", new PropertyValue("regular"));
+ }
+ return light;
+ }
+ }
+}
\ No newline at end of file
-using Oobe.Common.Styles;
-using System;
+using System;
using System.Threading.Tasks;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
private const int maxPasswordLength = 63;
private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
private WiFiAP wifiAp;
+ private bool isConnecting = false;
public string Password => passwordEntry.Password;
passwordEntry = new PasswordEntry()
{
Size = new Size(584, 22),
- Position = new Position(112, 144),
+ Position = new Position(112, 134),
MaxLength = maxPasswordLength,
- PixelSize = 15,
+ PixelSize = 22,
TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = FontsStyles.Regular(),
Revealed = false,
};
- passwordEntry.TextChanged += (s, e) => okButton.IsEnabled = Password.Length >= minPasswordLength;
+ passwordEntry.TextChanged += (s, e) => UpdateOKButton();
this.Add(passwordEntry);
- this.Add(new View()
+ this.Add(new View() //underline
{
Size = new Size(584, 1),
- Position = new Position(104, 160),
+ Position = new Position(103, 160),
BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f),
});
var titleLabel = new TextLabel
{
Size = new Size(808, 35),
- Position = new Position(0, 20),
+ Position = new Position(0, 19),
Text = "Enter password",
PixelSize = 28,
TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
var subtitleLabel = new TextLabel
{
- Size = new Size(808, 25),
- Position = new Position(0, 69),
+ Size = new Size(808, 26),
+ Position = new Position(0, 68),
Text = $"Enter password to join \"{wifiAp.NetworkInformation.Essid}\"",
PixelSize = 20,
TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
revealButton = new Button(ButtonStyles.Reveal)
{
- Size = new Size(22, 13),
- Position = new Position(702, 138),
+ Size = new Size(48, 48),
+ Position = new Position(696, 120),
};
revealButton.ClickEvent += (s, e) => TogglePasswordVisibility();
this.Add(revealButton);
};
okButton.ClickEvent += async (s, e) =>
{
- okButton.IsEnabled = false;
+ isConnecting = true;
+ UpdateOKButton();
try
{
Tizen.Log.Debug("oobe", $"connecting to wifi {wifiAp.NetworkInformation.Essid} with password {Password}");
wifiAp.SecurityInformation.SetPassphrase(Password);
- await wifiAp.ConnectAsync();
+ var result = await (wifiAp.ConnectAsync() as Task<bool>);
+ if (result == true)
+ {
+ OobeCommon.Utils.Popup.Dismiss();
+ }
}
catch (Exception ex)
{
}
finally
{
- okButton.IsEnabled = true;
- if (wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Congfiguration
- || wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Connected)
- {
- OobeCommon.Utils.Popup.Dismiss();
- }
- else //there should exist explicit password error path
- {
- connectionFailure.Show();
- }
+ isConnecting = false;
+ UpdateOKButton();
+ connectionFailure.Show();
}
};
this.Add(okButton);
passwordEntry.Revealed = !passwordEntry.Revealed;
revealButton.IsSelected = !revealButton.IsSelected;
}
+
+ private void UpdateOKButton()
+ {
+ okButton.IsEnabled = (Password.Length >= minPasswordLength) && (isConnecting == false);
+ }
}
}
-using Oobe.Common.Styles;
using System;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
});
return manualWifi;
}
-
+
private static View CreatePasswordPopup(Tizen.Network.WiFi.WiFiAP wifiAp)
{
var popup = new WifiPasswordPopup(wifiAp);
using Oobe.Common.Interfaces;
-using Oobe.Common.Styles;
using Tizen.NUI.Components;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
Layout = new AbsoluteLayout(),
};
- var prev = new Button(ButtonStyles.Previous)
+ var prev = new Button(Common.Styles.ButtonStyles.Previous)
{
Position = new Position(56, 10),
Size2D = new Size2D(240, 72),
next.ClickEvent += (s, e) => nav.Next();
view.Add(next);
- void applyStyle(bool isConnected) => next.ApplyStyle(isConnected ? ButtonStyles.Next : ButtonStyles.Skip);
+ void applyStyle(bool isConnected) => next.ApplyStyle(isConnected
+ ? Common.Styles.ButtonStyles.Next
+ : Common.Styles.ButtonStyles.Skip);
applyStyle(WiFiManager.ConnectionState == WiFiConnectionState.Connected);
connectionChanged = (s, e) => applyStyle(e.State == WiFiConnectionState.Connected);
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42"><defs><style>.a,.b,.d{fill:none;}.a,.b{stroke:#205247;stroke-width:3px;}.b{stroke-linecap:round;}.c{stroke:none;}</style></defs><g class="a"><circle class="c" cx="21" cy="21" r="21"/><circle class="d" cx="21" cy="21" r="19.5"/></g><line class="b" y2="18" transform="translate(21.5 12.5)"/><line class="b" x2="18" transform="translate(12.5 21.5)"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="21.496" height="12.372" viewBox="0 0 21.496 12.372"><defs><style>.a{fill:#c3cad2;}</style></defs><path class="a" d="M1037.079,248.059a19.1,19.1,0,0,0-2.71-2.623l.9-.449a.75.75,0,1,0-.67-1.342l-1.6.8a11.642,11.642,0,0,0-6.289-2.1c-5.7,0-10.18,5.482-10.369,5.716l-.379.47.379.471a18.9,18.9,0,0,0,2.552,2.5l-.468.234a.75.75,0,0,0,.336,1.421.738.738,0,0,0,.334-.079l1.147-.573a11.785,11.785,0,0,0,6.468,2.215c5.7,0,10.18-5.482,10.369-5.715l.379-.471Zm-6.227.47a4.1,4.1,0,0,1-.8,2.452h0a4.128,4.128,0,0,1-6.69-.039l7.286-3.644A4.092,4.092,0,0,1,1030.852,248.529Zm-8.131,1.054a4.071,4.071,0,0,1-.153-1.054,4.125,4.125,0,0,1,7.375-2.557Zm8.471-4.467c.074.04.147.08.22.122l-.094.047C1031.278,245.227,1031.235,245.172,1031.192,245.116Zm-13.268,3.412a17.79,17.79,0,0,1,4.308-3.418,5.6,5.6,0,0,0-.886,5.161l-.957.479A19.147,19.147,0,0,1,1017.924,248.528Zm4.073,3.094c.073.11.151.216.231.32-.138-.075-.278-.15-.412-.23Zm9.2.316c.018-.024.039-.044.056-.068a5.605,5.605,0,0,0,.755-5.255l.857-.429a19.105,19.105,0,0,1,2.627,2.343A17.891,17.891,0,0,1,1031.2,251.938Z" transform="translate(-1015.962 -242.343)"/><circle class="a" cx="2.036" cy="2.036" r="2.036" transform="translate(8.848 4.15)"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="21.495" height="12.372" viewBox="0 0 21.495 12.372"><defs><style>.a{fill:#295bb2;}</style></defs><path class="a" d="M953.688,250.092c-.188-.233-4.671-5.716-10.368-5.716s-10.18,5.483-10.369,5.716l-.379.471.379.47c.189.234,4.672,5.715,10.369,5.715s10.18-5.481,10.368-5.715l.379-.47Zm-7.029,2.923h0a4.143,4.143,0,1,1,.8-2.452A4.1,4.1,0,0,1,946.659,253.015Zm-12.125-2.453a17.79,17.79,0,0,1,4.308-3.419,5.6,5.6,0,0,0,0,6.833A17.865,17.865,0,0,1,934.534,250.562Zm13.276,3.409c.018-.023.039-.044.056-.067a5.622,5.622,0,0,0-.064-6.755,17.846,17.846,0,0,1,4.3,3.414A17.863,17.863,0,0,1,947.81,253.971Z" transform="translate(-932.572 -244.376)"/><circle class="a" cx="2.036" cy="2.036" r="2.036" transform="translate(8.848 4.15)"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="72" height="32" viewBox="0 0 72 32"><defs><style>.a,.d{fill:none;}.a{stroke:#205247;}.b{fill:#205247;font-size:18px;font-family:BreezeSans;}.c{stroke:none;}</style></defs><g class="a"><rect class="c" width="72" height="32" rx="16"/><rect class="d" x="0.5" y="0.5" width="71" height="31" rx="15.5"/></g><text class="b" transform="translate(17 22)"><tspan x="0" y="0">Scan</tspan></text></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="20.692" height="15.388" viewBox="0 0 20.692 15.388"><defs><style>.a{fill:#707070;}</style></defs><path class="a" d="M67.741,327.155a.747.747,0,0,1-.443-.145,15.723,15.723,0,0,0-18.316-.187.75.75,0,0,1-.863-1.226,17.222,17.222,0,0,1,20.068.2.75.75,0,0,1-.446,1.354Z" transform="translate(-47.801 -322.473)"/><g transform="translate(2.388 3.694)"><path class="a" d="M50.939,330.071a.75.75,0,0,1-.446-1.353,13.1,13.1,0,0,1,15.358-.129.75.75,0,0,1-.872,1.221,11.6,11.6,0,0,0-13.595.115A.752.752,0,0,1,50.939,330.071Z" transform="translate(-50.188 -326.167)"/></g><g transform="translate(5.008 7.054)"><path class="a" d="M63.025,332.547a.748.748,0,0,1-.434-.139,7.6,7.6,0,0,0-8.6-.041.75.75,0,1,1-.859-1.23,8.983,8.983,0,0,1,10.333.049.75.75,0,0,1-.437,1.361Z" transform="translate(-52.808 -329.527)"/></g><g transform="translate(8.571 11.388)"><circle class="a" cx="2" cy="2" r="2"/></g></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="72" height="32" viewBox="0 0 72 32"><defs><style>.a{fill:#dfeae4;}.b,.c{fill:#205247;}.b{font-size:18px;font-family:BreezeSans;}</style></defs><rect class="a" width="72" height="32" rx="16"/><text class="b" transform="translate(29 22)"><tspan x="0" y="0">OFF</tspan></text><circle class="c" cx="6" cy="6" r="6" transform="translate(11 10)"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="72" height="32" viewBox="0 0 72 32"><defs><style>.a{fill:#205247;}.b,.c{fill:#fff;}.b{font-size:18px;font-family:BreezeSans;}</style></defs><rect class="a" width="72" height="32" rx="16"/><text class="b" transform="translate(14 22)"><tspan x="0" y="0">ON</tspan></text><circle class="c" cx="6" cy="6" r="6" transform="translate(47 9)"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" width="400" height="1" viewBox="0 0 400 1"><defs><style>.a{fill:none;stroke:#c3cad2;}</style></defs><line class="a" x2="400" transform="translate(0 0.5)"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="495" height="431" viewBox="0 0 495 431"><defs><style>.a{fill:#fff;}.b{filter:url(#a);}</style><filter id="a" x="0" y="0" width="495" height="431" filterUnits="userSpaceOnUse"><feOffset dx="1" dy="1" input="SourceAlpha"/><feGaussianBlur stdDeviation="2.5" result="b"/><feFlood flood-opacity="0.161"/><feComposite operator="in" in2="b"/><feComposite in="SourceGraphic"/></filter></defs><g class="b" transform="matrix(1, 0, 0, 1, 0, 0)"><rect class="a" width="480" height="416" rx="8" transform="translate(6.5 6.5)"/></g></svg>
\ No newline at end of file