mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-22 23:49:22 +00:00
* QControlsBlock.cs: Make Background Transparent
* QSelectedCueCell.cs: Add edit abilities for name and number * ControlPage.xaml: * ControlPage.xaml.cs: Begin switch to AbsoluteLayout
This commit is contained in:
@@ -21,7 +21,7 @@ namespace qController
|
|||||||
IsVisible = true;
|
IsVisible = true;
|
||||||
|
|
||||||
|
|
||||||
BackgroundColor = Color.FromHex("4A4A4A");
|
BackgroundColor = Color.Transparent;
|
||||||
//highlight Button Grid
|
//highlight Button Grid
|
||||||
//BackgroundColor = Color.FromHex("FF0000");
|
//BackgroundColor = Color.FromHex("FF0000");
|
||||||
|
|
||||||
|
|||||||
@@ -35,10 +35,7 @@ namespace qController
|
|||||||
public QCue activeCue;
|
public QCue activeCue;
|
||||||
public QSelectedCueCell()
|
public QSelectedCueCell()
|
||||||
{
|
{
|
||||||
Padding = new Thickness(5);
|
|
||||||
CornerRadius = 20;
|
|
||||||
BackgroundColor = Color.FromHex("D8D8D8");
|
|
||||||
HeightRequest = App.HeightUnit * 25;
|
|
||||||
Grid mainG = new Grid
|
Grid mainG = new Grid
|
||||||
{
|
{
|
||||||
Padding = new Thickness(0),
|
Padding = new Thickness(0),
|
||||||
@@ -115,13 +112,56 @@ namespace qController
|
|||||||
notes = new Label {
|
notes = new Label {
|
||||||
Text = "Loading Cue Lists and Playhead Position",
|
Text = "Loading Cue Lists and Playhead Position",
|
||||||
HorizontalTextAlignment = TextAlignment.Center,
|
HorizontalTextAlignment = TextAlignment.Center,
|
||||||
Margin = new Thickness(0,0,0,10)
|
Margin = new Thickness(0,0,0,10),
|
||||||
|
VerticalOptions = LayoutOptions.FillAndExpand,
|
||||||
|
HorizontalOptions = LayoutOptions.FillAndExpand
|
||||||
};
|
};
|
||||||
notes.VerticalOptions = LayoutOptions.FillAndExpand;
|
|
||||||
notes.HorizontalOptions = LayoutOptions.FillAndExpand;
|
|
||||||
|
|
||||||
|
|
||||||
|
//BACKGROUND COLORS FOR TESTING ONLY
|
||||||
|
//notes.BackgroundColor = Color.Red;
|
||||||
|
//number.BackgroundColor = Color.Red;
|
||||||
|
//name.BackgroundColor = Color.Red;
|
||||||
|
//type.BackgroundColor = Color.Red;
|
||||||
|
//topGrid.BackgroundColor = Color.Green;
|
||||||
|
//bottomGrid.BackgroundColor = Color.Green;
|
||||||
|
|
||||||
|
topGrid.Children.Add(number, 0, 0);
|
||||||
|
topGrid.Children.Add(type, 4, 0);
|
||||||
|
Grid.SetColumnSpan(number, 3);
|
||||||
|
Grid.SetColumnSpan(type, 1);
|
||||||
|
|
||||||
|
bottomGrid.Children.Add(name, 0, 0);
|
||||||
|
bottomGrid.Children.Add(notes, 0, 1);
|
||||||
|
Grid.SetColumnSpan(name, 5);
|
||||||
|
Grid.SetColumnSpan(notes,5);
|
||||||
|
|
||||||
|
mainG.Children.Add(topGrid, 0, 0);
|
||||||
|
Grid.SetColumnSpan(topGrid, 5);
|
||||||
|
|
||||||
|
mainG.Children.Add(bottomGrid, 0, 1);
|
||||||
|
Grid.SetColumnSpan(bottomGrid, 5);
|
||||||
|
|
||||||
|
Padding = new Thickness(5);
|
||||||
|
CornerRadius = 20;
|
||||||
|
BackgroundColor = Color.FromHex("D8D8D8");
|
||||||
|
HeightRequest = App.HeightUnit * 25;
|
||||||
|
Margin = new Thickness(10);
|
||||||
|
Content = mainG;
|
||||||
|
|
||||||
|
SetupDoubleTapEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetupDoubleTapEdit()
|
||||||
|
{
|
||||||
var notesDoubleTap = new TapGestureRecognizer();
|
var notesDoubleTap = new TapGestureRecognizer();
|
||||||
|
var nameDoubleTap = new TapGestureRecognizer();
|
||||||
|
var numberDoubleTap = new TapGestureRecognizer();
|
||||||
|
|
||||||
notesDoubleTap.NumberOfTapsRequired = 2;
|
notesDoubleTap.NumberOfTapsRequired = 2;
|
||||||
|
nameDoubleTap.NumberOfTapsRequired = 2;
|
||||||
|
numberDoubleTap.NumberOfTapsRequired = 2;
|
||||||
|
|
||||||
notesDoubleTap.Tapped += (s, e) =>
|
notesDoubleTap.Tapped += (s, e) =>
|
||||||
{
|
{
|
||||||
UserDialogs.Instance.Prompt(new PromptConfig
|
UserDialogs.Instance.Prompt(new PromptConfig
|
||||||
@@ -140,33 +180,43 @@ namespace qController
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nameDoubleTap.Tapped += (s, e) =>
|
||||||
|
{
|
||||||
|
UserDialogs.Instance.Prompt(new PromptConfig
|
||||||
|
{
|
||||||
|
Title = "Update Name",
|
||||||
|
Message = "Change name to update",
|
||||||
|
OkText = "Update",
|
||||||
|
Text = name.Text,
|
||||||
|
OnAction = (qName) =>
|
||||||
|
{
|
||||||
|
if (!qName.Ok)
|
||||||
|
return;
|
||||||
|
OnSelectedCueEdited("name", qName.Text);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
numberDoubleTap.Tapped += (s, e) =>
|
||||||
|
{
|
||||||
|
UserDialogs.Instance.Prompt(new PromptConfig
|
||||||
|
{
|
||||||
|
Title = "Update Number",
|
||||||
|
Message = "Change number to update",
|
||||||
|
OkText = "Update",
|
||||||
|
Text = number.Text,
|
||||||
|
OnAction = (qNumber) =>
|
||||||
|
{
|
||||||
|
if (!qNumber.Ok)
|
||||||
|
return;
|
||||||
|
OnSelectedCueEdited("number", qNumber.Text);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
notes.GestureRecognizers.Add(notesDoubleTap);
|
notes.GestureRecognizers.Add(notesDoubleTap);
|
||||||
|
name.GestureRecognizers.Add(nameDoubleTap);
|
||||||
notes.BackgroundColor = Color.FromHex("FF0000");
|
number.GestureRecognizers.Add(numberDoubleTap);
|
||||||
number.BackgroundColor = Color.Red;
|
|
||||||
name.BackgroundColor = Color.Red;
|
|
||||||
type.BackgroundColor = Color.Red;
|
|
||||||
|
|
||||||
topGrid.Children.Add(number, 0, 0);
|
|
||||||
topGrid.Children.Add(type, 4, 0);
|
|
||||||
Grid.SetColumnSpan(number, 3);
|
|
||||||
Grid.SetColumnSpan(type, 1);
|
|
||||||
|
|
||||||
bottomGrid.Children.Add(name, 0, 0);
|
|
||||||
bottomGrid.Children.Add(notes, 0, 1);
|
|
||||||
Grid.SetColumnSpan(name, 5);
|
|
||||||
Grid.SetColumnSpan(notes,5);
|
|
||||||
|
|
||||||
mainG.Children.Add(topGrid, 0, 0);
|
|
||||||
Grid.SetColumnSpan(topGrid, 5);
|
|
||||||
|
|
||||||
mainG.Children.Add(bottomGrid, 0, 1);
|
|
||||||
Grid.SetColumnSpan(bottomGrid, 5);
|
|
||||||
|
|
||||||
topGrid.BackgroundColor = Color.FromHex("00FF00");
|
|
||||||
bottomGrid.BackgroundColor = Color.FromHex("00FF00");
|
|
||||||
Margin = new Thickness(10);
|
|
||||||
Content = mainG;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSelectedCue(QCue cue)
|
public void UpdateSelectedCue(QCue cue)
|
||||||
|
|||||||
@@ -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" 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>
|
||||||
<StackLayout x:Name="sLayout">
|
<AbsoluteLayout x:Name="sLayout">
|
||||||
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand">
|
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutBounds="0,0,1,.09" AbsoluteLayout.LayoutFlags="All">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
@@ -13,6 +13,6 @@
|
|||||||
<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>
|
||||||
</StackLayout>
|
</AbsoluteLayout>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|||||||
@@ -99,15 +99,18 @@ namespace qController
|
|||||||
|
|
||||||
|
|
||||||
qCell = new QSelectedCueCell();
|
qCell = new QSelectedCueCell();
|
||||||
|
|
||||||
|
|
||||||
qCell.SelectedCueEdited += OnSelectedCueEdited;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSelectedCueEdited(object source, CueEditArgs args)
|
private void OnSelectedCueEdited(object source, CueEditArgs args)
|
||||||
{
|
{
|
||||||
string address = "/workspace/" + qController.qWorkspace.workspace_id + "/cue_id/" + args.CueID + "/" + args.Property
|
string address = "/workspace/" + qController.qWorkspace.workspace_id + "/cue_id/" + args.CueID + "/" + args.Property;
|
||||||
qController.qClient.sendArgsUDP(address, args.NewValue);
|
qController.qClient.sendArgsUDP(address, args.NewValue);
|
||||||
}
|
}
|
||||||
void FinishUI()
|
void FinishUI()
|
||||||
@@ -130,8 +133,22 @@ namespace qController
|
|||||||
};
|
};
|
||||||
|
|
||||||
qControlsBlock = new QControlsBlock(qController);
|
qControlsBlock = new QControlsBlock(qController);
|
||||||
|
|
||||||
|
AbsoluteLayout.SetLayoutBounds(qControlsBlock, new Rectangle(0, 0.53, 1, 0.25));
|
||||||
|
AbsoluteLayout.SetLayoutFlags(qControlsBlock, AbsoluteLayoutFlags.All);
|
||||||
sLayout.Children.Add(qControlsBlock);
|
sLayout.Children.Add(qControlsBlock);
|
||||||
|
|
||||||
|
Button b = new Button{
|
||||||
|
Text = "L",
|
||||||
|
TextColor = Color.Black,
|
||||||
|
HeightRequest = App.HeightUnit * 10,
|
||||||
|
WidthRequest = App.HeightUnit * 10,
|
||||||
|
CornerRadius = (int)(App.HeightUnit * 5),
|
||||||
|
BackgroundColor = Color.Blue
|
||||||
|
};
|
||||||
|
AbsoluteLayout.SetLayoutBounds(b, new Rectangle(0.99, 0.99, App.HeightUnit * 10, App.HeightUnit * 10));
|
||||||
|
AbsoluteLayout.SetLayoutFlags(b, AbsoluteLayoutFlags.PositionProportional);
|
||||||
|
//sLayout.Children.Add(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowMenu(object sender, EventArgs e)
|
void ShowMenu(object sender, EventArgs e)
|
||||||
@@ -143,7 +160,10 @@ namespace qController
|
|||||||
void Back()
|
void Back()
|
||||||
{
|
{
|
||||||
qController.Disconnect();
|
qController.Disconnect();
|
||||||
App.rootPage.MenuPage.ChangeToHome();
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
App.rootPage.MenuPage.ChangeToHome();
|
||||||
|
});
|
||||||
App.NavigationPage.Navigation.PopAsync();
|
App.NavigationPage.Navigation.PopAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +176,10 @@ namespace qController
|
|||||||
|
|
||||||
if (qController.qWorkspace.IsPopulated)
|
if (qController.qWorkspace.IsPopulated)
|
||||||
{
|
{
|
||||||
App.rootPage.MenuPage.ChangeToWorkspace(e.UpdatedWorkspace);
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
App.rootPage.MenuPage.ChangeToWorkspace(e.UpdatedWorkspace);
|
||||||
|
});
|
||||||
if (qCell.activeCue == null)
|
if (qCell.activeCue == null)
|
||||||
{
|
{
|
||||||
Device.BeginInvokeOnMainThread(() => {
|
Device.BeginInvokeOnMainThread(() => {
|
||||||
@@ -181,20 +204,23 @@ 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.type.Equals("Audio"))
|
||||||
sLayout.Children.Add(qSelectedCueOptions);
|
sLayout.Children.Add(qSelectedCueOptions);
|
||||||
else
|
else
|
||||||
sLayout.Children.Remove(qSelectedCueOptions);
|
sLayout.Children.Remove(qSelectedCueOptions);
|
||||||
qCell.UpdateSelectedCue(cue);
|
qCell.UpdateSelectedCue(cue);
|
||||||
});
|
});*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnCueUpdateReceived(object sender, CueEventArgs args)
|
public void OnCueUpdateReceived(object sender, CueEventArgs args)
|
||||||
{
|
{
|
||||||
qController.qWorkspace.UpdateCue(args.Cue);
|
qController.qWorkspace.UpdateCue(args.Cue);
|
||||||
App.rootPage.MenuPage.ChangeCueName(args.Cue.uniqueID, args.Cue.listName);
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
{
|
||||||
|
App.rootPage.MenuPage.ChangeCueName(args.Cue.uniqueID, args.Cue.listName);
|
||||||
|
});
|
||||||
if (qController.playbackPosition == null)
|
if (qController.playbackPosition == null)
|
||||||
{
|
{
|
||||||
qController.playbackPosition = args.Cue.uniqueID;
|
qController.playbackPosition = args.Cue.uniqueID;
|
||||||
@@ -205,10 +231,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);
|
sLayout.Children.Add(qSelectedCueOptions);
|
||||||
else
|
else
|
||||||
sLayout.Children.Remove(qSelectedCueOptions);
|
sLayout.Children.Remove(qSelectedCueOptions);*/
|
||||||
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