mirror of
https://github.com/bitwarden/mobile
synced 2025-12-30 07:03:48 +00:00
support dark theme logos
This commit is contained in:
@@ -16,9 +16,7 @@ namespace Bit.App.Pages
|
||||
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
||||
_messagingService.Send("showStatusBar", false);
|
||||
InitializeComponent();
|
||||
var theme = ThemeManager.GetTheme(Device.RuntimePlatform == Device.Android);
|
||||
var darkbasedTheme = theme == "dark" || theme == "black" || theme == "nord";
|
||||
_logo.Source = darkbasedTheme ? "logo_white.png" : "logo.png";
|
||||
_logo.Source = !ThemeManager.UsingLightTheme ? "logo_white.png" : "logo.png";
|
||||
}
|
||||
|
||||
public async Task DismissRegisterPageAndLogInAsync(string email)
|
||||
|
||||
@@ -9,6 +9,8 @@ namespace Bit.App.Utilities
|
||||
{
|
||||
public static class ThemeManager
|
||||
{
|
||||
public static bool UsingLightTheme = true;
|
||||
|
||||
public static void SetThemeStyle(string name)
|
||||
{
|
||||
// Reset styles
|
||||
@@ -22,18 +24,22 @@ namespace Bit.App.Utilities
|
||||
if(name == "dark")
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(new Dark());
|
||||
UsingLightTheme = false;
|
||||
}
|
||||
else if(name == "black")
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(new Black());
|
||||
UsingLightTheme = false;
|
||||
}
|
||||
else if(name == "nord")
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(new Nord());
|
||||
UsingLightTheme = false;
|
||||
}
|
||||
else if(name == "light")
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(new Nord());
|
||||
UsingLightTheme = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -41,10 +47,12 @@ namespace Bit.App.Utilities
|
||||
if(deviceActionService?.UsingDarkTheme() ?? false)
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(new Dark());
|
||||
UsingLightTheme = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(new Light());
|
||||
UsingLightTheme = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user