mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-14 03:43:56 +00:00
* 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:
@@ -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=""/>
|
||||
<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>
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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=""/>
|
||||
</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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user