1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-17 15:27:43 +01:00

theme variables

This commit is contained in:
Kyle Spearrin 2019-04-22 14:17:33 -04:00
parent c3fe3292ad
commit 6cd1171fd5
7 changed files with 50 additions and 21 deletions

View File

@ -57,6 +57,9 @@
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Styles\Variables.xaml.cs">
<DependentUpon>Variables.xaml</DependentUpon>
</Compile>
<Compile Update="Styles\Light.xaml.cs">
<DependentUpon>Light.xaml</DependentUpon>
</Compile>

View File

@ -4,6 +4,7 @@
x:Class="Bit.App.Styles.Android">
<Style TargetType="Label"
Class="list-header-platform">
<Setter Property="TextColor"
Value="{StaticResource ListHeaderTextColor}" />
</Style>
</ResourceDictionary>

View File

@ -2,9 +2,10 @@
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Styles.Dark">
<Style TargetType="Label"
Class="list-header-themed">
<Setter Property="TextColor"
Value="Green" />
</Style>
<Color x:Key="TextColor">#000000</Color>
<Color x:Key="PrimaryColor">#3c8dbc</Color>
<Color x:Key="DangerColor">#dd4b39</Color>
<Color x:Key="SuccessColor">#00a65a</Color>
<Color x:Key="InfoColor">#555555</Color>
<Color x:Key="WarningColor">#bf7e16</Color>
</ResourceDictionary>

View File

@ -2,9 +2,12 @@
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Styles.Light">
<Style TargetType="Label"
Class="list-header-themed">
<Setter Property="TextColor"
Value="Blue" />
</Style>
<Color x:Key="TextColor">#000000</Color>
<Color x:Key="PrimaryColor">#3c8dbc</Color>
<Color x:Key="DangerColor">#dd4b39</Color>
<Color x:Key="SuccessColor">#00a65a</Color>
<Color x:Key="InfoColor">#555555</Color>
<Color x:Key="WarningColor">#bf7e16</Color>
<Color x:Key="ListHeaderTextColor">#3c8dbc</Color>
</ResourceDictionary>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Styles.Variables">
</ResourceDictionary>

View File

@ -0,0 +1,12 @@
using Xamarin.Forms;
namespace Bit.App.Styles
{
public partial class Variables : ResourceDictionary
{
public Variables()
{
InitializeComponent();
}
}
}

View File

@ -30,6 +30,19 @@ namespace Bit.App.Utilities
Application.Current.Resources.Clear();
Application.Current.Resources.MergedDictionaries.Clear();
// Variables
Application.Current.Resources.MergedDictionaries.Add(new Variables());
// Themed variables
if(name == "dark")
{
Application.Current.Resources.MergedDictionaries.Add(new Dark());
}
else
{
Application.Current.Resources.MergedDictionaries.Add(new Light());
}
// Base styles
Application.Current.Resources.MergedDictionaries.Add(new Base());
@ -42,16 +55,6 @@ namespace Bit.App.Utilities
{
Application.Current.Resources.MergedDictionaries.Add(new iOS());
}
// Theme styles
if(name == "dark")
{
Application.Current.Resources.MergedDictionaries.Add(new Dark());
}
else
{
Application.Current.Resources.MergedDictionaries.Add(new Light());
}
}
}
}