slider styling

This commit is contained in:
Kyle Spearrin 2019-06-22 09:45:54 -04:00
parent 164d79898a
commit 1705a21f68
6 changed files with 19 additions and 8 deletions

View file

@ -22,8 +22,15 @@ namespace Bit.Droid.Renderers
{ {
var t = ResourcesCompat.GetDrawable(Resources, Resource.Drawable.slider_thumb, null); var t = ResourcesCompat.GetDrawable(Resources, Resource.Drawable.slider_thumb, null);
if(t is GradientDrawable thumb) if(t is GradientDrawable thumb)
{
if(view.ThumbColor == Color.Default)
{
thumb.SetColor(Color.White.ToAndroid());
}
else
{ {
thumb.SetColor(view.ThumbColor.ToAndroid()); thumb.SetColor(view.ThumbColor.ToAndroid());
}
thumb.SetStroke(3, view.ThumbBorderColor.ToAndroid()); thumb.SetStroke(3, view.ThumbBorderColor.ToAndroid());
Control.SetThumb(thumb); Control.SetThumb(thumb);
} }

View file

@ -62,9 +62,9 @@
</Style> </Style>
<Style TargetType="controls:ExtendedSlider"> <Style TargetType="controls:ExtendedSlider">
<Setter Property="MinimumTrackColor" <Setter Property="MinimumTrackColor"
Value="{StaticResource SliderTrackColor}" /> Value="{StaticResource SliderTrackMinColor}" />
<Setter Property="MaximumTrackColor" <Setter Property="MaximumTrackColor"
Value="{StaticResource SliderTrackColor}" /> Value="{StaticResource SliderTrackMaxColor}" />
<Setter Property="ThumbColor" <Setter Property="ThumbColor"
Value="{StaticResource SliderThumbColor}" /> Value="{StaticResource SliderThumbColor}" />
<Setter Property="ThumbBorderColor" <Setter Property="ThumbBorderColor"

View file

@ -31,7 +31,8 @@
<Color x:Key="SliderThumbColor">#B9B9B9</Color> <Color x:Key="SliderThumbColor">#B9B9B9</Color>
<Color x:Key="SliderThumbBorderColor">#000000</Color> <Color x:Key="SliderThumbBorderColor">#000000</Color>
<Color x:Key="SliderTrackColor">#52bdfb</Color> <Color x:Key="SliderTrackMinColor">#52bdfb</Color>
<Color x:Key="SliderTrackMaxColor">#52bdfb</Color>
<Color x:Key="ButtonTextColor">#000000</Color> <Color x:Key="ButtonTextColor">#000000</Color>
<Color x:Key="ButtonBackgroundColor">#dddddd</Color> <Color x:Key="ButtonBackgroundColor">#dddddd</Color>

View file

@ -31,7 +31,8 @@
<Color x:Key="SliderThumbColor">#B9B9B9</Color> <Color x:Key="SliderThumbColor">#B9B9B9</Color>
<Color x:Key="SliderThumbBorderColor">#000000</Color> <Color x:Key="SliderThumbBorderColor">#000000</Color>
<Color x:Key="SliderTrackColor">#52bdfb</Color> <Color x:Key="SliderTrackMinColor">#52bdfb</Color>
<Color x:Key="SliderTrackMaxColor">#52bdfb</Color>
<Color x:Key="ButtonTextColor">#000000</Color> <Color x:Key="ButtonTextColor">#000000</Color>
<Color x:Key="ButtonBackgroundColor">#dddddd</Color> <Color x:Key="ButtonBackgroundColor">#dddddd</Color>

View file

@ -29,9 +29,10 @@
<Color x:Key="ListHeaderTextColor">#3c8dbc</Color> <Color x:Key="ListHeaderTextColor">#3c8dbc</Color>
<Color x:Key="ListHeaderBackgroundColor">#efeff4</Color> <Color x:Key="ListHeaderBackgroundColor">#efeff4</Color>
<Color x:Key="SliderThumbColor">#ffffff</Color> <Color x:Key="SliderThumbColor">Default</Color>
<Color x:Key="SliderThumbBorderColor">#b5b5b5</Color> <Color x:Key="SliderThumbBorderColor">#b5b5b5</Color>
<Color x:Key="SliderTrackColor">#dddddd</Color> <Color x:Key="SliderTrackMinColor">#3c8dbc</Color>
<Color x:Key="SliderTrackMaxColor">#dddddd</Color>
<Color x:Key="ButtonTextColor">#000000</Color> <Color x:Key="ButtonTextColor">#000000</Color>
<Color x:Key="ButtonBackgroundColor">#dddddd</Color> <Color x:Key="ButtonBackgroundColor">#dddddd</Color>

View file

@ -31,7 +31,8 @@
<Color x:Key="SliderThumbColor">#e5e9f0</Color> <Color x:Key="SliderThumbColor">#e5e9f0</Color>
<Color x:Key="SliderThumbBorderColor">#2e3440</Color> <Color x:Key="SliderThumbBorderColor">#2e3440</Color>
<Color x:Key="SliderTrackColor">#81a1c1</Color> <Color x:Key="SliderTrackMinColor">#81a1c1</Color>
<Color x:Key="SliderTrackMaxColor">#81a1c1</Color>
<Color x:Key="ButtonTextColor">#000000</Color> <Color x:Key="ButtonTextColor">#000000</Color>
<Color x:Key="ButtonBackgroundColor">#dddddd</Color> <Color x:Key="ButtonBackgroundColor">#dddddd</Color>