using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
+using Tizen.NUI.Binding;
using SettingWiFi.res.locale;
using static SettingWiFi.Logger;
namespace SettingWiFi
{
- //This class still need to be completed
internal class AdvancedPage : ContentPage
{
private WiFi mWifi;
internal void CreateComponents(APSource apSource)
{
mApSource = apSource;
-
- var findView = new View()
+ View advacedView = new View()
{
Layout = new LinearLayout()
{
LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Center,
},
- WidthSpecification = 200,
- HeightSpecification = 100,
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+
+ var networkNotification = new DefaultLinearItem()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ Text = Resources.IDS_ST_BODY_NETWORK_NOTIFICATION,
+ IsSelectable = false,
};
+ networkNotification.Label.HorizontalAlignment = HorizontalAlignment.Begin;
+ networkNotification.SubText = Resources.IDS_WIFI_BODY_RECEIVE_NOTIFICATIONS_WHEN_NETWORKS_ARE_AVAILABLE;
- var cancelButton = new Button()
+ var onOffSwitch = new Switch()
{
- Text = Resources.IDS_WIFI_SK_CANCEL,
- WidthSpecification = 300,
- HeightSpecification = 80,
+ IsSelected = false,
};
- cancelButton.Clicked += (object source, ClickedEventArgs args) =>
+ networkNotification.Extra = onOffSwitch;
+
+ advacedView.Add(networkNotification);
+
+ var sortBy = new DefaultLinearItem()
+ {
+
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ Text = Resources.IDS_WIFI_BODY_SORT_BY,
+ IsSelectable = false,
+
+ };
+
+ sortBy.Clicked += OnSortByClicked;
+ sortBy.SubLabel.SetBinding(TextLabel.TextProperty, "SortBy");
+ sortBy.SubLabel.HorizontalAlignment = HorizontalAlignment.Begin;
+
+ advacedView.Add(sortBy);
+
+ var installCertificate = new DefaultLinearItem()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ Text = Resources.IDS_ST_BODY_INSTALL_CERTIFICATE,
+ IsSelectable = false,
+ };
+ installCertificate.Clicked += OnInstallCerticateClicked;
+ advacedView.Add(installCertificate);
+
+ AppBar = CreateAppBar(Resources.IDS_WIFI_BODY_ADVANCED_SETTINGS);
+ Content = advacedView;
+ }
+
+ private void OnSortByClicked(object sender, ClickedEventArgs ev)
+ {
+ // TO DO: Need to be completed.
+ // IDS_EMAIL_POP_ALPHABETICAL
+ // IDS_WIFI_MBODY_SIGNAL_STRENGTH_KOR_SKT
+ }
+
+ private void OnInstallCerticateClicked(object obj, ClickedEventArgs arg)
+ {
+ var page = new CertificateSearchPage(mWifi);
+ page.CreateComponents(mApSource);
+ Navigator.Push(page);
+ }
+
+ protected virtual AppBar CreateAppBar(string title)
+ {
+ var appBar = new AppBar()
+ {
+ Title = title,
+ AutoNavigationContent = false,
+ };
+ var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");
+ var navigationContent = new Button(((AppBarStyle)appBarStyle).BackButton);
+ navigationContent.Clicked += (o, e) =>
{
Navigator.Pop();
};
- Content = new AlertDialog()
+ appBar.NavigationContent = navigationContent;
+ return appBar;
+ }
+ }
+
+ internal class CertificateSearchPage : ContentPage
+ {
+ private WiFi mWifi;
+ private APSource mApSource;
+
+ internal CertificateSearchPage(WiFi wifi)
+ {
+ mWifi = wifi;
+ }
+
+ internal void CreateComponents(APSource apSource)
+ {
+ mApSource = apSource;
+ View certificateView = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ },
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+
+ // TO DO: First search certificate. if not found then show this text.
+ TextLabel viewInfo1 = new TextLabel(Resources.IDS_WIFI_NO_CERTIFICATE_FOUND);
+ TextLabel viewInfo2 = new TextLabel(Resources.IDS_WIFI_AFTER_YOU_INSTALL_THEY_WILL_BE_SHOWN_HERE);
+
+ certificateView.Add(viewInfo1);
+ certificateView.Add(viewInfo2);
+
+ AppBar = CreateAppBar(Resources.IDS_WIFI_CERTIFICATE_SEARCH_RESULTS);
+ Content = certificateView;
+ }
+
+ protected virtual AppBar CreateAppBar(string title)
+ {
+ var appBar = new AppBar()
{
- Title = Resources.IDS_ST_BODY_ADVANCED,
- Content = findView,
- Actions = new View[] { cancelButton, },
+ Title = title,
+ AutoNavigationContent = false,
};
+ var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");
+ var navigationContent = new Button(((AppBarStyle)appBarStyle).BackButton);
+ navigationContent.Clicked += (o, e) =>
+ {
+ Navigator.Pop();
+ };
+
+ appBar.NavigationContent = navigationContent;
+ return appBar;
}
}
}