- Fixed not showing of MoreButton on Mainpage.
- Added AdvancedPage.cs and WiFiDirectPage.cs files.
Change-Id: I04a050fc4a8978e83bafabe63fdfa87cca2aca9e
Signed-off-by: Akash <akash1.kumar@samsung.com>
--- /dev/null
+using System.Collections.Generic;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using SettingWiFi.res.locale;
+using static SettingWiFi.Logger;
+
+namespace SettingWiFi
+{
+ //This class still need to be completed
+ internal class AdvancedPage : ContentPage
+ {
+ private WiFi mWifi;
+ private APSource mApSource;
+
+ internal AdvancedPage(WiFi wifi)
+ {
+ mWifi = wifi;
+ }
+
+ internal void CreateComponents(APSource apSource)
+ {
+ mApSource = apSource;
+
+ var findView = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ WidthSpecification = 200,
+ HeightSpecification = 100,
+ };
+
+ var cancelButton = new Button()
+ {
+ Text = Resources.IDS_WIFI_SK_CANCEL,
+ WidthSpecification = 300,
+ HeightSpecification = 80,
+ };
+ cancelButton.Clicked += (object source, ClickedEventArgs args) =>
+ {
+ Navigator.Pop();
+ };
+
+ Content = new AlertDialog()
+ {
+ Title = Resources.IDS_ST_BODY_ADVANCED,
+ Content = findView,
+ Actions = new View[] { cancelButton, },
+ };
+ }
+ }
+}
WiFi mWifi;
APSource mApSource;
+ Button moreButton;
+
private static readonly string mImagePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/";
private static readonly int itemCount = 3;
private MenuItem[] menuItems = new MenuItem[itemCount];
mWifi = wifi;
}
+ internal Button MoreButton()
+ {
+ return moreButton;
+ }
internal Loading CreateLoadingIcon()
{
var path = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
{
mApSource = new APSource();
- var moreButton = new Button();
+ moreButton = new Button();
moreButton.Icon.ResourceUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource
+ "/images/menu.png";
Navigator.Push(CreateHiddenConnectPage());
break;
case MoreMenu.AdvancedPage:
- // Advanced page need to be added instead of HiddenConnect page
- Navigator.Push(CreateHiddenConnectPage());
+ Navigator.Push(CreateAdvancedPage());
break;
case MoreMenu.WiFiDirectPage:
- // WiFiDirect page need to be added instead of HiddenConnect page
- Navigator.Push(CreateHiddenConnectPage());
+ Navigator.Push(CreateWiFiDirectPage());
break;
}
};
item.Icon = GetApIconImageView();
item.Extra = GetInfoButton();
-
+ item.IsSelectable = false;
+ //OnAppClicked not working as expected as of now. Need to popup contentpage when clicked
+ item.Clicked += OnAPClicked;
return item;
});
}
return page;
}
+ private ContentPage CreateAdvancedPage()
+ {
+ var page = new AdvancedPage(mWifi);
+ page.CreateComponents(mApSource);
+ return page;
+ }
+
+ private ContentPage CreateWiFiDirectPage()
+ {
+ var page = new WiFiDirectPage(mWifi);
+ page.CreateComponents(mApSource);
+ return page;
+ }
+
private DialogPage CreateConnectPage(AP ap)
{
var page = new ConnectPage(mWifi);
}
}
+ private async void OnAPClicked(object sender, ClickedEventArgs ev)
+ {
+ Debug("OnAPClicked");
+
+ Button button = (Button)sender;
+ mConnectPage = CreateConnectPage(button.BindingContext as AP);
+ Navigator.Push(mConnectPage);
+ }
+
public async void OnScanListSelected(object sender, SelectionChangedEventArgs ev)
{
+ Debug("OnScanListSelected");
foreach (object item in ev.CurrentSelection)
{
if (item == null) break;
--- /dev/null
+using System.Collections.Generic;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using SettingWiFi.res.locale;
+using static SettingWiFi.Logger;
+
+namespace SettingWiFi
+{
+ // This class still need to be completed
+ internal class WiFiDirectPage : ContentPage
+ {
+ private WiFi mWifi;
+ private APSource mApSource;
+
+ internal WiFiDirectPage(WiFi wifi)
+ {
+ mWifi = wifi;
+ }
+
+ internal void CreateComponents(APSource apSource)
+ {
+ mApSource = apSource;
+
+ var findView = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ WidthSpecification = 200,
+ HeightSpecification = 100,
+ };
+
+ var cancelButton = new Button()
+ {
+ Text = Resources.IDS_WIFI_SK_CANCEL,
+ WidthSpecification = 300,
+ HeightSpecification = 80,
+ };
+ cancelButton.Clicked += (object source, ClickedEventArgs args) =>
+ {
+ Navigator.Pop();
+ };
+
+ Content = new AlertDialog()
+ {
+ Title = Resources.IDS_WIFI_BODY_WI_FI_DIRECT_ABB,
+ Content = findView,
+ Actions = new View[] { cancelButton, },
+ };
+ }
+ }
+}
\r
WiFi mWifi;\r
\r
+ Button moreButton;\r
private ContentPage CreateMainPage()\r
{\r
var page = new MainPage(mWifi);\r
page.CreateComponents();\r
+ moreButton = page.MoreButton();\r
return page;\r
}\r
\r
mMainPage = CreateMainPage();\r
AppBar appBar = CreateAppBar(Resources.IDS_WIFI_BODY_WI_FI);\r
mMainPage.AppBar = appBar;\r
-\r
+ appBar.Actions = new View[] { moreButton, };\r
navigator.Push(mMainPage);\r
}\r
\r