From 7b414e55a798bfec36e7c430fe65992e454fefb8 Mon Sep 17 00:00:00 2001 From: jwetzell Date: Tue, 16 Jul 2019 17:17:05 -0500 Subject: [PATCH] * qfont.ttf: * qfont.ttf: Add Dollar and Mail Icon * QButton.cs: Increase Default Font Size * QControlsBlock.cs: * QSelectedCueCell.cs: Cleanup * QInstanceCell.cs: Cleanup Properties * QLevelsCell.cs: Rename QSelectedCueOptionsCell * QIcon.cs: Add Dollar and Mail Icons * ControlPage.xaml: * qConnectionPage.xaml: Move some properties to XAML * ControlPage.xaml.cs: Audio level adjustments in popup "window" * MenuPage.xaml.cs: * qConnectionPage.xaml.cs: Add Support and Feedback menu items --- Droid/Assets/qfont.ttf | Bin 13236 -> 13916 bytes iOS/Resources/qfont.ttf | Bin 13236 -> 13916 bytes qController.Standard/Classes/Cell/QButton.cs | 2 +- .../Classes/Cell/QControlsBlock.cs | 2 +- .../Classes/Cell/QInstanceCell.cs | 6 +- ...lectedCueOptionsCell.cs => QLevelsCell.cs} | 36 ++++---- .../Classes/Cell/QSelectedCueCell.cs | 1 - .../Classes/Settings/QIcon.cs | 3 + qController.Standard/Pages/ControlPage.xaml | 9 +- .../Pages/ControlPage.xaml.cs | 85 +++++++----------- qController.Standard/Pages/MenuPage.xaml.cs | 33 ++++--- .../Pages/qConnectionPage.xaml | 9 +- .../Pages/qConnectionPage.xaml.cs | 46 +++++----- 13 files changed, 102 insertions(+), 130 deletions(-) mode change 100644 => 100755 Droid/Assets/qfont.ttf mode change 100644 => 100755 iOS/Resources/qfont.ttf rename qController.Standard/Classes/Cell/{QSelectedCueOptionsCell.cs => QLevelsCell.cs} (89%) diff --git a/Droid/Assets/qfont.ttf b/Droid/Assets/qfont.ttf old mode 100644 new mode 100755 index b0fa4cd2d8c1fdfff7c795a479e0dadea93e3553..bffb24caff69a466e030594d8423c1ef9363e541 GIT binary patch delta 1292 zcmZ`(ZD?Cn7=F(=_ueEow>Qb{%}ttSxA{(OyR4=+H*R)qH^bW1iZ%VPV{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 zb{ZIn?3;Prt4IPfZ6cwJal*Y#Y)zc6a3Lk+m#8zKt2$pP>c+4Uzqc7Pi4kXJ+;Eb2 zRrkuMKcLfqu8pp^)qf{#5)o-$mU*5sNjTkcWbzaX$|^=RNvEeK{rSxOTXBP!F?uF$ z7#l~`U9Q?#qER*hv+&?hYQW5(JCc)Q99n|@FggvCN+W0n%-|Pof#dn{LkIO>g5$m2 zaV*TM3f%;Y%cQtuVvr2r8Pj}PU)szXDT1aXo9`5#G0ZH&*O%7z5uNjCE+V6Y2S_zV zqY=TU>a;mf7igqBBibLuQsTK(%uOBkLrmex;E30|KSvbBA8!eH1Ky|{(}I$C;YrN3 zi=qBlOb{GGigVkj%_}ET{!EV81Bw=r+I9V*V5jQ-Wcrf3U>8Mufe-kDGLxKRJQYYT z>*9KQ+(AWB1j!+a9$P>Qg}Qu?RXlS|Kkd&jRna8kbUxvr0_A0gBK0QZfa(@qyy%pI zYAj-Gm~Eyb_sq%}X2rlpD1rb$Cpx8}`XEIx7_~yKG-@EtSdGBlPm0B5I zUjc+^0JF)wqAf`iyYw#sDV@Au40Z0dL}2t8=R;{t%|EJE=IFNpm!>Mq8spvcPpEb^ z_aKcorTw^YW*Zob zRuAWef__6##||Jc8K^;OkD^p3mmk0eF2w-J~^7DCDV@(Jo&(wFr(Hznu=>N^(jQui(30~#?49H&lMppVK* zCOAQTY=M*1Zx-mMvW^M-K$8bx!hX@5w&+5DgH;Ozjd;hn$0+;$+Kl)9m}8(X`s?Ez z&*UGtq#6_P`Mcb1-&EZj9_JBU3t#sfNxX1zf;?=sq&a;nd?}EyZ#ZTgADmw273T}r kZ8_-9x(~ZH+s8X-^pE@$nJh*U`o+kq{w^|VG$UF0A0fw|)Bpeg diff --git a/qController.Standard/Classes/Cell/QButton.cs b/qController.Standard/Classes/Cell/QButton.cs index bc60bd9..3bc08b3 100644 --- a/qController.Standard/Classes/Cell/QButton.cs +++ b/qController.Standard/Classes/Cell/QButton.cs @@ -15,7 +15,7 @@ namespace qController qCommand = command; Text = qCommand.text; TextColor = Color.Black; - + FontSize = App.HeightUnit * 2.5; if (qCommand.osc.Contains("go")) { BackgroundColor = Color.SeaGreen; diff --git a/qController.Standard/Classes/Cell/QControlsBlock.cs b/qController.Standard/Classes/Cell/QControlsBlock.cs index e32686a..c76f7d9 100644 --- a/qController.Standard/Classes/Cell/QControlsBlock.cs +++ b/qController.Standard/Classes/Cell/QControlsBlock.cs @@ -23,7 +23,7 @@ namespace qController BackgroundColor = Color.Transparent; //highlight Button Grid - BackgroundColor = Color.FromHex("FF0000"); + //BackgroundColor = Color.FromHex("FF0000"); List commands = new List(); commands.Add(QCommands.PREVIOUS); diff --git a/qController.Standard/Classes/Cell/QInstanceCell.cs b/qController.Standard/Classes/Cell/QInstanceCell.cs index ca71f96..b5dae8f 100644 --- a/qController.Standard/Classes/Cell/QInstanceCell.cs +++ b/qController.Standard/Classes/Cell/QInstanceCell.cs @@ -57,14 +57,14 @@ namespace qController Frame f = new Frame { Content = mainG, - OutlineColor = Color.Black, + BorderColor = Color.Black, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = 30, Margin = new Thickness(10,10,10,10), CornerRadius=20, + BackgroundColor = Color.FromHex("D8D8D8") }; - f.BackgroundColor = Color.FromHex("D8D8D8"); View = f; void InitItems() @@ -106,9 +106,7 @@ namespace qController void Connect(object sender, EventArgs e) { App.NavigationPage.Navigation.PushAsync(new ControlPage(nameLabel.Text,addressLabel.Text)); - Console.WriteLine("Connect To " + nameLabel.Text + " Pressed"); - } } } diff --git a/qController.Standard/Classes/Cell/QSelectedCueOptionsCell.cs b/qController.Standard/Classes/Cell/QLevelsCell.cs similarity index 89% rename from qController.Standard/Classes/Cell/QSelectedCueOptionsCell.cs rename to qController.Standard/Classes/Cell/QLevelsCell.cs index 7a8e8d9..26d906d 100644 --- a/qController.Standard/Classes/Cell/QSelectedCueOptionsCell.cs +++ b/qController.Standard/Classes/Cell/QLevelsCell.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; -using Newtonsoft.Json.Linq; using Xamarin.Forms; namespace qController { - public class QSelectedCueOptionsCell : Frame + public class QLevelsCell : Frame { public List levels; @@ -16,14 +15,16 @@ namespace qController public Label mainLabel; public Label rightLabel; public Label leftLabel; - public QSelectedCueOptionsCell() + public QLevelsCell() { Padding = new Thickness(5); CornerRadius = 20; - BackgroundColor = Color.Transparent; - + BorderColor = Color.Black; + HasShadow = true; + BackgroundColor = Color.FromHex("D8D8D8"); + IsVisible = false; //highlight for testing - BackgroundColor = Color.Red; + //BackgroundColor = Color.Red; Grid mainG = new Grid @@ -63,14 +64,9 @@ namespace qController Maximum = 12 }; - mainG.Children.Add(mainSlider, 1, 0); - mainG.Children.Add(leftSlider, 1, 1); - mainG.Children.Add(rightSlider, 1, 2); - - Grid.SetColumnSpan(mainSlider, 4); - Grid.SetColumnSpan(leftSlider, 4); - Grid.SetColumnSpan(rightSlider, 4); - mainLabel = new Label { + + mainLabel = new Label + { Text = "MAIN:", VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center @@ -78,18 +74,26 @@ namespace qController leftLabel = new Label { - Text = "LEFT:", + Text = "0:", VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center }; rightLabel = new Label { - Text = "RIGHT:", + Text = "1:", VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center }; + mainG.Children.Add(mainSlider, 1, 0); + mainG.Children.Add(leftSlider, 1, 1); + mainG.Children.Add(rightSlider, 1, 2); + + Grid.SetColumnSpan(mainSlider, 4); + Grid.SetColumnSpan(leftSlider, 4); + Grid.SetColumnSpan(rightSlider, 4); + mainG.Children.Add(mainLabel, 0, 0); mainG.Children.Add(leftLabel, 0, 1); mainG.Children.Add(rightLabel, 0, 2); diff --git a/qController.Standard/Classes/Cell/QSelectedCueCell.cs b/qController.Standard/Classes/Cell/QSelectedCueCell.cs index 2bc0093..197faf6 100644 --- a/qController.Standard/Classes/Cell/QSelectedCueCell.cs +++ b/qController.Standard/Classes/Cell/QSelectedCueCell.cs @@ -116,7 +116,6 @@ namespace qController VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; - //BACKGROUND COLORS FOR TESTING ONLY //notes.BackgroundColor = Color.Red; diff --git a/qController.Standard/Classes/Settings/QIcon.cs b/qController.Standard/Classes/Settings/QIcon.cs index 2d8e55a..3d82604 100644 --- a/qController.Standard/Classes/Settings/QIcon.cs +++ b/qController.Standard/Classes/Settings/QIcon.cs @@ -47,6 +47,9 @@ namespace qController public const string COMMENTING_O = "\uF27B"; + public const string DOLLAR = "\uF155"; + public const string MAIL = "\uE812"; + public static string GetIconFromType(string type) { diff --git a/qController.Standard/Pages/ControlPage.xaml b/qController.Standard/Pages/ControlPage.xaml index b0db741..1b04f29 100644 --- a/qController.Standard/Pages/ControlPage.xaml +++ b/qController.Standard/Pages/ControlPage.xaml @@ -2,11 +2,7 @@ - - - - - + @@ -14,10 +10,9 @@ - - diff --git a/qController.Standard/Pages/ControlPage.xaml.cs b/qController.Standard/Pages/ControlPage.xaml.cs index e70df17..f6016b6 100644 --- a/qController.Standard/Pages/ControlPage.xaml.cs +++ b/qController.Standard/Pages/ControlPage.xaml.cs @@ -9,7 +9,7 @@ namespace qController { QController qController; QSelectedCueCell qCell; - QSelectedCueOptionsCell qSelectedCueOptions; + QLevelsCell qLevelsCell; ShadowButton showLevelsButton; Grid mainG; QControlsBlock qControlsBlock; @@ -74,19 +74,13 @@ namespace qController App.rootPage.MenuPage.ChangeToControl(); NavigationPage.SetHasNavigationBar(this, false); - topBar.BackgroundColor = Color.FromHex("71AEFF"); - - BackgroundColor = Color.FromHex("4A4A4A"); - menuButton.Text = QIcon.MENU; qCell = new QSelectedCueCell(); - qCell.SelectedCueEdited += OnSelectedCueEdited; + AbsoluteLayout.SetLayoutFlags(qCell, AbsoluteLayoutFlags.All); - - switch (Device.RuntimePlatform) { case Device.iOS: @@ -107,8 +101,6 @@ namespace qController menuButtonGesture.Tapped += ShowMenu; menuButton.GestureRecognizers.Add(menuButtonGesture); - - sLayout.Children.Add(qCell); } @@ -117,80 +109,67 @@ namespace qController string address = "/workspace/" + qController.qWorkspace.workspace_id + "/cue_id/" + args.CueID + "/" + args.Property; qController.qClient.sendArgsUDP(address, args.NewValue); } + void FinishUI() { string workspace_prefix = "/workspace/" + qController.qWorkspace.workspace_id; - qSelectedCueOptions = new QSelectedCueOptionsCell(); + qLevelsCell = new QLevelsCell(); - qSelectedCueOptions.mainSlider.ValueChanged += (sender, args) => + qLevelsCell.mainSlider.ValueChanged += (sender, args) => { - qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qSelectedCueOptions.activeCue + "/sliderLevel/0", (float)args.NewValue); + qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qLevelsCell.activeCue + "/sliderLevel/0", (float)args.NewValue); }; - qSelectedCueOptions.leftSlider.ValueChanged += (sender, args) => + qLevelsCell.leftSlider.ValueChanged += (sender, args) => { - qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qSelectedCueOptions.activeCue + "/sliderLevel/1", (float)args.NewValue); + qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qLevelsCell.activeCue + "/sliderLevel/1", (float)args.NewValue); }; - qSelectedCueOptions.rightSlider.ValueChanged += (sender, args) => + qLevelsCell.rightSlider.ValueChanged += (sender, args) => { - qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qSelectedCueOptions.activeCue + "/sliderLevel/2", (float)args.NewValue); + qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qLevelsCell.activeCue + "/sliderLevel/2", (float)args.NewValue); }; - - qControlsBlock = new QControlsBlock(qController); - - switch (Device.RuntimePlatform) + Button showLevelsInnerButton = new Button { - case Device.iOS: - AbsoluteLayout.SetLayoutBounds(qControlsBlock, new Rectangle(0, 0.53, 1, 0.25)); - AbsoluteLayout.SetLayoutFlags(qControlsBlock, AbsoluteLayoutFlags.All); - AbsoluteLayout.SetLayoutBounds(qSelectedCueOptions, new Rectangle(0,0.50,1,0.25)); - AbsoluteLayout.SetLayoutFlags(qSelectedCueOptions, AbsoluteLayoutFlags.All); - break; - case Device.Android: - AbsoluteLayout.SetLayoutBounds(qControlsBlock, new Rectangle(0, 0.58, 1, 0.25)); - AbsoluteLayout.SetLayoutFlags(qControlsBlock, AbsoluteLayoutFlags.All); - AbsoluteLayout.SetLayoutBounds(qSelectedCueOptions, new Rectangle(0,0.70,1,0.25)); - AbsoluteLayout.SetLayoutFlags(qSelectedCueOptions, AbsoluteLayoutFlags.All); - break; - } - sLayout.Children.Add(qControlsBlock); - - sLayout.Children.Add(qSelectedCueOptions); - - - Button b = new Button{ Text = QIcon.SLIDERS, TextColor = Color.Black, FontFamily = App.QFont, FontSize = App.HeightUnit * 4, VerticalOptions = LayoutOptions.FillAndExpand, - HorizontalOptions =LayoutOptions.FillAndExpand, + HorizontalOptions = LayoutOptions.FillAndExpand, HeightRequest = App.HeightUnit * 8, WidthRequest = App.HeightUnit * 8, CornerRadius = (int)(App.HeightUnit * 4), BackgroundColor = Color.LightBlue }; - b.Clicked += (s, e) => + showLevelsInnerButton.Clicked += (s, e) => { - qSelectedCueOptions.IsVisible = !qSelectedCueOptions.IsVisible; + qLevelsCell.IsVisible = !qLevelsCell.IsVisible; }; - showLevelsButton = new ShadowButton(b); + showLevelsButton = new ShadowButton(showLevelsInnerButton); + qControlsBlock = new QControlsBlock(qController); + + AbsoluteLayout.SetLayoutFlags(qControlsBlock, AbsoluteLayoutFlags.All); + AbsoluteLayout.SetLayoutFlags(qLevelsCell, AbsoluteLayoutFlags.All); + AbsoluteLayout.SetLayoutFlags(showLevelsButton, AbsoluteLayoutFlags.PositionProportional); switch (Device.RuntimePlatform) { case Device.iOS: + AbsoluteLayout.SetLayoutBounds(qControlsBlock, new Rectangle(0, 0.53, 1, 0.25)); + AbsoluteLayout.SetLayoutBounds(qLevelsCell, new Rectangle(0.9,0.40,0.8,0.25)); AbsoluteLayout.SetLayoutBounds(showLevelsButton, new Rectangle(0.04, 0.34, App.HeightUnit * 8, App.HeightUnit * 8)); - AbsoluteLayout.SetLayoutFlags(showLevelsButton, AbsoluteLayoutFlags.PositionProportional); break; case Device.Android: + AbsoluteLayout.SetLayoutBounds(qControlsBlock, new Rectangle(0, 0.58, 1, 0.25)); + AbsoluteLayout.SetLayoutBounds(qLevelsCell, new Rectangle(0.9, 0.40, 0.8, 0.25)); AbsoluteLayout.SetLayoutBounds(showLevelsButton, new Rectangle(0.04, 0.39, App.HeightUnit * 8, App.HeightUnit * 8)); - AbsoluteLayout.SetLayoutFlags(showLevelsButton, AbsoluteLayoutFlags.PositionProportional); break; } - - + + sLayout.Children.Add(qControlsBlock); + sLayout.Children.Add(qLevelsCell); sLayout.Children.Add(showLevelsButton); } @@ -221,7 +200,7 @@ namespace qController Device.BeginInvokeOnMainThread(() => { App.rootPage.MenuPage.ChangeToWorkspace(e.UpdatedWorkspace); - }); + }); if (qCell.activeCue == null) { Device.BeginInvokeOnMainThread(() => { @@ -278,14 +257,12 @@ namespace qController else showLevelsButton.IsVisible = false; qCell.UpdateSelectedCue(args.Cue); - //if (!mainG.IsVisible) - // mainG.IsVisible = true; - if(qSelectedCueOptions != null) + if(qLevelsCell != null) { - qSelectedCueOptions.activeCue = args.Cue.uniqueID; + qLevelsCell.activeCue = args.Cue.uniqueID; if (args.Cue.levels != null) { - qSelectedCueOptions.UpdateLevels(args.Cue.levels[0]); + qLevelsCell.UpdateLevels(args.Cue.levels[0]); } } }); diff --git a/qController.Standard/Pages/MenuPage.xaml.cs b/qController.Standard/Pages/MenuPage.xaml.cs index 6e94add..335b5d7 100644 --- a/qController.Standard/Pages/MenuPage.xaml.cs +++ b/qController.Standard/Pages/MenuPage.xaml.cs @@ -18,24 +18,8 @@ namespace qController InitializeComponent(); items = new ObservableCollection(); - items.Add(new MenuPageItem - { - Title = "Scan Network", - Icon = "\uE800", - Command = "scan" - }); - items.Add(new MenuPageItem - { - Title = "Add Manually", - Icon = "\uE801", - Command = "add" - }); - /*items.Add(new MenuPageItem - { - Title = "Open Link", - Icon = "\uF0C9", - Command = "open_link" - });*/ + ChangeToHome(); + listView = new ListView { ItemsSource = items, @@ -90,6 +74,7 @@ namespace qController Icon = QIcon.CANCEL, Command = "disconnect" }); + } public void ChangeToWorkspace(QWorkSpace workspace) { @@ -184,6 +169,18 @@ namespace qController Title = "Add Manually", Icon = "\uE801", Command = "add" + }); + items.Add(new MenuPageItem + { + Title = "Send Feedback", + Icon = QIcon.MAIL, + Command = "feedback" + }); + items.Add(new MenuPageItem + { + Title = "Support Project", + Icon = QIcon.DOLLAR, + Command = "support" }); } } diff --git a/qController.Standard/Pages/qConnectionPage.xaml b/qController.Standard/Pages/qConnectionPage.xaml index a202508..136f985 100644 --- a/qController.Standard/Pages/qConnectionPage.xaml +++ b/qController.Standard/Pages/qConnectionPage.xaml @@ -1,8 +1,8 @@ - + - + @@ -10,10 +10,9 @@ - - - + \ No newline at end of file diff --git a/qController.Standard/Pages/qConnectionPage.xaml.cs b/qController.Standard/Pages/qConnectionPage.xaml.cs index d3cfd4b..f211b9f 100644 --- a/qController.Standard/Pages/qConnectionPage.xaml.cs +++ b/qController.Standard/Pages/qConnectionPage.xaml.cs @@ -28,48 +28,58 @@ namespace qController else if(args.Command == "add") { AddWorkspace(); - }else if(args.Command == "open_link") + } + else if (args.Command == "feedback") { - Device.OpenUri(new Uri("http://www.jwetzell.com")); + Console.WriteLine("Give Feedback selected"); + } + else if(args.Command == "support") + { + UserDialogs.Instance.Confirm(new ConfirmConfig + { + Title = "Support the Project", + Message = "This application will never be a paid app or contain any sort of ads, but if you choose to show your support you may do so by clicking the Donate button below. Thank you!", + OkText = "Donate", + OnAction = (response) => + { + if (response) + Device.OpenUri(new Uri("https://linktr.ee/JoelWetzell")); + } + }); } } private void InitGUI() { NavigationPage.SetHasNavigationBar(this, false); - lstView.ItemsSource = QStorage.qInstances; + listView.ItemsSource = QStorage.qInstances; - lstView.ItemTemplate = new DataTemplate(typeof(QInstanceCell)); - lstView.SeparatorVisibility = SeparatorVisibility.None; - lstView.ItemTapped += (object sender, ItemTappedEventArgs e) => + listView.ItemTemplate = new DataTemplate(typeof(QInstanceCell)); + listView.SeparatorVisibility = SeparatorVisibility.None; + listView.ItemTapped += (object sender, ItemTappedEventArgs e) => { // don't do anything if we just de-selected the row if (e.Item == null) return; // do something with e.SelectedItem ((ListView)sender).SelectedItem = null; // de-select the row }; - topBar.BackgroundColor = Color.FromHex("71AEFF"); + + menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2); switch (Device.RuntimePlatform) { case Device.iOS: topBar.HeightRequest = Math.Max(App.Height * .09, 65); - menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2); menuButton.FontSize = App.Height * .04; break; case Device.Android: topBar.HeightRequest = App.Height * .08; - menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2); menuButton.FontSize = App.Height * .05; break; } - menuButton.Text = "\uF0C9"; - - lstView.BackgroundColor = Color.FromHex("4A4A4A"); BackgroundColor = Color.FromHex("4A4A4A"); var menuButtonGesture = new TapGestureRecognizer(); - menuButtonGesture.Tapped += showMenu; menuButton.GestureRecognizers.Add(menuButtonGesture); @@ -109,7 +119,6 @@ namespace qController }); } - async void Scan(){ bool workspacesFound = false; App.showToast("Scanning for Instances..."); @@ -141,14 +150,5 @@ namespace qController { App.MenuIsPresented = true; } - - void showToast(string message) - { - var toastConfig = new ToastConfig(message); - toastConfig.SetDuration(3000); - toastConfig.SetPosition(ToastPosition.Bottom); - UserDialogs.Instance.Toast(toastConfig); - } - } }