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,10 +31,22 @@ namespace Bit.App.Utilities
{
Application.Current.Resources.MergedDictionaries.Add(new Nord());
}
else if(name == "light")
{
Application.Current.Resources.MergedDictionaries.Add(new Nord());
}
else
{
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
Application.Current.Resources.MergedDictionaries.Add(new Base());

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)