Skip to content

Commit

Permalink
Merge pull request #14 from ZeroGachis/fix/fix-separators
Browse files Browse the repository at this point in the history
💄 fix separators visual
  • Loading branch information
a-bertrand authored Nov 5, 2020
2 parents 158ea36 + 6953bcf commit 9b0bce8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<separators:LabelledDivider Label="This is Sparta !" />
<Label Text="Separator avec Label et Couleur custom"
HorizontalOptions="CenterAndExpand" />
<separators:LabelledDivider Label="This is Sparta With Colors !" Color="#A2A2BA" />
<separators:LabelledDivider Label="This is Sparta With Colors !" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
12 changes: 7 additions & 5 deletions Smartway.UiComponent/Separators/LabelledDivider.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
<ContentView.Resources>
<Style x:Key="LineStyle" TargetType="BoxView">
<Setter Property="HeightRequest" Value="1" />
<Setter Property="Margin" Value="0, 8" />
<Setter Property="Margin" Value="0, 10" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="BackgroundColor" Value="#3D4458" />
</Style>
<Style x:Key="LabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="12" />
<Setter Property="FontSize" Value="14" />
<Setter Property="MaxLines" Value="1" />
<Setter Property="TextColor" Value="#A2A2BA" />
</Style>
</ContentView.Resources>
<ContentView.Content>
<StackLayout Orientation="Horizontal" VerticalOptions="Center">
<BoxView Style="{StaticResource LineStyle}" BackgroundColor="{Binding Source={Reference Self}, Path=Color}"/>
<Label Style="{StaticResource LabelStyle}" Text="{Binding Source={Reference Self}, Path=Label}" TextColor="{Binding Source={Reference Self}, Path=Color}" />
<BoxView Style="{StaticResource LineStyle}" BackgroundColor="{Binding Source={Reference Self}, Path=Color}" />
<BoxView Style="{StaticResource LineStyle}" />
<Label Style="{StaticResource LabelStyle}" Text="{Binding Source={Reference Self}, Path=Label}" />
<BoxView Style="{StaticResource LineStyle}" />
</StackLayout>
</ContentView.Content>
</ContentView>
8 changes: 0 additions & 8 deletions Smartway.UiComponent/Separators/LabelledDivider.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,12 @@ namespace Smartway.UiComponent.Separators
public partial class LabelledDivider
{
public static readonly BindableProperty LabelProperty = BindableProperty.Create(nameof(Label), typeof(string), typeof(LabelledDivider));
public static readonly BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(string), typeof(LabelledDivider), "#E2E4F0");

public string Label
{
get => (string) GetValue(LabelProperty);
set => SetValue(LabelProperty, value);
}

public string Color
{
get => (string) GetValue(ColorProperty);
set => SetValue(ColorProperty, value);
}

public LabelledDivider()
{
InitializeComponent();
Expand Down

0 comments on commit 9b0bce8

Please sign in to comment.