Move Colors to App resources

This commit is contained in:
2020-10-18 17:24:04 -05:00
parent 3ec058ab08
commit b0a6124d43
4 changed files with 15 additions and 7 deletions
@@ -63,9 +63,9 @@ namespace qController.Cell
HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand,
Padding = 0, Padding = 0,
Margin = new Thickness(10,10,10,10), Margin = new Thickness(10,10,10,10),
CornerRadius=20, CornerRadius=20
BackgroundColor = Color.FromHex("D8D8D8")
}; };
f.SetDynamicResource(Frame.BackgroundColorProperty, "WorkspaceCellBackgroundColor");
View = f; View = f;
@@ -77,11 +77,13 @@ namespace qController.Cell
nameLabel.FontAttributes = FontAttributes.Bold; nameLabel.FontAttributes = FontAttributes.Bold;
nameLabel.FontSize = App.HeightUnit * 3; nameLabel.FontSize = App.HeightUnit * 3;
nameLabel.Margin = new Thickness(0, 20, 0, 0); nameLabel.Margin = new Thickness(0, 20, 0, 0);
nameLabel.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
addressLabel.HorizontalTextAlignment = TextAlignment.Center; addressLabel.HorizontalTextAlignment = TextAlignment.Center;
addressLabel.VerticalTextAlignment = TextAlignment.Start; addressLabel.VerticalTextAlignment = TextAlignment.Start;
addressLabel.FontSize = App.HeightUnit * 2.5; addressLabel.FontSize = App.HeightUnit * 2.5;
addressLabel.Margin = new Thickness(0, 0, 0, 20); addressLabel.Margin = new Thickness(0, 0, 0, 20);
addressLabel.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
connectLabel.HorizontalOptions = LayoutOptions.StartAndExpand; connectLabel.HorizontalOptions = LayoutOptions.StartAndExpand;
connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand; connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand;
@@ -33,6 +33,7 @@ namespace qController.UI
Padding = new Thickness(10,0,0,0) Padding = new Thickness(10,0,0,0)
}; };
cueLabel.SetBinding(Label.TextProperty, "name", BindingMode.OneWay); cueLabel.SetBinding(Label.TextProperty, "name", BindingMode.OneWay);
cueLabel.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
//Section for selecting a cue by tapping the name Label //Section for selecting a cue by tapping the name Label
var selectCueGesture = new TapGestureRecognizer(); var selectCueGesture = new TapGestureRecognizer();
@@ -10,17 +10,18 @@ namespace qController.UI
{ {
//Colored border size //Colored border size
Padding = 8; Padding = 8;
HeightRequest = 175;
CornerRadius = 0; CornerRadius = 0;
this.SetBinding(Frame.BackgroundColorProperty, "color", BindingMode.OneWay); this.SetBinding(Frame.BackgroundColorProperty, "color", BindingMode.OneWay);
this.SetBinding(Frame.BorderColorProperty, "color", BindingMode.OneWay); this.SetBinding(Frame.BorderColorProperty, "color", BindingMode.OneWay);
Frame frameInt = new Frame Frame frameInt = new Frame
{ {
Padding = 0, Padding = 0
BackgroundColor = Color.FromHex("#D8D8D8")
}; };
frameInt.SetDynamicResource(Frame.BackgroundColorProperty, "SelectedCueCellBackgroundColor");
Grid selectedCueGrid = new Grid Grid selectedCueGrid = new Grid
{ {
@@ -54,6 +55,7 @@ namespace qController.UI
Padding = new Thickness(15,5,0,0), Padding = new Thickness(15,5,0,0),
FontSize = App.HeightUnit * 3 FontSize = App.HeightUnit * 3
}; };
number.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
number.SetBinding(Label.TextProperty, "number", BindingMode.OneWay); number.SetBinding(Label.TextProperty, "number", BindingMode.OneWay);
selectedCueGrid.Children.Add(number,0,0); selectedCueGrid.Children.Add(number,0,0);
Grid.SetColumnSpan(number, 2); Grid.SetColumnSpan(number, 2);
@@ -69,6 +71,7 @@ namespace qController.UI
FontSize = App.HeightUnit * 4, FontSize = App.HeightUnit * 4,
FontFamily = App.QFont FontFamily = App.QFont
}; };
type.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
type.SetBinding(Label.TextProperty, "type", BindingMode.OneWay); type.SetBinding(Label.TextProperty, "type", BindingMode.OneWay);
selectedCueGrid.Children.Add(type, 4, 0); selectedCueGrid.Children.Add(type, 4, 0);
@@ -82,6 +85,7 @@ namespace qController.UI
BackgroundColor = Color.Transparent, BackgroundColor = Color.Transparent,
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label))
}; };
name.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
name.SetBinding(Label.TextProperty, "name", BindingMode.TwoWay); name.SetBinding(Label.TextProperty, "name", BindingMode.TwoWay);
selectedCueGrid.Children.Add(name, 0, 1); selectedCueGrid.Children.Add(name, 0, 1);
Grid.SetColumnSpan(name, 5); Grid.SetColumnSpan(name, 5);
@@ -94,6 +98,7 @@ namespace qController.UI
BackgroundColor = Color.Transparent, BackgroundColor = Color.Transparent,
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Editor)) FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Editor))
}; };
notes.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
notes.SetBinding(Editor.TextProperty, "notes", BindingMode.TwoWay); notes.SetBinding(Editor.TextProperty, "notes", BindingMode.TwoWay);
selectedCueGrid.Children.Add(notes, 0, 2); selectedCueGrid.Children.Add(notes, 0, 2);
+2 -2
View File
@@ -57,9 +57,9 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.452" /> <PackageReference Include="Acr.UserDialogs" Version="7.1.0.462" />
<PackageReference Include="Zeroconf" Version="3.4.2" /> <PackageReference Include="Zeroconf" Version="3.4.2" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1364" /> <PackageReference Include="Xamarin.Forms" Version="4.8.0.1560" />
<PackageReference Include="Acr.Settings" Version="9.0.1" /> <PackageReference Include="Acr.Settings" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" /> <PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />