1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-04 17:43:17 +00:00

Additional support for system theme setting (#1124)

* first pass with iOS 13+ support

* tweaks for ios pre-13

* Added Android support for dark/light splash & detection with default theme

* update cipher cell text color on system theme change (android)
This commit is contained in:
Matt Portune
2020-10-20 15:26:25 -04:00
committed by GitHub
parent 26d5504a2f
commit 3cbe932248
19 changed files with 133 additions and 27 deletions

View File

@@ -8,6 +8,7 @@ using Android.App;
using Android.App.Assist;
using Android.Content;
using Android.Content.PM;
using Android.Content.Res;
using Android.Nfc;
using Android.OS;
using Android.Provider;
@@ -710,6 +711,16 @@ namespace Bit.Droid.Services
public bool UsingDarkTheme()
{
try
{
if (Build.VERSION.SdkInt >= BuildVersionCodes.Q)
{
var app = CrossCurrentActivity.Current.AppContext;
var uiModeFlags = app.Resources.Configuration.UiMode & UiMode.NightMask;
return uiModeFlags == UiMode.NightYes;
}
}
catch { }
return false;
}