diff --git a/Droid/Assets/qfont.ttf b/Droid/Assets/qfont.ttf new file mode 100755 index 0000000..3e00f09 Binary files /dev/null and b/Droid/Assets/qfont.ttf differ diff --git a/Droid/qController.Droid.csproj b/Droid/qController.Droid.csproj index 7245597..a352c81 100644 --- a/Droid/qController.Droid.csproj +++ b/Droid/qController.Droid.csproj @@ -198,6 +198,9 @@ qController + + + diff --git a/iOS/Assets.xcassets/hamburger.imageset/Contents.json b/iOS/Assets.xcassets/hamburger.imageset/Contents.json new file mode 100644 index 0000000..e16200a --- /dev/null +++ b/iOS/Assets.xcassets/hamburger.imageset/Contents.json @@ -0,0 +1,95 @@ +{ + "images": [ + { + "idiom": "universal" + }, + { + "filename": "hamburger@2x-1.png", + "scale": "1x", + "idiom": "universal" + }, + { + "filename": "hamburger@2x.png", + "scale": "2x", + "idiom": "universal" + }, + { + "scale": "3x", + "idiom": "universal" + }, + { + "idiom": "iphone" + }, + { + "scale": "1x", + "idiom": "iphone" + }, + { + "scale": "2x", + "idiom": "iphone" + }, + { + "subtype": "retina4", + "scale": "2x", + "idiom": "iphone" + }, + { + "scale": "3x", + "idiom": "iphone" + }, + { + "idiom": "ipad" + }, + { + "scale": "1x", + "idiom": "ipad" + }, + { + "scale": "2x", + "idiom": "ipad" + }, + { + "idiom": "watch" + }, + { + "scale": "2x", + "idiom": "watch" + }, + { + "screenWidth": "{130,145}", + "scale": "2x", + "idiom": "watch" + }, + { + "screenWidth": "{146,165}", + "scale": "2x", + "idiom": "watch" + }, + { + "idiom": "mac" + }, + { + "scale": "1x", + "idiom": "mac" + }, + { + "scale": "2x", + "idiom": "mac" + }, + { + "idiom": "car" + }, + { + "scale": "2x", + "idiom": "car" + }, + { + "scale": "3x", + "idiom": "car" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/iOS/Assets.xcassets/hamburger.imageset/hamburger@2x-1.png b/iOS/Assets.xcassets/hamburger.imageset/hamburger@2x-1.png new file mode 100644 index 0000000..452885b Binary files /dev/null and b/iOS/Assets.xcassets/hamburger.imageset/hamburger@2x-1.png differ diff --git a/iOS/Assets.xcassets/hamburger.imageset/hamburger@2x.png b/iOS/Assets.xcassets/hamburger.imageset/hamburger@2x.png new file mode 100644 index 0000000..452885b Binary files /dev/null and b/iOS/Assets.xcassets/hamburger.imageset/hamburger@2x.png differ diff --git a/iOS/Info.plist b/iOS/Info.plist index 8a16236..53b5aae 100644 --- a/iOS/Info.plist +++ b/iOS/Info.plist @@ -36,10 +36,14 @@ XSAppIconAssets Assets.xcassets/AppIcon.appiconset CFBundleShortVersionString - 2.0.2 + 2.0.3 CFBundleVersion 1.0 ITSAppUsesNonExemptEncryption + UIAppFonts + + qfont.ttf + diff --git a/iOS/Resources/qfont.ttf b/iOS/Resources/qfont.ttf new file mode 100755 index 0000000..3e00f09 Binary files /dev/null and b/iOS/Resources/qfont.ttf differ diff --git a/iOS/qController.iOS.csproj b/iOS/qController.iOS.csproj index 6ea7d34..ff35873 100644 --- a/iOS/qController.iOS.csproj +++ b/iOS/qController.iOS.csproj @@ -166,6 +166,9 @@ + + + @@ -174,6 +177,7 @@ + @@ -193,6 +197,9 @@ qController + + + diff --git a/qController.Standard/.DS_Store b/qController.Standard/.DS_Store index 64bb560..ff126f0 100644 Binary files a/qController.Standard/.DS_Store and b/qController.Standard/.DS_Store differ diff --git a/qController.Standard/App.xaml b/qController.Standard/App.xaml index 3602c5b..b1b4df3 100644 --- a/qController.Standard/App.xaml +++ b/qController.Standard/App.xaml @@ -1,6 +1,10 @@ - + + + + + diff --git a/qController.Standard/App.xaml.cs b/qController.Standard/App.xaml.cs index 1f17213..d7dbaa7 100644 --- a/qController.Standard/App.xaml.cs +++ b/qController.Standard/App.xaml.cs @@ -5,12 +5,34 @@ namespace qController public partial class App : Application { public static INavigation iNav; + public static NavigationPage NavigationPage { get; private set; } + public static RootPage rootPage; + + public static bool MenuIsPresented + { + get + { + return rootPage.IsPresented; + } + set + { + rootPage.IsPresented = value; + } + } + public App() { InitializeComponent(); - MainPage = new NavigationPage(new qControllerPage()); - iNav = MainPage.Navigation; + /*MainPage = new NavigationPage(new QConnectionPage()); + iNav = MainPage.Navigation;*/ + var menuPage = new MenuPage(); + rootPage = new RootPage(); + NavigationPage = new NavigationPage(new QConnectionPage()); + rootPage.Master = menuPage; + rootPage.Detail = NavigationPage; + MainPage = rootPage; + rootPage.Init(); } protected override void OnStart() diff --git a/qController.Standard/Classes/Cell/QCueListView.cs b/qController.Standard/Classes/Cell/QCueListView.cs new file mode 100644 index 0000000..239efd2 --- /dev/null +++ b/qController.Standard/Classes/Cell/QCueListView.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using Xamarin.Forms; + +namespace qController +{ + public class QCueListView : Frame + { + ListView listView; + public QCueListView() + { + Padding = new Thickness(5); + CornerRadius = 20; + BackgroundColor = Color.FromHex("D8D8D8"); + Grid mainG = new Grid + { + Padding = new Thickness(0), + RowDefinitions = + { + new RowDefinition{Height = GridLength.Star} + }, + ColumnDefinitions = + { + new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)} + } + }; + listView = new ListView(); + mainG.Children.Add(listView, 0, 0); + Margin = new Thickness(10); + Content = mainG; + } + + public void UpdateWithWorkspace(QWorkSpace qWorkspace) + { + List cueLists = new List(); + foreach( var cueList in qWorkspace.data ) + { + cueLists.Add(cueList.listName); + foreach(var cue in cueList.cues) + { + if(cue.number == "") + cueLists.Add("\t" + cue.listName); + else + cueLists.Add("\t" + cue.number + " - " + cue.listName); + } + } + listView.ItemsSource = cueLists.ToArray(); + } + } +} \ No newline at end of file diff --git a/qController.Standard/Classes/Cell/QInstanceCell.cs b/qController.Standard/Classes/Cell/QInstanceCell.cs index 4b5c553..28e6214 100644 --- a/qController.Standard/Classes/Cell/QInstanceCell.cs +++ b/qController.Standard/Classes/Cell/QInstanceCell.cs @@ -14,16 +14,20 @@ namespace qController Image connectButton = new Image(); Image deleteButton = new Image(); + Label connectLabel = new Label(); + Label deleteLabel = new Label(); + var connectTapGesture = new TapGestureRecognizer(); var deleteTapGesture = new TapGestureRecognizer(); connectTapGesture.Tapped += Connect; connectButton.GestureRecognizers.Add(connectTapGesture); - + connectLabel.GestureRecognizers.Add(connectTapGesture); deleteTapGesture.Tapped += Delete; deleteButton.GestureRecognizers.Add(deleteTapGesture); + deleteLabel.GestureRecognizers.Add(deleteTapGesture); InitItems(); @@ -50,10 +54,10 @@ namespace qController mainG.Children.Add(nameLabel, 1, 0); mainG.Children.Add(addressLabel,1,1); - mainG.Children.Add(connectButton,2,0); - Grid.SetRowSpan(connectButton,2); - mainG.Children.Add(deleteButton, 0, 0); - Grid.SetRowSpan(deleteButton,2); + mainG.Children.Add(connectLabel,2,0); + Grid.SetRowSpan(connectLabel,2); + mainG.Children.Add(deleteLabel, 0, 0); + Grid.SetRowSpan(deleteLabel,2); Frame f = new Frame { @@ -87,7 +91,32 @@ namespace qController addressLabel.HorizontalTextAlignment = TextAlignment.Center; addressLabel.VerticalTextAlignment = TextAlignment.Start; + connectLabel.HorizontalOptions = LayoutOptions.CenterAndExpand; + connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand; + connectLabel.Text = "\uF1EB"; + connectLabel.FontSize = 40; + connectLabel.TextColor = Color.LimeGreen; + deleteLabel.HorizontalOptions = LayoutOptions.CenterAndExpand; + deleteLabel.VerticalOptions = LayoutOptions.CenterAndExpand; + deleteLabel.Text = "\uE802"; + deleteLabel.FontSize = 40; + deleteLabel.TextColor = Color.Red; + + string qfont = ""; + + switch (Device.RuntimePlatform) + { + case Device.iOS: + qfont = "qfont"; + break; + case Device.Android: + qfont = "qfont.ttf#qfont"; + break; + + } + connectLabel.FontFamily = qfont; + deleteLabel.FontFamily = qfont; } @@ -101,7 +130,7 @@ namespace qController void Connect(object sender, EventArgs e) { - App.iNav.PushModalAsync(new NavigationPage(new ControlPage(nameLabel.Text,addressLabel.Text))); + App.NavigationPage.Navigation.PushModalAsync(new NavigationPage(new ControlPage(nameLabel.Text,addressLabel.Text))); Console.WriteLine("Connect To " + nameLabel.Text + " Pressed"); diff --git a/qController.Standard/Classes/Cell/QSelectedCueCell.cs b/qController.Standard/Classes/Cell/QSelectedCueCell.cs index 9a4ce61..093ab27 100644 --- a/qController.Standard/Classes/Cell/QSelectedCueCell.cs +++ b/qController.Standard/Classes/Cell/QSelectedCueCell.cs @@ -20,8 +20,8 @@ namespace qController Padding = new Thickness(0), RowDefinitions = { - new RowDefinition{Height = GridLength.Auto}, - new RowDefinition{Height = GridLength.Auto} + new RowDefinition{Height = GridLength.Star}, + new RowDefinition{Height = GridLength.Star} }, ColumnDefinitions = { diff --git a/qController.Standard/Classes/Cell/QSelectedCueOptionsCell.cs b/qController.Standard/Classes/Cell/QSelectedCueOptionsCell.cs index 6b1a67d..0dd2093 100644 --- a/qController.Standard/Classes/Cell/QSelectedCueOptionsCell.cs +++ b/qController.Standard/Classes/Cell/QSelectedCueOptionsCell.cs @@ -40,9 +40,9 @@ namespace qController { Padding = new Thickness(0), RowDefinitions = { - new RowDefinition{Height = GridLength.Auto}, - new RowDefinition{Height = GridLength.Auto}, - new RowDefinition{Height = GridLength.Auto} + new RowDefinition{Height = GridLength.Star}, + new RowDefinition{Height = GridLength.Star}, + new RowDefinition{Height = GridLength.Star} }, ColumnDefinitions = { new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)}, diff --git a/qController.Standard/Classes/Communication/QController.cs b/qController.Standard/Classes/Communication/QController.cs index b0de85e..0370943 100644 --- a/qController.Standard/Classes/Communication/QController.cs +++ b/qController.Standard/Classes/Communication/QController.cs @@ -25,6 +25,7 @@ namespace qController qClient.qParser.PlaybackPositionUpdated += this.OnPlaybackPositionUpdated; qClient.qParser.CueInfoUpdated += this.OnCueUpdateReceived; qClient.sendArgsUDP("/updates", 1); + qClient.sendArgsUDP("/updates", 1); qClient.sendAndReceiveString("/cueLists"); } diff --git a/qController.Standard/Pages/ControlPage.xaml.cs b/qController.Standard/Pages/ControlPage.xaml.cs index 6f19182..44e1b12 100644 --- a/qController.Standard/Pages/ControlPage.xaml.cs +++ b/qController.Standard/Pages/ControlPage.xaml.cs @@ -11,7 +11,9 @@ namespace qController Label instanceName = new Label(); QSelectedCueCell qCell; QSelectedCueOptionsCell qSelectedCueOptions; + QCueListView qCueListView; Grid mainG; + ListView listView; public ControlPage(string name, string address) { InitializeComponent(); @@ -44,8 +46,8 @@ namespace qController switch (Device.RuntimePlatform) { case Device.iOS: - backButton.Margin = new Thickness(20, 45, 20, 10); - instanceName.Margin = new Thickness(20, 45, 20, 10); + backButton.Margin = new Thickness(20, 35, 20, 10); + instanceName.Margin = new Thickness(20, 35, 20, 10); break; } @@ -119,6 +121,10 @@ namespace qController sLayout.Children.Add(mainG); + qCueListView = new QCueListView(); + + //sLayout.Children.Add(qCueListView); + } void sendOSC(object sender, EventArgs e) @@ -128,7 +134,7 @@ namespace qController void Back(object sender, EventArgs e) { - App.iNav.PopModalAsync(); + App.NavigationPage.Navigation.PopModalAsync(); } public void SelectedCueUpdated(object sender, CueEventArgs e){ @@ -153,7 +159,7 @@ namespace qController { Device.BeginInvokeOnMainThread(() => { - // + qCueListView.UpdateWithWorkspace(e.UpdatedWorkspace); }); qController.qWorkspace = e.UpdatedWorkspace; Console.WriteLine("Workspace updated in ControlPage: " + qController.qWorkspace.workspace_id); diff --git a/qController.Standard/Pages/HomePage.xaml b/qController.Standard/Pages/HomePage.xaml new file mode 100644 index 0000000..61c14a2 --- /dev/null +++ b/qController.Standard/Pages/HomePage.xaml @@ -0,0 +1,5 @@ + + + + + diff --git a/qController.Standard/Pages/HomePage.xaml.cs b/qController.Standard/Pages/HomePage.xaml.cs new file mode 100644 index 0000000..39c8f5a --- /dev/null +++ b/qController.Standard/Pages/HomePage.xaml.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +using Xamarin.Forms; + +namespace qController +{ + public partial class HomePage : ContentPage + { + public HomePage() + { + InitializeComponent(); + } + } +} diff --git a/qController.Standard/Pages/MasterPageItem.cs b/qController.Standard/Pages/MasterPageItem.cs new file mode 100644 index 0000000..5a0e07e --- /dev/null +++ b/qController.Standard/Pages/MasterPageItem.cs @@ -0,0 +1,12 @@ +using System; + +namespace qController +{ + public class MasterPageItem + { + public string Title { get; set; } + public string Icon { get; set; } + public string Command { get; set; } + } +} + diff --git a/qController.Standard/Pages/MenuPage.xaml b/qController.Standard/Pages/MenuPage.xaml new file mode 100644 index 0000000..a7aa814 --- /dev/null +++ b/qController.Standard/Pages/MenuPage.xaml @@ -0,0 +1,5 @@ + + + + + diff --git a/qController.Standard/Pages/MenuPage.xaml.cs b/qController.Standard/Pages/MenuPage.xaml.cs new file mode 100644 index 0000000..6d53b04 --- /dev/null +++ b/qController.Standard/Pages/MenuPage.xaml.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; + +using Xamarin.Forms; + +namespace qController +{ + public partial class MenuPage : ContentPage + { + public ListView ListView { get { return listView; } } + ListView listView; + + public MenuPage() + { + Title = "Menu"; + InitializeComponent(); + var items = new List(); + items.Add(new MasterPageItem + { + Title = "Scan Network", + Icon = "\uE800", + Command = "scan" + }); + items.Add(new MasterPageItem + { + Title = "Add Manually", + Icon = "\uE801", + Command = "add" + }); + /*items.Add(new MasterPageItem + { + Title = "Open Link", + Icon = "\uF0C9", + Command = "open_link" + });*/ + listView = new ListView + { + ItemsSource = items, + ItemTemplate = new DataTemplate(() => + { + var grid = new Grid { Padding = new Thickness(5, 10) }; + grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(30) }); + grid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star }); + + string qfont = ""; + + switch (Device.RuntimePlatform) + { + case Device.iOS: + qfont = "qfont"; + break; + case Device.Android: + qfont = "qfont.ttf#qfont"; + break; + + } + var icon = new Label(); + + icon.FontFamily = qfont as string; + icon.SetBinding(Label.TextProperty, "Icon"); + icon.HorizontalTextAlignment = TextAlignment.Center; + icon.VerticalTextAlignment = TextAlignment.Center; + icon.FontSize = 20; + var label = new Label { VerticalOptions = LayoutOptions.FillAndExpand }; + label.SetBinding(Label.TextProperty, "Title"); + + grid.Children.Add(icon); + grid.Children.Add(label, 1, 0); + return new ViewCell { View = grid }; + }), + SeparatorVisibility = SeparatorVisibility.None + }; + Content = new StackLayout + { + Children = { listView } + }; + + } + } +} diff --git a/qController.Standard/Pages/RootPage.xaml b/qController.Standard/Pages/RootPage.xaml new file mode 100644 index 0000000..d75321b --- /dev/null +++ b/qController.Standard/Pages/RootPage.xaml @@ -0,0 +1,4 @@ + + + + diff --git a/qController.Standard/Pages/RootPage.xaml.cs b/qController.Standard/Pages/RootPage.xaml.cs new file mode 100644 index 0000000..c2124cd --- /dev/null +++ b/qController.Standard/Pages/RootPage.xaml.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace qController +{ + public class MenuEventArgs : EventArgs + { + public string Command + { + get; + set; + } + } + + public partial class RootPage : MasterDetailPage + { + MenuPage MenuPage; + public delegate void MenuItemSelectedHandler(object source, MenuEventArgs args); + public event MenuItemSelectedHandler MenuItemSelected; + + public RootPage() + { + InitializeComponent(); + + } + + public void Init() + { + MenuPage = (MenuPage)Master; + + MenuPage.ListView.ItemSelected += OnItemSelected; + } + + void OnItemSelected(object sender, SelectedItemChangedEventArgs e) + { + var item = e.SelectedItem as MasterPageItem; + if (item != null) + { + MenuPage.ListView.SelectedItem = null; + IsPresented = false; + if (MenuItemSelected != null) + MenuItemSelected(this, new MenuEventArgs { Command = item.Command }); + } + } + } +} diff --git a/qController.Standard/Pages/RootPageDetail.xaml b/qController.Standard/Pages/RootPageDetail.xaml new file mode 100644 index 0000000..787eb70 --- /dev/null +++ b/qController.Standard/Pages/RootPageDetail.xaml @@ -0,0 +1,6 @@ + + + + + diff --git a/qController.Standard/Pages/RootPageDetail.xaml.cs b/qController.Standard/Pages/RootPageDetail.xaml.cs new file mode 100644 index 0000000..141c122 --- /dev/null +++ b/qController.Standard/Pages/RootPageDetail.xaml.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace qController.Pages +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class RootPageDetail : ContentPage + { + public RootPageDetail() + { + InitializeComponent(); + } + } +} diff --git a/qController.Standard/Pages/RootPageMaster.xaml b/qController.Standard/Pages/RootPageMaster.xaml new file mode 100644 index 0000000..d52a380 --- /dev/null +++ b/qController.Standard/Pages/RootPageMaster.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/qController.Standard/Pages/RootPageMaster.xaml.cs b/qController.Standard/Pages/RootPageMaster.xaml.cs new file mode 100644 index 0000000..e378e9a --- /dev/null +++ b/qController.Standard/Pages/RootPageMaster.xaml.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace qController.Pages +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class RootPageMaster : ContentPage + { + public ListView ListView; + + public RootPageMaster() + { + InitializeComponent(); + + BindingContext = new RootPageMasterViewModel(); + ListView = MenuItemsListView; + } + + class RootPageMasterViewModel : INotifyPropertyChanged + { + public ObservableCollection MenuItems { get; set; } + + public RootPageMasterViewModel() + { + MenuItems = new ObservableCollection(new[] + { + new RootPageMenuItem { Id = 0, Title = "Page 1" }, + new RootPageMenuItem { Id = 1, Title = "Page 2" }, + new RootPageMenuItem { Id = 2, Title = "Page 3" }, + new RootPageMenuItem { Id = 3, Title = "Page 4" }, + new RootPageMenuItem { Id = 4, Title = "Page 5" }, + }); + } + + #region INotifyPropertyChanged Implementation + public event PropertyChangedEventHandler PropertyChanged; + void OnPropertyChanged([CallerMemberName] string propertyName = "") + { + if (PropertyChanged == null) + return; + + PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + #endregion + } + } +} diff --git a/qController.Standard/Pages/RootPageMenuItem.cs b/qController.Standard/Pages/RootPageMenuItem.cs new file mode 100644 index 0000000..469ae3f --- /dev/null +++ b/qController.Standard/Pages/RootPageMenuItem.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace qController.Pages +{ + public class RootPageMenuItem + { + public RootPageMenuItem() + { + TargetType = typeof(RootPageDetail); + } + public int Id { get; set; } + public string Title { get; set; } + + public Type TargetType { get; set; } + } +} diff --git a/qController.Standard/Pages/qControllerPage.xaml b/qController.Standard/Pages/qConnectionPage.xaml similarity index 68% rename from qController.Standard/Pages/qControllerPage.xaml rename to qController.Standard/Pages/qConnectionPage.xaml index f33e219..cc93395 100644 --- a/qController.Standard/Pages/qControllerPage.xaml +++ b/qController.Standard/Pages/qConnectionPage.xaml @@ -1,6 +1,6 @@ - + @@ -10,10 +10,11 @@ - - + + \ No newline at end of file diff --git a/qController.Standard/Pages/qControllerPage.xaml.cs b/qController.Standard/Pages/qConnectionPage.xaml.cs similarity index 77% rename from qController.Standard/Pages/qControllerPage.xaml.cs rename to qController.Standard/Pages/qConnectionPage.xaml.cs index 2093aef..55133ce 100644 --- a/qController.Standard/Pages/qControllerPage.xaml.cs +++ b/qController.Standard/Pages/qConnectionPage.xaml.cs @@ -9,13 +9,29 @@ using System.Collections.Generic; namespace qController { - public partial class qControllerPage : ContentPage + public partial class QConnectionPage : ContentPage { - public qControllerPage() + public QConnectionPage() { InitializeComponent(); InitGUI(); + App.rootPage.MenuItemSelected += OnMenuItemSelected; + } + private void OnMenuItemSelected(object source, MenuEventArgs args) + { + Console.WriteLine("Menu Item Selected: " + args.Command); + if(args.Command == "scan") + { + Scan(); + } + else if(args.Command == "add") + { + AddWorkspace(); + }else if(args.Command == "open_link") + { + Device.OpenUri(new Uri("http://www.example.com")); + } } private void InitGUI() @@ -38,31 +54,23 @@ namespace qController switch (Device.RuntimePlatform) { case Device.iOS: - scanButton.Margin = new Thickness(20, 45, 20, 10); - addButton.Margin = new Thickness(20, 45, 20, 10); + menuButton.Margin = new Thickness(20, 35, 20, 10); break; } - addButton.Source = ImageSource.FromFile("add"); - scanButton.Source = ImageSource.FromFile("scan"); + menuButton.Text = "\uF0C9"; lstView.BackgroundColor = Color.FromHex("4A4A4A"); BackgroundColor = Color.FromHex("4A4A4A"); var scanButtonGesture = new TapGestureRecognizer(); - scanButtonGesture.Tapped += Scan; - scanButton.GestureRecognizers.Add(scanButtonGesture); + scanButtonGesture.Tapped += showMenu; + menuButton.GestureRecognizers.Add(scanButtonGesture); - - - var addButtonGesture = new TapGestureRecognizer(); - - addButtonGesture.Tapped += AddWorkspace; - addButton.GestureRecognizers.Add(addButtonGesture); } - void AddWorkspace(object sender, EventArgs e){ + void AddWorkspace(){ UserDialogs.Instance.Prompt(new PromptConfig { @@ -97,12 +105,11 @@ namespace qController } - async void Scan(object sender, EventArgs e){ + async void Scan(){ bool workspacesFound = false; showToast("Scanning for Workspaces..."); - - Console.WriteLine("Begin Scanning"); + IReadOnlyList results = await ZeroconfResolver.ResolveAsync("_qlab._udp.local.",TimeSpan.FromSeconds(3)); if(results != null){ foreach (var result in results) @@ -123,6 +130,11 @@ namespace qController } } + void showMenu(object sender, EventArgs e) + { + App.MenuIsPresented = true; + } + void showToast(string message) { var toastConfig = new ToastConfig(message); diff --git a/qController.Standard/qController.csproj b/qController.Standard/qController.csproj index facc7d0..a347457 100644 --- a/qController.Standard/qController.csproj +++ b/qController.Standard/qController.csproj @@ -38,6 +38,11 @@ + + + + + @@ -85,4 +90,9 @@ + + + + +