Skip to content

Instantly share code, notes, and snippets.

@ChaseFlorell
Last active May 29, 2020 15:10
Show Gist options
  • Select an option

  • Save ChaseFlorell/45db24304f1146b9d6d44ae179a5c687 to your computer and use it in GitHub Desktop.

Select an option

Save ChaseFlorell/45db24304f1146b9d6d44ae179a5c687 to your computer and use it in GitHub Desktop.

Revisions

  1. ChaseFlorell revised this gist May 29, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    ## Android
    ![Screenshot_1590764575](https://user-images.githubusercontent.com/471626/83275297-d2f0b700-a183-11ea-8c31-a9cdbd35ad71.png)
    ![Screenshot_1590764567](https://user-images.githubusercontent.com/471626/83275302-d421e400-a183-11ea-87a4-d41be806908b.png)
  2. ChaseFlorell created this gist May 29, 2020.
    9 changes: 9 additions & 0 deletions AppStyle.xaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <Style TargetType="Switch">
    <Setter Property="OnColor" Value="{DynamicResource SwitchOnColor}" />
    <Setter Property="ThumbColor" Value="{DynamicResource SwitchOnThumbColor}" />
    <Style.Triggers>
    <Trigger TargetType="Switch" Property="IsToggled" Value="False">
    <Setter Property="ThumbColor" Value="{DynamicResource SwitchOffThumbColor}" />
    </Trigger>
    </Style.Triggers>
    </Style>
    12 changes: 12 additions & 0 deletions Colors.xaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    <OnPlatform x:Key="SwitchOnThumbColor" x:TypeArguments="Color">
    <On Platform="Android" Value="#fb9e40"/> <!-- AccentColor -->
    </OnPlatform>

    <OnPlatform x:Key="SwitchOffThumbColor" x:TypeArguments="Color">
    <On Platform="Android" Value="#f3f4f4"/> <!-- TextColor -->
    </OnPlatform>

    <OnPlatform x:Key="SwitchOnColor" x:TypeArguments="Color">
    <On Platform="iOS" Value="#fb9e40"/> <!-- AccentColor -->
    <On Platform="Android" Value="#dfe0e1"/> <!-- Gray similar to iOS -->
    </OnPlatform>