* 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:
2019-07-15 16:37:23 -05:00
parent a39c1d43ff
commit 071ce36821
4 changed files with 123 additions and 47 deletions
@@ -21,7 +21,7 @@ namespace qController
IsVisible = true;
BackgroundColor = Color.FromHex("4A4A4A");
BackgroundColor = Color.Transparent;
//highlight Button Grid
//BackgroundColor = Color.FromHex("FF0000");
@@ -35,10 +35,7 @@ namespace qController
public QCue activeCue;
public QSelectedCueCell()
{
Padding = new Thickness(5);
CornerRadius = 20;
BackgroundColor = Color.FromHex("D8D8D8");
HeightRequest = App.HeightUnit * 25;
Grid mainG = new Grid
{
Padding = new Thickness(0),
@@ -115,13 +112,56 @@ namespace qController
notes = new Label {
Text = "Loading Cue Lists and Playhead Position",
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 nameDoubleTap = new TapGestureRecognizer();
var numberDoubleTap = new TapGestureRecognizer();
notesDoubleTap.NumberOfTapsRequired = 2;
nameDoubleTap.NumberOfTapsRequired = 2;
numberDoubleTap.NumberOfTapsRequired = 2;
notesDoubleTap.Tapped += (s, e) =>
{
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.BackgroundColor = Color.FromHex("FF0000");
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;
name.GestureRecognizers.Add(nameDoubleTap);
number.GestureRecognizers.Add(numberDoubleTap);
}
public void UpdateSelectedCue(QCue cue)
+3 -3
View File
@@ -1,8 +1,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.Content>
<StackLayout x:Name="sLayout">
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand">
<AbsoluteLayout x:Name="sLayout">
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutBounds="0,0,1,.09" AbsoluteLayout.LayoutFlags="All">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</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 = "instanceName" HorizontalTextAlignment="Center" HorizontalOptions = "CenterAndExpand" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="1"/>
</Grid>
</StackLayout>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>
+36 -10
View File
@@ -99,15 +99,18 @@ namespace qController
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);
}
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);
}
void FinishUI()
@@ -130,8 +133,22 @@ namespace 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);
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)
@@ -143,7 +160,10 @@ namespace qController
void Back()
{
qController.Disconnect();
App.rootPage.MenuPage.ChangeToHome();
Device.BeginInvokeOnMainThread(() =>
{
App.rootPage.MenuPage.ChangeToHome();
});
App.NavigationPage.Navigation.PopAsync();
}
@@ -156,7 +176,10 @@ namespace qController
if (qController.qWorkspace.IsPopulated)
{
App.rootPage.MenuPage.ChangeToWorkspace(e.UpdatedWorkspace);
Device.BeginInvokeOnMainThread(() =>
{
App.rootPage.MenuPage.ChangeToWorkspace(e.UpdatedWorkspace);
});
if (qCell.activeCue == null)
{
Device.BeginInvokeOnMainThread(() => {
@@ -181,20 +204,23 @@ namespace qController
QCue cue = qController.qWorkspace.GetCue(qController.playbackPosition);
if(cue != null)
{
Device.BeginInvokeOnMainThread(() => {
/*Device.BeginInvokeOnMainThread(() => {
if (cue.type.Equals("Audio"))
sLayout.Children.Add(qSelectedCueOptions);
else
sLayout.Children.Remove(qSelectedCueOptions);
qCell.UpdateSelectedCue(cue);
});
});*/
}
}
public void OnCueUpdateReceived(object sender, CueEventArgs args)
{
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)
{
qController.playbackPosition = args.Cue.uniqueID;
@@ -205,10 +231,10 @@ namespace qController
Device.BeginInvokeOnMainThread(() =>
{
Console.WriteLine("Refreshing Currently Displayed Cue");
if (args.Cue.levels != null)
/*if (args.Cue.levels != null)
sLayout.Children.Add(qSelectedCueOptions);
else
sLayout.Children.Remove(qSelectedCueOptions);
sLayout.Children.Remove(qSelectedCueOptions);*/
qCell.UpdateSelectedCue(args.Cue);
//if (!mainG.IsVisible)
// mainG.IsVisible = true;