From fb26f6b9240145b1944c5960ebfd65492acddd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=8A=B9=EA=B7=BC/Common=20Platform=20Lab=28SR?= =?UTF-8?q?=29/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 5 Jul 2022 18:34:02 +0900 Subject: [PATCH] Fix Compatibility Cell templates (#517) --- .../CollectionView/CellContentFactory.cs | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/Compatibility/Core/src/Tizen/CollectionView/CellContentFactory.cs b/src/Compatibility/Core/src/Tizen/CollectionView/CellContentFactory.cs index ec9fff1b3303..5ce757183594 100644 --- a/src/Compatibility/Core/src/Tizen/CollectionView/CellContentFactory.cs +++ b/src/Compatibility/Core/src/Tizen/CollectionView/CellContentFactory.cs @@ -109,7 +109,7 @@ static View CreateContent(TextCell textcell) { Spacing = 0, HorizontalOptions = LayoutOptions.Fill, - Padding = new Thickness(10, 5), + Margin = new Thickness(10, 5), Children = { text, @@ -128,19 +128,13 @@ static View CreateContent(ImageCell imageCell) HorizontalOptions = LayoutOptions.Fill, ColumnDefinitions = { - new ColumnDefinition - { - Width = new GridLength(2, GridUnitType.Star) - }, - new ColumnDefinition - { - Width = new GridLength(8, GridUnitType.Star) - }, - } + new ColumnDefinition(GridLength.Auto), + new ColumnDefinition(GridLength.Star) + }, + Margin = new Thickness(10, 5), }; var img = new Image { - HorizontalOptions = LayoutOptions.Start, Aspect = Aspect.AspectFit, }; img.SetBinding(Image.SourceProperty, new Binding("ImageSource", source: imageCell)); @@ -164,9 +158,9 @@ static View CreateContent(EntryCell entryCell) #pragma warning disable CS0612 // Type or member is obsolete label.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)); #pragma warning restore CS0612 // Type or member is obsolete - label.Margin = new Thickness(20, 0, 0, 0); var layout = new Controls.StackLayout { + Margin = new Thickness(10, 5), HorizontalOptions = LayoutOptions.Fill, Children = { @@ -180,10 +174,13 @@ static View CreateContent(EntryCell entryCell) static View CreateContent(SwitchCell switchCell) { +#pragma warning disable CS0618 var text = new Label { - HorizontalOptions = LayoutOptions.Start + VerticalTextAlignment = TextAlignment.Center, + HorizontalOptions = LayoutOptions.StartAndExpand, }; +#pragma warning restore CS0618 text.SetBinding(Label.TextProperty, new Binding("Text", source: switchCell)); var sw = new Switch @@ -195,8 +192,7 @@ static View CreateContent(SwitchCell switchCell) var layout = new Controls.StackLayout { - Padding = new Thickness(10, 5), - Spacing = 0, + Margin = new Thickness(10, 5), HorizontalOptions = LayoutOptions.Fill, Orientation = StackOrientation.Horizontal, Children = @@ -218,6 +214,7 @@ class CellContentView : ContentView BindableObject _target; public CellContentView(BindableObject target, BindableObject container = null, bool hasVisualState = true, bool hasSeparator = true) { + BackgroundColor = Colors.Transparent; var separator = new BoxView { Margin = new Thickness(10, 0), @@ -281,7 +278,7 @@ void SetupVisualState() var selected = new VisualState { Name = VisualStateManager.CommonStates.Selected, - TargetType = typeof(View), + TargetType = typeof(Controls.Layout), Setters = { new Setter @@ -295,7 +292,7 @@ void SetupVisualState() var normal = new VisualState { Name = VisualStateManager.CommonStates.Normal, - TargetType = typeof(View), + TargetType = typeof(Controls.Layout), Setters = { new Setter @@ -308,7 +305,7 @@ void SetupVisualState() var focused = new VisualState { Name = VisualStateManager.CommonStates.Focused, - TargetType = typeof(View), + TargetType = typeof(Controls.Layout), Setters = { new Setter