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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user