* 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
This commit is contained in:
2019-07-16 17:17:05 -05:00
parent 762472d945
commit 7b414e55a7
13 changed files with 102 additions and 130 deletions
Regular → Executable
BIN
View File
Binary file not shown.
Regular → Executable
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -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;
@@ -23,7 +23,7 @@ namespace qController
BackgroundColor = Color.Transparent;
//highlight Button Grid
BackgroundColor = Color.FromHex("FF0000");
//BackgroundColor = Color.FromHex("FF0000");
List<QCommand> commands = new List<QCommand>();
commands.Add(QCommands.PREVIOUS);
@@ -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");
}
}
}
@@ -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<double> 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);
@@ -116,7 +116,6 @@ namespace qController
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand
};
//BACKGROUND COLORS FOR TESTING ONLY
//notes.BackgroundColor = Color.Red;
@@ -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)
{
+2 -7
View File
@@ -2,11 +2,7 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.ControlPage">
<ContentPage.Content>
<AbsoluteLayout x:Name="sLayout">
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutFlags="All">
<Grid.AbsoluteLayout.LayoutBounds>
<OnPlatform x:TypeArguments="Rectangle" iOS="0,0,1,.09" Android="0,0,1,.08" />
</Grid.AbsoluteLayout.LayoutBounds>
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutBounds="0,0,1,.09" AbsoluteLayout.LayoutFlags="All" BackgroundColor="#71AEFF">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
@@ -14,10 +10,9 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label x:Name = "menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" FontSize="25"/>
<Label x:Name = "menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" FontSize="25" Text="&#xF0C9;"/>
<Label x:Name = "instanceName" HorizontalTextAlignment="Center" HorizontalOptions = "CenterAndExpand" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="1"/>
</Grid>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>
+31 -54
View File
@@ -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]);
}
}
});
+15 -18
View File
@@ -18,24 +18,8 @@ namespace qController
InitializeComponent();
items = new ObservableCollection<MenuPageItem>();
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"
});
}
}
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:qController" x:Class="qController.QConnectionPage">
<StackLayout x:Name="sLayout">
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand">
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand" BackgroundColor="#71AEFF">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
@@ -10,10 +10,9 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label x:Name = "menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0"/>
<Label x:Name = "menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" Text="&#xF0C9;"/>
</Grid>
<ListView x:Name="lstView" HasUnevenRows = "true" >
</ListView>
<ListView x:Name="listView" HasUnevenRows="true" BackgroundColor="#4A4A4A"></ListView>
</StackLayout>
</ContentPage>
@@ -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);
}
}
}