1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-27 12:26:31 +01:00

stub out support for dark theme by default

This commit is contained in:
Kyle Spearrin 2019-09-30 16:41:31 -04:00
parent 41a44548d2
commit b6747a63ed
4 changed files with 27 additions and 2 deletions

View File

@ -612,6 +612,11 @@ namespace Bit.Droid.Services
}
}
public bool UsingDarkTheme()
{
return false;
}
private bool DeleteDir(Java.IO.File dir)
{
if(dir != null && dir.IsDirectory)

View File

@ -35,5 +35,6 @@ namespace Bit.App.Abstractions
string GetBuildNumber();
void OpenAccessibilitySettings();
void OpenAutofillSettings();
bool UsingDarkTheme();
}
}

View File

@ -1,6 +1,8 @@
using Bit.App.Services;
using Bit.App.Abstractions;
using Bit.App.Services;
using Bit.App.Styles;
using Bit.Core;
using Bit.Core.Utilities;
using Xamarin.Forms;
namespace Bit.App.Utilities
@ -29,9 +31,21 @@ namespace Bit.App.Utilities
{
Application.Current.Resources.MergedDictionaries.Add(new Nord());
}
else if(name == "light")
{
Application.Current.Resources.MergedDictionaries.Add(new Nord());
}
else
{
Application.Current.Resources.MergedDictionaries.Add(new Light());
var deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService", true);
if(deviceActionService?.UsingDarkTheme() ?? false)
{
Application.Current.Resources.MergedDictionaries.Add(new Dark());
}
else
{
Application.Current.Resources.MergedDictionaries.Add(new Light());
}
}
// Base styles

View File

@ -351,6 +351,11 @@ namespace Bit.iOS.Core.Services
throw new NotImplementedException();
}
public bool UsingDarkTheme()
{
return false;
}
private void ImagePicker_FinishedPickingMedia(object sender, UIImagePickerMediaPickedEventArgs e)
{
if(sender is UIImagePickerController picker)