mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-22 23:49:22 +00:00
* QControlsBlock.cs: Make Rows take up only the height now
* QSelectedCueCell.cs: Continue UI work * QSelectedCueOptionsCell.cs: Start work on Converting to Popup Style * ShadowButton.cs: Button in Frame with Shadow * ControlPage.xaml: * ControlPage.xaml.cs: Continue work on UI
This commit is contained in:
@@ -23,7 +23,7 @@ namespace qController
|
|||||||
|
|
||||||
BackgroundColor = Color.Transparent;
|
BackgroundColor = Color.Transparent;
|
||||||
//highlight Button Grid
|
//highlight Button Grid
|
||||||
//BackgroundColor = Color.FromHex("FF0000");
|
BackgroundColor = Color.FromHex("FF0000");
|
||||||
|
|
||||||
List<QCommand> commands = new List<QCommand>();
|
List<QCommand> commands = new List<QCommand>();
|
||||||
commands.Add(QCommands.PREVIOUS);
|
commands.Add(QCommands.PREVIOUS);
|
||||||
@@ -51,9 +51,9 @@ namespace qController
|
|||||||
{
|
{
|
||||||
Padding = new Thickness(0),
|
Padding = new Thickness(0),
|
||||||
RowDefinitions = {
|
RowDefinitions = {
|
||||||
new RowDefinition{Height = GridLength.Auto},
|
new RowDefinition{Height = GridLength.Star},
|
||||||
new RowDefinition{Height = GridLength.Auto},
|
new RowDefinition{Height = GridLength.Star},
|
||||||
new RowDefinition{Height = GridLength.Auto}
|
new RowDefinition{Height = GridLength.Star}
|
||||||
},
|
},
|
||||||
ColumnDefinitions = {
|
ColumnDefinitions = {
|
||||||
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)},
|
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)},
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ namespace qController
|
|||||||
mainG.Children.Add(bottomGrid, 0, 1);
|
mainG.Children.Add(bottomGrid, 0, 1);
|
||||||
Grid.SetColumnSpan(bottomGrid, 5);
|
Grid.SetColumnSpan(bottomGrid, 5);
|
||||||
|
|
||||||
Padding = new Thickness(5);
|
|
||||||
CornerRadius = 20;
|
CornerRadius = 20;
|
||||||
BackgroundColor = Color.FromHex("D8D8D8");
|
BackgroundColor = Color.FromHex("D8D8D8");
|
||||||
HeightRequest = App.HeightUnit * 25;
|
HeightRequest = App.HeightUnit * 25;
|
||||||
|
|||||||
@@ -20,7 +20,12 @@ namespace qController
|
|||||||
{
|
{
|
||||||
Padding = new Thickness(5);
|
Padding = new Thickness(5);
|
||||||
CornerRadius = 20;
|
CornerRadius = 20;
|
||||||
BackgroundColor = Color.FromHex("D8D8D8");
|
BackgroundColor = Color.Transparent;
|
||||||
|
|
||||||
|
//highlight for testing
|
||||||
|
BackgroundColor = Color.Red;
|
||||||
|
|
||||||
|
|
||||||
Grid mainG = new Grid
|
Grid mainG = new Grid
|
||||||
{
|
{
|
||||||
Padding = new Thickness(0),
|
Padding = new Thickness(0),
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace qController
|
||||||
|
{
|
||||||
|
public class ShadowButton : Frame
|
||||||
|
{
|
||||||
|
public ShadowButton(Button b)
|
||||||
|
{
|
||||||
|
//Content = b;
|
||||||
|
HeightRequest = b.Height;
|
||||||
|
WidthRequest = b.Width;
|
||||||
|
CornerRadius = b.CornerRadius;
|
||||||
|
Padding = new Thickness(0);
|
||||||
|
Content = b;
|
||||||
|
HasShadow = true;
|
||||||
|
BorderColor = Color.Black;
|
||||||
|
IsVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,11 @@
|
|||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.ControlPage">
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.ControlPage">
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<AbsoluteLayout x:Name="sLayout">
|
<AbsoluteLayout x:Name="sLayout">
|
||||||
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutBounds="0,0,1,.09" AbsoluteLayout.LayoutFlags="All">
|
<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.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
@@ -13,6 +17,7 @@
|
|||||||
<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"/>
|
||||||
<Label x:Name = "instanceName" HorizontalTextAlignment="Center" HorizontalOptions = "CenterAndExpand" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="1"/>
|
<Label x:Name = "instanceName" HorizontalTextAlignment="Center" HorizontalOptions = "CenterAndExpand" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="1"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</AbsoluteLayout>
|
</AbsoluteLayout>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace qController
|
|||||||
QController qController;
|
QController qController;
|
||||||
QSelectedCueCell qCell;
|
QSelectedCueCell qCell;
|
||||||
QSelectedCueOptionsCell qSelectedCueOptions;
|
QSelectedCueOptionsCell qSelectedCueOptions;
|
||||||
|
ShadowButton showLevelsButton;
|
||||||
Grid mainG;
|
Grid mainG;
|
||||||
QControlsBlock qControlsBlock;
|
QControlsBlock qControlsBlock;
|
||||||
public ControlPage(string name, string address)
|
public ControlPage(string name, string address)
|
||||||
@@ -78,15 +79,24 @@ namespace qController
|
|||||||
|
|
||||||
BackgroundColor = Color.FromHex("4A4A4A");
|
BackgroundColor = Color.FromHex("4A4A4A");
|
||||||
menuButton.Text = QIcon.MENU;
|
menuButton.Text = QIcon.MENU;
|
||||||
|
|
||||||
|
qCell = new QSelectedCueCell();
|
||||||
|
|
||||||
|
|
||||||
|
qCell.SelectedCueEdited += OnSelectedCueEdited;
|
||||||
|
AbsoluteLayout.SetLayoutFlags(qCell, AbsoluteLayoutFlags.All);
|
||||||
|
|
||||||
|
|
||||||
switch (Device.RuntimePlatform)
|
switch (Device.RuntimePlatform)
|
||||||
{
|
{
|
||||||
case Device.iOS:
|
case Device.iOS:
|
||||||
|
AbsoluteLayout.SetLayoutBounds(qCell, new Rectangle(0, 0.13, 1, 0.30));
|
||||||
topBar.HeightRequest = Math.Max(App.Height * .09, 65);
|
topBar.HeightRequest = Math.Max(App.Height * .09, 65);
|
||||||
menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2);
|
menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2);
|
||||||
menuButton.FontSize = App.Height * .04;
|
menuButton.FontSize = App.Height * .04;
|
||||||
break;
|
break;
|
||||||
case Device.Android:
|
case Device.Android:
|
||||||
|
AbsoluteLayout.SetLayoutBounds(qCell, new Rectangle(0, 0.13, 1, 0.35));
|
||||||
topBar.HeightRequest = App.Height * .08;
|
topBar.HeightRequest = App.Height * .08;
|
||||||
menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2);
|
menuButton.Margin = new Thickness(App.WidthUnit * 2, 0, 0, App.WidthUnit * 2);
|
||||||
menuButton.FontSize = App.Height * .05;
|
menuButton.FontSize = App.Height * .05;
|
||||||
@@ -98,13 +108,7 @@ namespace qController
|
|||||||
menuButton.GestureRecognizers.Add(menuButtonGesture);
|
menuButton.GestureRecognizers.Add(menuButtonGesture);
|
||||||
|
|
||||||
|
|
||||||
qCell = new QSelectedCueCell();
|
|
||||||
|
|
||||||
|
|
||||||
qCell.SelectedCueEdited += OnSelectedCueEdited;
|
|
||||||
|
|
||||||
AbsoluteLayout.SetLayoutBounds(qCell, new Rectangle(0, 0.13, 1, 0.30));
|
|
||||||
AbsoluteLayout.SetLayoutFlags(qCell, AbsoluteLayoutFlags.All);
|
|
||||||
sLayout.Children.Add(qCell);
|
sLayout.Children.Add(qCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,28 +136,66 @@ namespace qController
|
|||||||
qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qSelectedCueOptions.activeCue + "/sliderLevel/2", (float)args.NewValue);
|
qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qSelectedCueOptions.activeCue + "/sliderLevel/2", (float)args.NewValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
qControlsBlock = new QControlsBlock(qController);
|
qControlsBlock = new QControlsBlock(qController);
|
||||||
|
|
||||||
AbsoluteLayout.SetLayoutBounds(qControlsBlock, new Rectangle(0, 0.53, 1, 0.25));
|
switch (Device.RuntimePlatform)
|
||||||
AbsoluteLayout.SetLayoutFlags(qControlsBlock, AbsoluteLayoutFlags.All);
|
{
|
||||||
|
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(qControlsBlock);
|
||||||
|
|
||||||
|
sLayout.Children.Add(qSelectedCueOptions);
|
||||||
|
|
||||||
|
|
||||||
Button b = new Button{
|
Button b = new Button{
|
||||||
Text = "L",
|
Text = QIcon.SLIDERS,
|
||||||
TextColor = Color.Black,
|
TextColor = Color.Black,
|
||||||
HeightRequest = App.HeightUnit * 10,
|
FontFamily = App.QFont,
|
||||||
WidthRequest = App.HeightUnit * 10,
|
FontSize = App.HeightUnit * 4,
|
||||||
CornerRadius = (int)(App.HeightUnit * 5),
|
VerticalOptions = LayoutOptions.FillAndExpand,
|
||||||
BackgroundColor = Color.Blue
|
HorizontalOptions =LayoutOptions.FillAndExpand,
|
||||||
|
HeightRequest = App.HeightUnit * 8,
|
||||||
|
WidthRequest = App.HeightUnit * 8,
|
||||||
|
CornerRadius = (int)(App.HeightUnit * 4),
|
||||||
|
BackgroundColor = Color.LightBlue
|
||||||
};
|
};
|
||||||
AbsoluteLayout.SetLayoutBounds(b, new Rectangle(0.99, 0.99, App.HeightUnit * 10, App.HeightUnit * 10));
|
b.Clicked += (s, e) =>
|
||||||
AbsoluteLayout.SetLayoutFlags(b, AbsoluteLayoutFlags.PositionProportional);
|
{
|
||||||
//sLayout.Children.Add(b);
|
qSelectedCueOptions.IsVisible = !qSelectedCueOptions.IsVisible;
|
||||||
|
};
|
||||||
|
|
||||||
|
showLevelsButton = new ShadowButton(b);
|
||||||
|
|
||||||
|
switch (Device.RuntimePlatform)
|
||||||
|
{
|
||||||
|
case Device.iOS:
|
||||||
|
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(showLevelsButton, new Rectangle(0.04, 0.39, App.HeightUnit * 8, App.HeightUnit * 8));
|
||||||
|
AbsoluteLayout.SetLayoutFlags(showLevelsButton, AbsoluteLayoutFlags.PositionProportional);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sLayout.Children.Add(showLevelsButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowMenu(object sender, EventArgs e)
|
void ShowMenu(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//App.NavigationPage.Navigation.PopAsync();
|
|
||||||
App.MenuIsPresented = true;
|
App.MenuIsPresented = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,13 +246,13 @@ namespace qController
|
|||||||
QCue cue = qController.qWorkspace.GetCue(qController.playbackPosition);
|
QCue cue = qController.qWorkspace.GetCue(qController.playbackPosition);
|
||||||
if(cue != null)
|
if(cue != null)
|
||||||
{
|
{
|
||||||
/*Device.BeginInvokeOnMainThread(() => {
|
Device.BeginInvokeOnMainThread(() => {
|
||||||
if (cue.type.Equals("Audio"))
|
if (cue.levels != null)
|
||||||
sLayout.Children.Add(qSelectedCueOptions);
|
showLevelsButton.IsVisible = true;
|
||||||
else
|
else
|
||||||
sLayout.Children.Remove(qSelectedCueOptions);
|
showLevelsButton.IsVisible = false;
|
||||||
qCell.UpdateSelectedCue(cue);
|
qCell.UpdateSelectedCue(cue);
|
||||||
});*/
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,10 +273,10 @@ namespace qController
|
|||||||
Device.BeginInvokeOnMainThread(() =>
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
{
|
{
|
||||||
Console.WriteLine("Refreshing Currently Displayed Cue");
|
Console.WriteLine("Refreshing Currently Displayed Cue");
|
||||||
/*if (args.Cue.levels != null)
|
if (args.Cue.levels != null)
|
||||||
sLayout.Children.Add(qSelectedCueOptions);
|
showLevelsButton.IsVisible = true;
|
||||||
else
|
else
|
||||||
sLayout.Children.Remove(qSelectedCueOptions);*/
|
showLevelsButton.IsVisible = false;
|
||||||
qCell.UpdateSelectedCue(args.Cue);
|
qCell.UpdateSelectedCue(args.Cue);
|
||||||
//if (!mainG.IsVisible)
|
//if (!mainG.IsVisible)
|
||||||
// mainG.IsVisible = true;
|
// mainG.IsVisible = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user