mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-17 15:27:43 +01:00
theme variables
This commit is contained in:
parent
c3fe3292ad
commit
6cd1171fd5
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
6
src/App/Styles/Variables.xaml
Normal file
6
src/App/Styles/Variables.xaml
Normal 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>
|
12
src/App/Styles/Variables.xaml.cs
Normal file
12
src/App/Styles/Variables.xaml.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Styles
|
||||
{
|
||||
public partial class Variables : ResourceDictionary
|
||||
{
|
||||
public Variables()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user