mirror of
https://github.com/bitwarden/mobile
synced 2025-12-12 14:23:26 +00:00
themeing
This commit is contained in:
@@ -15,6 +15,7 @@ using Bit.Droid.Receivers;
|
||||
using Bit.App.Models;
|
||||
using Bit.Core.Enums;
|
||||
using Android.Nfc;
|
||||
using Bit.App.Utilities;
|
||||
|
||||
namespace Bit.Droid
|
||||
{
|
||||
@@ -56,6 +57,7 @@ namespace Bit.Droid
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
UpdateTheme(ThemeManager.GetTheme());
|
||||
base.OnCreate(savedInstanceState);
|
||||
if(!CoreHelpers.InDebugMode())
|
||||
{
|
||||
@@ -95,6 +97,10 @@ namespace Bit.Droid
|
||||
{
|
||||
ListenYubiKey((bool)message.Data);
|
||||
}
|
||||
else if(message.Command == "updatedTheme")
|
||||
{
|
||||
Recreate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -255,5 +261,17 @@ namespace Bit.Droid
|
||||
_messagingService.Send("gotYubiKeyOTP", otp);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTheme(string theme)
|
||||
{
|
||||
if(theme == "dark")
|
||||
{
|
||||
SetTheme(Resource.Style.DarkTheme);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTheme(Resource.Style.MainTheme);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user