From d54b19a3a2b381c3fe0cf5cb0a05d57141d2848b Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 18 Oct 2020 22:34:50 -0500 Subject: [PATCH] Android requires hiding rows with height = 0 --- qController.Standard/Classes/UI/QCueGrid.cs | 28 +++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/qController.Standard/Classes/UI/QCueGrid.cs b/qController.Standard/Classes/UI/QCueGrid.cs index abef366..1a230f2 100644 --- a/qController.Standard/Classes/UI/QCueGrid.cs +++ b/qController.Standard/Classes/UI/QCueGrid.cs @@ -37,6 +37,7 @@ namespace qController.UI BindingContext = qCueViewModel, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalTextAlignment = TextAlignment.Center, + Margin = new Thickness(10, 0, 0, 0), //BackgroundColor = Color.Blue, }; cueLabel.SetBinding(Label.TextProperty, "name", BindingMode.OneWay); @@ -47,14 +48,25 @@ namespace qController.UI { FontFamily = App.QFont, BindingContext = qCueViewModel, - HorizontalOptions = LayoutOptions.StartAndExpand, + HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Start, + VerticalOptions = LayoutOptions.FillAndExpand, VerticalTextAlignment = TextAlignment.Center, Padding = 0, Margin = new Thickness(10,0,0,0), - FontSize = App.HeightUnit * 3, //BackgroundColor = Color.Red }; + + switch (Device.RuntimePlatform) + { + case Device.Android: + cueTypeLabel.FontSize = App.HeightUnit * 4; + break; + default: + cueTypeLabel.FontSize = App.HeightUnit * 3; + break; + } + cueTypeLabel.SetBinding(Label.TextProperty, "type", BindingMode.OneWay); cueTypeLabel.SetDynamicResource(Label.TextColorProperty, "IconTextColor"); @@ -78,6 +90,18 @@ namespace qController.UI for (var i = 1; i < RowDefinitions.Count; i++) { RowDefinitions[i].Height = qCueViewModel.IsCollapsed ? 0 : GridLength.Auto; + + } + + if (Device.RuntimePlatform.Equals(Device.Android)) + { + foreach (var child in Children) + { + if (Grid.GetRow(child) > 0) + { + child.IsVisible = !qCueViewModel.IsCollapsed; + } + } } } };