mirror of
https://github.com/bitwarden/mobile
synced 2025-12-29 06:33:53 +00:00
Dynamic theme switching and visual tweaks (#1556)
* Dynamic theme switching and visual tweaks * update action runner to use macos-11 for iOS 15 support * additional tweaks * refinements * refinements * formatting and tweaks
This commit is contained in:
@@ -42,7 +42,6 @@ namespace Bit.App.Abstractions
|
||||
void OpenAccessibilitySettings();
|
||||
void OpenAccessibilityOverlayPermissionSettings();
|
||||
void OpenAutofillSettings();
|
||||
bool UsingDarkTheme();
|
||||
long GetActiveTime();
|
||||
void CloseMainApp();
|
||||
bool SupportsFido2();
|
||||
|
||||
@@ -200,6 +200,7 @@ namespace Bit.App
|
||||
|
||||
private async void ResumedAsync()
|
||||
{
|
||||
UpdateTheme();
|
||||
await _vaultTimeoutService.CheckVaultTimeoutAsync();
|
||||
_messagingService.Send("startEventTimer");
|
||||
await ClearCacheIfNeededAsync();
|
||||
@@ -337,6 +338,10 @@ namespace Bit.App
|
||||
InitializeComponent();
|
||||
SetCulture();
|
||||
ThemeManager.SetTheme(Device.RuntimePlatform == Device.Android, Current.Resources);
|
||||
Current.RequestedThemeChanged += (s, a) =>
|
||||
{
|
||||
UpdateTheme();
|
||||
};
|
||||
Current.MainPage = new HomePage();
|
||||
var mainPageTask = SetMainPageAsync();
|
||||
ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init();
|
||||
@@ -359,6 +364,15 @@ namespace Bit.App
|
||||
});
|
||||
}
|
||||
|
||||
private void UpdateTheme()
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
ThemeManager.SetTheme(Device.RuntimePlatform == Device.Android, Current.Resources);
|
||||
_messagingService.Send("updatedTheme");
|
||||
});
|
||||
}
|
||||
|
||||
private async Task LockedAsync(bool autoPromptBiometric)
|
||||
{
|
||||
await _stateService.PurgeAsync();
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Bit.App.Controls
|
||||
public class ExtendedSlider : Slider
|
||||
{
|
||||
public static readonly BindableProperty ThumbBorderColorProperty = BindableProperty.Create(
|
||||
nameof(ThumbBorderColor), typeof(Color), typeof(ExtendedSlider), Color.Gray);
|
||||
nameof(ThumbBorderColor), typeof(Color), typeof(ExtendedSlider), Color.Default);
|
||||
|
||||
public Color ThumbBorderColor
|
||||
{
|
||||
|
||||
25
src/App/Controls/ExtendedStepper.cs
Normal file
25
src/App/Controls/ExtendedStepper.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class ExtendedStepper : Stepper
|
||||
{
|
||||
public static readonly BindableProperty StepperBackgroundColorProperty = BindableProperty.Create(
|
||||
nameof(StepperBackgroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default);
|
||||
|
||||
public static readonly BindableProperty StepperForegroundColorProperty = BindableProperty.Create(
|
||||
nameof(StepperForegroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default);
|
||||
|
||||
public Color StepperBackgroundColor
|
||||
{
|
||||
get => (Color)GetValue(StepperBackgroundColorProperty);
|
||||
set => SetValue(StepperBackgroundColorProperty, value);
|
||||
}
|
||||
|
||||
public Color StepperForegroundColor
|
||||
{
|
||||
get => (Color)GetValue(StepperForegroundColorProperty);
|
||||
set => SetValue(StepperForegroundColorProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,11 +40,12 @@
|
||||
HorizontalTextAlignment="Center"></Label>
|
||||
<StackLayout Spacing="5">
|
||||
<Button Text="{u:I18n LogIn}"
|
||||
Clicked="LogIn_Clicked"></Button>
|
||||
StyleClass="btn-primary"
|
||||
Clicked="LogIn_Clicked" />
|
||||
<Button Text="{u:I18n CreateAccount}"
|
||||
Clicked="Register_Clicked"></Button>
|
||||
Clicked="Register_Clicked" />
|
||||
<Button Text="{u:I18n LogInSso}"
|
||||
Clicked="LogInSso_Clicked"></Button>
|
||||
Clicked="LogInSso_Clicked" />
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
|
||||
@@ -13,11 +13,13 @@ namespace Bit.App.Pages
|
||||
private readonly HomeViewModel _vm;
|
||||
private readonly AppOptions _appOptions;
|
||||
private IMessagingService _messagingService;
|
||||
private IBroadcasterService _broadcasterService;
|
||||
|
||||
public HomePage(AppOptions appOptions = null)
|
||||
{
|
||||
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
||||
_messagingService.Send("showStatusBar", false);
|
||||
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
|
||||
_appOptions = appOptions;
|
||||
InitializeComponent();
|
||||
_vm = BindingContext as HomeViewModel;
|
||||
@@ -26,7 +28,7 @@ namespace Bit.App.Pages
|
||||
_vm.StartRegisterAction = () => Device.BeginInvokeOnMainThread(async () => await StartRegisterAsync());
|
||||
_vm.StartSsoLoginAction = () => Device.BeginInvokeOnMainThread(async () => await StartSsoLoginAsync());
|
||||
_vm.StartEnvironmentAction = () => Device.BeginInvokeOnMainThread(async () => await StartEnvironmentAsync());
|
||||
_logo.Source = !ThemeManager.UsingLightTheme ? "logo_white.png" : "logo.png";
|
||||
UpdateLogo();
|
||||
}
|
||||
|
||||
public async Task DismissRegisterPageAndLogInAsync(string email)
|
||||
@@ -39,6 +41,27 @@ namespace Bit.App.Pages
|
||||
{
|
||||
base.OnAppearing();
|
||||
_messagingService.Send("showStatusBar", false);
|
||||
_broadcasterService.Subscribe(nameof(HomePage), async (message) =>
|
||||
{
|
||||
if (message.Command == "updatedTheme")
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
UpdateLogo();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnDisappearing()
|
||||
{
|
||||
base.OnDisappearing();
|
||||
_broadcasterService.Unsubscribe(nameof(HomePage));
|
||||
}
|
||||
|
||||
private void UpdateLogo()
|
||||
{
|
||||
_logo.Source = !ThemeManager.UsingLightTheme ? "logo_white.png" : "logo.png";
|
||||
}
|
||||
|
||||
private void Close_Clicked(object sender, EventArgs e)
|
||||
|
||||
@@ -120,7 +120,9 @@
|
||||
IsVisible="{Binding BiometricIntegrityValid, Converter={StaticResource inverseBool}}" />
|
||||
<Button Text="{Binding BiometricButtonText}" Clicked="Biometric_Clicked"
|
||||
IsVisible="{Binding BiometricButtonVisible}"></Button>
|
||||
<Button Text="{u:I18n Unlock}" Clicked="Unlock_Clicked"></Button>
|
||||
<Button Text="{u:I18n Unlock}"
|
||||
StyleClass="btn-primary"
|
||||
Clicked="Unlock_Clicked" />
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -82,7 +82,9 @@
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
<StackLayout Padding="10, 0">
|
||||
<Button Text="{u:I18n LogIn}" Clicked="LogIn_Clicked" />
|
||||
<Button Text="{u:I18n LogIn}"
|
||||
StyleClass="btn-primary"
|
||||
Clicked="LogIn_Clicked" />
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
</StackLayout>
|
||||
<StackLayout Padding="10, 0">
|
||||
<Button Text="{u:I18n LogIn}"
|
||||
Clicked="LogIn_Clicked"></Button>
|
||||
StyleClass="btn-primary"
|
||||
Clicked="LogIn_Clicked"></Button>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -4,6 +4,7 @@ using Bit.Core.Utilities;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Abstractions;
|
||||
using Bit.App.Utilities;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.PlatformConfiguration;
|
||||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||
@@ -52,7 +53,8 @@ namespace Bit.App.Pages
|
||||
{
|
||||
IsRunning = true,
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
HorizontalOptions = LayoutOptions.Center
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
Color = ThemeManager.GetResourceColor("PrimaryColor"),
|
||||
};
|
||||
if (targetView != null)
|
||||
{
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
HorizontalOptions="CenterAndExpand"
|
||||
LineBreakMode="CharacterWrap" />
|
||||
<Button Text="{u:I18n RegeneratePassword}"
|
||||
StyleClass="btn-primary"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
Clicked="Regenerate_Clicked"></Button>
|
||||
<Button Text="{u:I18n CopyPassword}"
|
||||
@@ -108,7 +109,7 @@
|
||||
HorizontalTextAlignment="End"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalTextAlignment="Center" />
|
||||
<Stepper
|
||||
<controls:ExtendedStepper
|
||||
Value="{Binding NumWords}"
|
||||
Maximum="20"
|
||||
Minimum="3"
|
||||
@@ -239,7 +240,7 @@
|
||||
HorizontalTextAlignment="End"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalTextAlignment="Center" />
|
||||
<Stepper
|
||||
<controls:ExtendedStepper
|
||||
Value="{Binding MinNumber}"
|
||||
Maximum="5"
|
||||
Minimum="0"
|
||||
@@ -259,7 +260,7 @@
|
||||
HorizontalTextAlignment="End"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalTextAlignment="Center" />
|
||||
<Stepper
|
||||
<controls:ExtendedStepper
|
||||
Value="{Binding MinSpecial}"
|
||||
Maximum="5"
|
||||
Minimum="0"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Bit.App.Resources;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Abstractions;
|
||||
using Bit.Core.Utilities;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.PlatformConfiguration;
|
||||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||
@@ -9,6 +11,8 @@ namespace Bit.App.Pages
|
||||
{
|
||||
public partial class GeneratorPage : BaseContentPage
|
||||
{
|
||||
private readonly IBroadcasterService _broadcasterService;
|
||||
|
||||
private GeneratorPageViewModel _vm;
|
||||
private readonly bool _fromTabPage;
|
||||
private readonly Action<string> _selectAction;
|
||||
@@ -18,6 +22,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
_tabsPage = tabsPage;
|
||||
InitializeComponent();
|
||||
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
|
||||
_vm = BindingContext as GeneratorPageViewModel;
|
||||
_vm.Page = this;
|
||||
_fromTabPage = fromTabPage;
|
||||
@@ -60,6 +65,22 @@ namespace Bit.App.Pages
|
||||
{
|
||||
await InitAsync();
|
||||
}
|
||||
_broadcasterService.Subscribe(nameof(GeneratorPage), async (message) =>
|
||||
{
|
||||
if (message.Command == "updatedTheme")
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
_vm.RedrawPassword();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnDisappearing()
|
||||
{
|
||||
base.OnDisappearing();
|
||||
_broadcasterService.Unsubscribe(nameof(GeneratorPage));
|
||||
}
|
||||
|
||||
protected override bool OnBackButtonPressed()
|
||||
|
||||
@@ -262,6 +262,14 @@ namespace Bit.App.Pages
|
||||
await _passwordGenerationService.AddHistoryAsync(Password);
|
||||
}
|
||||
|
||||
public void RedrawPassword()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_password))
|
||||
{
|
||||
TriggerPropertyChanged(nameof(ColoredPassword));
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SaveOptionsAsync(bool regenerate = true)
|
||||
{
|
||||
if (!_doneIniting)
|
||||
|
||||
@@ -54,26 +54,6 @@
|
||||
x:Name="_deleteItem"
|
||||
x:Key="deleteItem" />
|
||||
|
||||
<Style x:Key="segmentedButtonBase" TargetType="Button">
|
||||
<Setter Property="HeightRequest" Value="{Binding SegmentedButtonHeight}" />
|
||||
<Setter Property="FontSize" Value="{Binding SegmentedButtonFontSize}" />
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
</Style>
|
||||
<Style x:Key="segmentedButtonNormal" BaseResourceKey="segmentedButtonBase" TargetType="Button">
|
||||
<Setter Property="TextColor" Value="{StaticResource PrimaryColor}" />
|
||||
<Setter Property="FontAttributes" Value="None" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="BorderColor" Value="{StaticResource PrimaryColor}" />
|
||||
<Setter Property="BorderWidth" Value="1" />
|
||||
|
||||
</Style>
|
||||
<Style x:Key="segmentedButtonDisabled" BaseResourceKey="segmentedButtonBase" TargetType="Button">
|
||||
<Setter Property="TextColor" Value="{StaticResource TitleTextColor}" />
|
||||
<Setter Property="FontAttributes" Value="Bold" />
|
||||
<Setter Property="BackgroundColor" Value="{StaticResource PrimaryColor}" />
|
||||
<Setter Property="BorderWidth" Value="0" />
|
||||
</Style>
|
||||
|
||||
<ScrollView x:Key="scrollView" x:Name="_scrollView">
|
||||
<StackLayout Spacing="20">
|
||||
<StackLayout StyleClass="box">
|
||||
@@ -131,51 +111,25 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
Text="{u:I18n TypeFile}"
|
||||
StyleClass="segmented-button"
|
||||
IsEnabled="{Binding IsText}"
|
||||
HeightRequest="{Binding SegmentedButtonHeight}"
|
||||
FontSize="{Binding SegmentedButtonFontSize}"
|
||||
Clicked="FileType_Clicked"
|
||||
AutomationProperties.IsInAccessibleTree="True"
|
||||
AutomationProperties.Name="{u:I18n File}"
|
||||
Grid.Column="0">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="Style"
|
||||
Value="{StaticResource segmentedButtonNormal}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="Style"
|
||||
Value="{StaticResource segmentedButtonDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Button>
|
||||
<Button
|
||||
Text="{u:I18n TypeText}"
|
||||
StyleClass="segmented-button"
|
||||
IsEnabled="{Binding IsFile}"
|
||||
HeightRequest="{Binding SegmentedButtonHeight}"
|
||||
FontSize="{Binding SegmentedButtonFontSize}"
|
||||
Clicked="TextType_Clicked"
|
||||
AutomationProperties.IsInAccessibleTree="True"
|
||||
AutomationProperties.Name="{u:I18n Text}"
|
||||
Grid.Column="1">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="Style"
|
||||
Value="{StaticResource segmentedButtonNormal}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="Style"
|
||||
Value="{StaticResource segmentedButtonDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Button>
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
@@ -289,20 +243,20 @@
|
||||
Text="{u:I18n Options}"
|
||||
x:Name="_btnOptions"
|
||||
StyleClass="box-row-button"
|
||||
TextColor="{StaticResource PrimaryColor}"
|
||||
TextColor="{DynamicResource PrimaryColor}"
|
||||
Margin="0" />
|
||||
<controls:FaButton
|
||||
x:Name="_btnOptionsUp"
|
||||
Text=""
|
||||
StyleClass="box-row-button"
|
||||
TextColor="{StaticResource PrimaryColor}"
|
||||
TextColor="{DynamicResource PrimaryColor}"
|
||||
Clicked="ToggleOptions_Clicked"
|
||||
IsVisible="False" />
|
||||
<controls:FaButton
|
||||
x:Name="_btnOptionsDown"
|
||||
Text=""
|
||||
StyleClass="box-row-button"
|
||||
TextColor="{StaticResource PrimaryColor}"
|
||||
TextColor="{DynamicResource PrimaryColor}"
|
||||
Clicked="ToggleOptions_Clicked"
|
||||
IsVisible="False" />
|
||||
</StackLayout>
|
||||
@@ -421,7 +375,7 @@
|
||||
MaxLength="9"
|
||||
TextChanged="OnMaxAccessCountTextChanged"
|
||||
HorizontalOptions="FillAndExpand" />
|
||||
<Stepper
|
||||
<controls:ExtendedStepper
|
||||
x:Name="_maxAccessCountStepper"
|
||||
Value="{Binding MaxAccessCount}"
|
||||
Maximum="999999999"
|
||||
|
||||
@@ -61,7 +61,6 @@ namespace Bit.App.Pages
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
await _vm.InitAsync();
|
||||
if (_syncService.SyncInProgress)
|
||||
{
|
||||
IsBusy = true;
|
||||
|
||||
@@ -110,11 +110,6 @@ namespace Bit.App.Pages
|
||||
public Command<SendView> SendOptionsCommand { get; set; }
|
||||
public bool LoadedOnce { get; set; }
|
||||
|
||||
public async Task InitAsync()
|
||||
{
|
||||
SendEnabled = ! await AppHelpers.IsSendDisabledByPolicyAsync();
|
||||
}
|
||||
|
||||
public async Task LoadAsync()
|
||||
{
|
||||
if (_doingLoad)
|
||||
@@ -142,6 +137,7 @@ namespace Bit.App.Pages
|
||||
ShowNoData = false;
|
||||
Loading = true;
|
||||
ShowList = false;
|
||||
SendEnabled = ! await AppHelpers.IsSendDisabledByPolicyAsync();
|
||||
var groupedSends = new List<SendGroupingsPageListGroup>();
|
||||
var page = Page as SendGroupingsPage;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
HorizontalOptions="End" />
|
||||
<Button
|
||||
Clicked="ToggleAutofillService"
|
||||
BackgroundColor="Transparent"
|
||||
StyleClass="box-overlay"
|
||||
RelativeLayout.XConstraint="0"
|
||||
RelativeLayout.YConstraint="0"
|
||||
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=AutofillServiceSwitch, Property=Width}"
|
||||
@@ -58,8 +58,7 @@
|
||||
HorizontalOptions="End" />
|
||||
<Button
|
||||
Clicked="ToggleInlineAutofill"
|
||||
IsEnabled="{Binding InlineAutofillEnabled}"
|
||||
BackgroundColor="Transparent"
|
||||
StyleClass="box-overlay"
|
||||
RelativeLayout.XConstraint="0"
|
||||
RelativeLayout.YConstraint="0"
|
||||
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=InlineAutofillSwitch, Property=Width}"
|
||||
@@ -85,7 +84,7 @@
|
||||
HorizontalOptions="End" />
|
||||
<Button
|
||||
Clicked="ToggleAccessibility"
|
||||
BackgroundColor="Transparent"
|
||||
StyleClass="box-overlay"
|
||||
RelativeLayout.XConstraint="0"
|
||||
RelativeLayout.YConstraint="0"
|
||||
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=AccessibilitySwitch, Property=Width}"
|
||||
@@ -114,8 +113,7 @@
|
||||
HorizontalOptions="End" />
|
||||
<Button
|
||||
Clicked="ToggleDrawOver"
|
||||
IsEnabled="{Binding DrawOverEnabled}"
|
||||
BackgroundColor="Transparent"
|
||||
StyleClass="box-overlay"
|
||||
RelativeLayout.XConstraint="0"
|
||||
RelativeLayout.YConstraint="0"
|
||||
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=DrawOverSwitch, Property=Width}"
|
||||
|
||||
@@ -170,6 +170,10 @@ namespace Bit.App.Pages
|
||||
|
||||
public void ToggleInlineAutofill()
|
||||
{
|
||||
if (!InlineAutofillEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
InlineAutofillToggled = !InlineAutofillToggled;
|
||||
}
|
||||
|
||||
@@ -180,6 +184,10 @@ namespace Bit.App.Pages
|
||||
|
||||
public void ToggleDrawOver()
|
||||
{
|
||||
if (!DrawOverEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_deviceActionService.OpenAccessibilityOverlayPermissionSettings();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
</StackLayout>
|
||||
<Label
|
||||
StyleClass="box-footer-label"
|
||||
Text="{u:I18n ThemeDescription}"
|
||||
x:Name="_themeDescriptionLabel" />
|
||||
Text="{u:I18n ThemeDescription}" />
|
||||
</StackLayout>
|
||||
<StackLayout StyleClass="box">
|
||||
<StackLayout StyleClass="box-row, box-row-input, box-row-input-options-platform">
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace Bit.App.Pages
|
||||
{
|
||||
ToolbarItems.RemoveAt(0);
|
||||
_vm.ShowAndroidAutofillSettings = _deviceActionService.SupportsAutofillService();
|
||||
_themeDescriptionLabel.Text = string.Concat(_themeDescriptionLabel.Text, " ",
|
||||
AppResources.RestartIsRequired);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Bit.App.Pages
|
||||
}
|
||||
ThemeOptions = new List<KeyValuePair<string, string>>
|
||||
{
|
||||
new KeyValuePair<string, string>(null, AppResources.Default),
|
||||
new KeyValuePair<string, string>(null, AppResources.ThemeDefault),
|
||||
new KeyValuePair<string, string>("light", AppResources.Light),
|
||||
new KeyValuePair<string, string>("dark", AppResources.Dark),
|
||||
new KeyValuePair<string, string>("black", AppResources.Black),
|
||||
@@ -215,17 +215,8 @@ namespace Bit.App.Pages
|
||||
{
|
||||
var theme = ThemeOptions[ThemeSelectedIndex].Key;
|
||||
await _storageService.SaveAsync(Constants.ThemeKey, theme);
|
||||
if (Device.RuntimePlatform == Device.Android)
|
||||
{
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Restarting);
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
_messagingService.Send("updatedTheme", theme);
|
||||
if (Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
await _platformUtilsService.ShowDialogAsync(AppResources.ThemeAppliedOnRestart);
|
||||
}
|
||||
ThemeManager.SetTheme(Device.RuntimePlatform == Device.Android, Application.Current.Resources);
|
||||
_messagingService.Send("updatedTheme");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
using Bit.App.Effects;
|
||||
using Bit.App.Models;
|
||||
using Bit.App.Resources;
|
||||
using Bit.Core.Abstractions;
|
||||
using Bit.Core.Utilities;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
public class TabsPage : TabbedPage
|
||||
{
|
||||
private readonly IMessagingService _messagingService;
|
||||
|
||||
private NavigationPage _groupingsPage;
|
||||
private NavigationPage _sendGroupingsPage;
|
||||
private NavigationPage _generatorPage;
|
||||
|
||||
public TabsPage(AppOptions appOptions = null, PreviousPageInfo previousPage = null)
|
||||
{
|
||||
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
||||
|
||||
_groupingsPage = new NavigationPage(new GroupingsPage(true, previousPage: previousPage))
|
||||
{
|
||||
Title = AppResources.MyVault,
|
||||
@@ -85,6 +91,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
if (CurrentPage is NavigationPage navPage)
|
||||
{
|
||||
_messagingService.Send("updatedTheme");
|
||||
if (navPage.RootPage is GroupingsPage groupingsPage)
|
||||
{
|
||||
// Load something?
|
||||
|
||||
@@ -563,7 +563,7 @@
|
||||
StyleClass="box-row-button, box-row-button-platform"
|
||||
Text=""
|
||||
Command="{Binding PasswordPromptHelpCommand}"
|
||||
TextColor="{StaticResource MutedColor}"
|
||||
TextColor="{DynamicResource MutedColor}"
|
||||
AutomationProperties.IsInAccessibleTree="True"
|
||||
AutomationProperties.Name="{u:I18n ToggleVisibility}"
|
||||
HorizontalOptions="StartAndExpand" />
|
||||
|
||||
7991
src/App/Resources/AppResources.Designer.cs
generated
7991
src/App/Resources/AppResources.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1510,12 +1510,8 @@
|
||||
<data name="ThemeDescription" xml:space="preserve">
|
||||
<value>Change the application's color theme.</value>
|
||||
</data>
|
||||
<data name="RestartIsRequired" xml:space="preserve">
|
||||
<value>Restart is required.</value>
|
||||
<comment>Referring to restarting the application.</comment>
|
||||
</data>
|
||||
<data name="Restarting" xml:space="preserve">
|
||||
<value>Restarting...</value>
|
||||
<data name="ThemeDefault" xml:space="preserve">
|
||||
<value>Default (System)</value>
|
||||
</data>
|
||||
<data name="CopyNotes" xml:space="preserve">
|
||||
<value>Copy Notes</value>
|
||||
|
||||
@@ -6,46 +6,151 @@
|
||||
<Style TargetType="Entry"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="PlaceholderColor"
|
||||
Value="{StaticResource InputPlaceholderColor}" />
|
||||
Value="{DynamicResource InputPlaceholderColor}" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="Margin"
|
||||
Value="-4, 0, -4, -4" />
|
||||
</Style>
|
||||
<Style TargetType="Picker"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="Margin"
|
||||
Value="-4, 0, -4, -4" />
|
||||
</Style>
|
||||
<Style TargetType="DatePicker"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="TimePicker"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Editor"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="PlaceholderColor"
|
||||
Value="{StaticResource InputPlaceholderColor}" />
|
||||
Value="{DynamicResource InputPlaceholderColor}" />
|
||||
<Setter Property="Margin"
|
||||
Value="-4, 0, -4, -4" />
|
||||
</Style>
|
||||
<Style TargetType="Switch"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="OnColor"
|
||||
Value="{DynamicResource SwitchOnColor}" />
|
||||
</Style>
|
||||
<Style TargetType="SearchBar"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="Transparent" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TitleEntryTextColor}" />
|
||||
Value="{DynamicResource TitleEntryTextColor}" />
|
||||
<Setter Property="CancelButtonColor"
|
||||
Value="{StaticResource TitleEntryTextColor}" />
|
||||
Value="{DynamicResource TitleEntryTextColor}" />
|
||||
<Setter Property="PlaceholderColor"
|
||||
Value="{StaticResource TitleEntryPlaceholderColor}" />
|
||||
Value="{DynamicResource TitleEntryPlaceholderColor}" />
|
||||
</Style>
|
||||
<Style TargetType="ContentPage"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="controls:ExtendedSlider">
|
||||
<Setter Property="MinimumTrackColor"
|
||||
Value="{StaticResource SliderTrackMinColor}" />
|
||||
Value="{DynamicResource SliderTrackMinColor}" />
|
||||
<Setter Property="MaximumTrackColor"
|
||||
Value="{StaticResource SliderTrackMinColor}" />
|
||||
Value="{DynamicResource SliderTrackMinColor}" />
|
||||
<Setter Property="ThumbColor"
|
||||
Value="{StaticResource SliderThumbColor}" />
|
||||
Value="{DynamicResource SliderThumbColor}" />
|
||||
<Setter Property="ThumbBorderColor"
|
||||
Value="{StaticResource SliderThumbBorderColor}" />
|
||||
Value="{DynamicResource SliderThumbBorderColor}" />
|
||||
</Style>
|
||||
<Style TargetType="controls:ExtendedStepper">
|
||||
<Setter Property="StepperBackgroundColor"
|
||||
Value="{DynamicResource StepperBackgroundColor}" />
|
||||
<Setter Property="StepperForegroundColor"
|
||||
Value="{DynamicResource StepperForegroundColor}" />
|
||||
</Style>
|
||||
|
||||
<!-- Buttons -->
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource ButtonBackgroundColor}" />
|
||||
<Setter Property="BorderColor"
|
||||
Value="{DynamicResource ButtonBorderColor}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="1" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource ButtonTextColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="18" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="5" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 5, 0, 0" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource ButtonBackgroundColorDisabled}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource ButtonTextColorDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
Class="btn-primary">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="BorderColor"
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="1" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource ButtonPrimaryTextColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="18" />
|
||||
<Setter Property="FontAttributes"
|
||||
Value="Bold" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="5" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 5, 0, 0" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource ButtonPrimaryTextColorDisabled}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource ButtonPrimaryBackgroundColorDisabled}" />
|
||||
<Setter Property="BorderColor"
|
||||
Value="{DynamicResource ButtonPrimaryBackgroundColorDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
ApplyToDerivedTypes="True"
|
||||
Class="btn-icon-platform">
|
||||
@@ -84,7 +189,7 @@
|
||||
<Style TargetType="Label"
|
||||
Class="list-header-platform">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource ListHeaderTextColor}" />
|
||||
Value="{DynamicResource ListHeaderTextColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="FontAttributes"
|
||||
@@ -93,7 +198,7 @@
|
||||
<Style TargetType="BoxView"
|
||||
Class="list-section-separator-top-platform">
|
||||
<Setter Property="Color"
|
||||
Value="{StaticResource ListItemBorderColor}" />
|
||||
Value="{DynamicResource ListItemBorderColor}" />
|
||||
</Style>
|
||||
<Style TargetType="BoxView"
|
||||
Class="list-section-separator-bottom-platform">
|
||||
@@ -134,7 +239,7 @@
|
||||
<Style TargetType="Label"
|
||||
Class="box-header-platform">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource BoxHeaderTextColor}" />
|
||||
Value="{DynamicResource BoxHeaderTextColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="FontAttributes"
|
||||
|
||||
@@ -10,38 +10,38 @@
|
||||
<Setter Property="FontSize"
|
||||
Value="Medium" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
x:Key="text-default">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="text-default">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="text-muted"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
x:Key="text-danger">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource DangerColor}" />
|
||||
Value="{DynamicResource DangerColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="text-danger">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource DangerColor}" />
|
||||
Value="{DynamicResource DangerColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="text-success">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource SuccessColor}" />
|
||||
Value="{DynamicResource SuccessColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="text-sm">
|
||||
@@ -64,18 +64,18 @@
|
||||
<Style TargetType="TabbedPage"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BarBackgroundColor"
|
||||
Value="{StaticResource TabBarBackgroundColor}" />
|
||||
Value="{DynamicResource TabBarBackgroundColor}" />
|
||||
<Setter Property="SelectedTabColor"
|
||||
Value="{StaticResource TabBarSelectedItemColor}" />
|
||||
Value="{DynamicResource TabBarSelectedItemColor}" />
|
||||
<Setter Property="UnselectedTabColor"
|
||||
Value="{StaticResource TabBarItemColor}" />
|
||||
Value="{DynamicResource TabBarItemColor}" />
|
||||
</Style>
|
||||
<Style TargetType="NavigationPage"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BarTextColor"
|
||||
Value="{StaticResource NavigationBarTextColor}" />
|
||||
Value="{DynamicResource NavigationBarTextColor}" />
|
||||
<Setter Property="BarBackgroundColor"
|
||||
Value="{StaticResource NavigationBarBackgroundColor}" />
|
||||
Value="{DynamicResource NavigationBarBackgroundColor}" />
|
||||
</Style>
|
||||
|
||||
<!-- Buttons -->
|
||||
@@ -89,13 +89,13 @@
|
||||
Class="btn-muted"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
Class="btn-disabled"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource DisabledIconColor}" />
|
||||
Value="{DynamicResource DisabledIconColor}" />
|
||||
</Style>
|
||||
<Style x:Key="btn-fab" TargetType="Button">
|
||||
<Setter Property="HeightRequest"
|
||||
@@ -110,6 +110,10 @@
|
||||
Value="16" />
|
||||
<Setter Property="Margin"
|
||||
Value="16" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="100" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource FabColor}" />
|
||||
</Style>
|
||||
|
||||
<!-- Title -->
|
||||
@@ -121,7 +125,7 @@
|
||||
<Setter Property="Padding"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TitleTextColor}" />
|
||||
Value="{DynamicResource TitleTextColor}" />
|
||||
</Style>
|
||||
|
||||
<!-- List -->
|
||||
@@ -151,7 +155,7 @@
|
||||
<Setter Property="VerticalTextAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
<Setter Property="HorizontalOptions"
|
||||
Value="End" />
|
||||
<Setter Property="VerticalOptions"
|
||||
@@ -200,7 +204,7 @@
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
ApplyToDerivedTypes="True"
|
||||
@@ -208,14 +212,14 @@
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="list-subtitle">
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="list-icon"
|
||||
@@ -229,7 +233,7 @@
|
||||
<Setter Property="VerticalTextAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
ApplyToDerivedTypes="True"
|
||||
@@ -239,7 +243,42 @@
|
||||
<Setter Property="Padding"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource ButtonColor}" />
|
||||
Value="{DynamicResource ButtonColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
ApplyToDerivedTypes="True"
|
||||
Class="segmented-button">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderColor"
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="1" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="FontAttributes"
|
||||
Value="None" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TitleTextColor}" />
|
||||
<Setter Property="FontAttributes"
|
||||
Value="Bold" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Box -->
|
||||
@@ -316,21 +355,46 @@
|
||||
Class="box-row-button">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="0" />
|
||||
<Setter Property="Padding"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource ButtonColor}" />
|
||||
Value="{DynamicResource ButtonColor}" />
|
||||
<Setter Property="HorizontalOptions"
|
||||
Value="End" />
|
||||
<Setter Property="VerticalOptions"
|
||||
Value="CenterAndExpand" />
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
ApplyToDerivedTypes="True"
|
||||
Class="box-overlay">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="0" />
|
||||
<Setter Property="Padding"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="Transparent" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled" />
|
||||
<VisualState x:Name="Focused" />
|
||||
<VisualState x:Name="Selected" />
|
||||
<VisualState x:Name="Pressed" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="BoxView"
|
||||
Class="box-row-separator">
|
||||
<Setter Property="HeightRequest"
|
||||
Value="1" />
|
||||
<Setter Property="Color"
|
||||
Value="{StaticResource BoxBorderColor}" />
|
||||
Value="{DynamicResource BoxBorderColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="box-label">
|
||||
@@ -339,14 +403,14 @@
|
||||
<Setter Property="FontAttributes"
|
||||
Value="Bold" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="box-label-regular">
|
||||
<Setter Property="FontSize"
|
||||
Value="Medium" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="VerticalOptions"
|
||||
Value="Center" />
|
||||
</Style>
|
||||
@@ -363,14 +427,14 @@
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="box-footer-label">
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="box-footer-label-switch">
|
||||
@@ -382,6 +446,6 @@
|
||||
<Setter Property="FontSize"
|
||||
Value="Medium" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<Color x:Key="SplashBackgroundColor">#000000</Color>
|
||||
<Color x:Key="BorderColor">#282828</Color>
|
||||
<Color x:Key="DisabledIconColor">#c7c7cd</Color>
|
||||
<Color x:Key="SeparatorColor">#282828</Color>
|
||||
<Color x:Key="TouchColor">#52bdfb</Color>
|
||||
|
||||
<Color x:Key="BoxBorderColor">#282828</Color>
|
||||
<Color x:Key="BoxHeaderTextColor">#52bdfb</Color>
|
||||
@@ -38,9 +40,23 @@
|
||||
<Color x:Key="SliderTrackMaxColor">#282828</Color>
|
||||
|
||||
<Color x:Key="SwitchOnColor">#52bdfb</Color>
|
||||
<Color x:Key="SwitchThumbColor">#B9B9B9</Color>
|
||||
|
||||
<Color x:Key="StepperBackgroundColor">#5A595B</Color>
|
||||
<Color x:Key="StepperForegroundColor">#ffffff</Color>
|
||||
|
||||
<Color x:Key="ButtonPrimaryBackgroundColor">#52bdfb</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorPressed">#058AD8</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorDisabled">#777777</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColor">#ffffff</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColorDisabled">#cccccc</Color>
|
||||
|
||||
<Color x:Key="ButtonTextColor">#ffffff</Color>
|
||||
<Color x:Key="ButtonBackgroundColor">#5A595B</Color>
|
||||
<Color x:Key="ButtonBackgroundColorPressed">#414042</Color>
|
||||
<Color x:Key="ButtonBackgroundColorDisabled">#5A595B</Color>
|
||||
<Color x:Key="ButtonBorderColor">#898989</Color>
|
||||
<Color x:Key="ButtonTextColor">#ffffff</Color>
|
||||
<Color x:Key="ButtonTextColorDisabled">#aaaaaa</Color>
|
||||
|
||||
<Color x:Key="FabColor">#52bdfb</Color>
|
||||
<Color x:Key="FabPressedColor">#3ea1da</Color>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<Color x:Key="SplashBackgroundColor">#222222</Color>
|
||||
<Color x:Key="BorderColor">#191919</Color>
|
||||
<Color x:Key="DisabledIconColor">#c7c7cd</Color>
|
||||
<Color x:Key="SeparatorColor">#191919</Color>
|
||||
<Color x:Key="TouchColor">#52bdfb</Color>
|
||||
|
||||
<Color x:Key="BoxBorderColor">#191919</Color>
|
||||
<Color x:Key="BoxHeaderTextColor">#52bdfb</Color>
|
||||
@@ -38,9 +40,23 @@
|
||||
<Color x:Key="SliderTrackMaxColor">#191919</Color>
|
||||
|
||||
<Color x:Key="SwitchOnColor">#52bdfb</Color>
|
||||
<Color x:Key="SwitchThumbColor">#B9B9B9</Color>
|
||||
|
||||
<Color x:Key="StepperBackgroundColor">#5A595B</Color>
|
||||
<Color x:Key="StepperForegroundColor">#ffffff</Color>
|
||||
|
||||
<Color x:Key="ButtonPrimaryBackgroundColor">#52bdfb</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorPressed">#058AD8</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorDisabled">#777777</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColor">#ffffff</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColorDisabled">#cccccc</Color>
|
||||
|
||||
<Color x:Key="ButtonTextColor">#ffffff</Color>
|
||||
<Color x:Key="ButtonBackgroundColor">#5A595B</Color>
|
||||
<Color x:Key="ButtonBackgroundColorPressed">#414042</Color>
|
||||
<Color x:Key="ButtonBackgroundColorDisabled">#5A595B</Color>
|
||||
<Color x:Key="ButtonBorderColor">#898989</Color>
|
||||
<Color x:Key="ButtonTextColor">#ffffff</Color>
|
||||
<Color x:Key="ButtonTextColorDisabled">#aaaaaa</Color>
|
||||
|
||||
<Color x:Key="FabColor">#52bdfb</Color>
|
||||
<Color x:Key="FabPressedColor">#3ea1da</Color>
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
<Color x:Key="InputPlaceholderColor">#d0d0d0</Color>
|
||||
|
||||
<Color x:Key="BackgroundColor">#ffffff</Color>
|
||||
<Color x:Key="SplashBackgroundColor">#efeff4</Color>
|
||||
<Color x:Key="SplashBackgroundColor">#ffffff</Color>
|
||||
<Color x:Key="BorderColor">#dddddd</Color>
|
||||
<Color x:Key="DisabledIconColor">#c7c7cd</Color>
|
||||
<Color x:Key="SeparatorColor">#dddddd</Color>
|
||||
<Color x:Key="TouchColor">#bbbbbb</Color>
|
||||
|
||||
<Color x:Key="BoxBorderColor">#dddddd</Color>
|
||||
<Color x:Key="BoxHeaderTextColor">#175DDC</Color>
|
||||
@@ -38,9 +40,23 @@
|
||||
<Color x:Key="SliderTrackMaxColor">#dddddd</Color>
|
||||
|
||||
<Color x:Key="SwitchOnColor">#175DDC</Color>
|
||||
<Color x:Key="SwitchThumbColor">#ECECEC</Color>
|
||||
|
||||
<Color x:Key="StepperBackgroundColor">#eeeeee</Color>
|
||||
<Color x:Key="StepperForegroundColor">#000000</Color>
|
||||
|
||||
<Color x:Key="ButtonPrimaryBackgroundColor">#175DDC</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorPressed">#1249AC</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorDisabled">#bbbbbb</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColor">#ffffff</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColorDisabled">#ffffff</Color>
|
||||
|
||||
<Color x:Key="ButtonBackgroundColor">#eeeeee</Color>
|
||||
<Color x:Key="ButtonBackgroundColorPressed">#cccccc</Color>
|
||||
<Color x:Key="ButtonBackgroundColorDisabled">#eeeeee</Color>
|
||||
<Color x:Key="ButtonBorderColor">#aaaaaa</Color>
|
||||
<Color x:Key="ButtonTextColor">#000000</Color>
|
||||
<Color x:Key="ButtonBackgroundColor">#dddddd</Color>
|
||||
<Color x:Key="ButtonTextColorDisabled">#aaaaaa</Color>
|
||||
|
||||
<Color x:Key="FabColor">#175DDC</Color>
|
||||
<Color x:Key="FabPressedColor">#3883af</Color>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<Color x:Key="SplashBackgroundColor">#2e3440</Color>
|
||||
<Color x:Key="BorderColor">#2e3440</Color>
|
||||
<Color x:Key="DisabledIconColor">#d8dee9</Color>
|
||||
<Color x:Key="SeparatorColor">#2e3440</Color>
|
||||
<Color x:Key="TouchColor">#81a1c1</Color>
|
||||
|
||||
<Color x:Key="BoxBorderColor">#2e3440</Color>
|
||||
<Color x:Key="BoxHeaderTextColor">#81a1c1</Color>
|
||||
@@ -38,9 +40,23 @@
|
||||
<Color x:Key="SliderTrackMaxColor">#2e3440</Color>
|
||||
|
||||
<Color x:Key="SwitchOnColor">#81a1c1</Color>
|
||||
<Color x:Key="SwitchThumbColor">#e5e9f0</Color>
|
||||
|
||||
<Color x:Key="StepperBackgroundColor">#4c566a</Color>
|
||||
<Color x:Key="StepperForegroundColor">#e5e9f0</Color>
|
||||
|
||||
<Color x:Key="ButtonPrimaryBackgroundColor">#81a1c1</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorPressed">#4E769E</Color>
|
||||
<Color x:Key="ButtonPrimaryBackgroundColorDisabled">#5C6C7B</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColor">#e5e9f0</Color>
|
||||
<Color x:Key="ButtonPrimaryTextColorDisabled">#ACB5C5</Color>
|
||||
|
||||
<Color x:Key="ButtonTextColor">#e5e9f0</Color>
|
||||
<Color x:Key="ButtonBackgroundColor">#4c566a</Color>
|
||||
<Color x:Key="ButtonBackgroundColorPressed">#3A4251</Color>
|
||||
<Color x:Key="ButtonBackgroundColorDisabled">#454951</Color>
|
||||
<Color x:Key="ButtonBorderColor">#5E6A82</Color>
|
||||
<Color x:Key="ButtonTextColor">#e5e9f0</Color>
|
||||
<Color x:Key="ButtonTextColorDisabled">#aaaaaa</Color>
|
||||
|
||||
<Color x:Key="FabColor">#81a1c1</Color>
|
||||
<Color x:Key="FabPressedColor">#81a1c1</Color>
|
||||
|
||||
@@ -6,84 +6,171 @@
|
||||
<Style TargetType="Entry"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="PlaceholderColor"
|
||||
Value="{StaticResource InputPlaceholderColor}" />
|
||||
Value="{DynamicResource InputPlaceholderColor}" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 5, 0, 12" />
|
||||
</Style>
|
||||
<Style TargetType="Picker"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 5, 0, 12" />
|
||||
</Style>
|
||||
<Style TargetType="DatePicker"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="TimePicker"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="Editor"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource BackgroundColor}" />
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
<Setter Property="PlaceholderColor"
|
||||
Value="{StaticResource InputPlaceholderColor}" />
|
||||
Value="{DynamicResource InputPlaceholderColor}" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 0, 0, 12" />
|
||||
</Style>
|
||||
<Style TargetType="Switch"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="OnColor"
|
||||
Value="{StaticResource SwitchOnColor}" />
|
||||
Value="{DynamicResource SwitchOnColor}" />
|
||||
</Style>
|
||||
<Style TargetType="SearchBar"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource ListHeaderBackgroundColor}" />
|
||||
Value="{DynamicResource ListHeaderBackgroundColor}" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource TextColor}" />
|
||||
Value="{DynamicResource TextColor}" />
|
||||
<Setter Property="CancelButtonColor"
|
||||
Value="{StaticResource PrimaryColor}" />
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="PlaceholderColor"
|
||||
Value="#777777" />
|
||||
</Style>
|
||||
<Style TargetType="ContentPage"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource BackgroundColor}" />
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="CollectionView"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource BackgroundColor}" />
|
||||
Value="{DynamicResource BackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="RefreshView"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="RefreshColor"
|
||||
Value="{StaticResource PrimaryColor}" />
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
</Style>
|
||||
<Style TargetType="ActivityIndicator"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="Color"
|
||||
Value="{StaticResource PrimaryColor}" />
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
</Style>
|
||||
<Style TargetType="controls:ExtendedSlider">
|
||||
<Setter Property="MinimumTrackColor"
|
||||
Value="{StaticResource SliderTrackMinColor}" />
|
||||
Value="{DynamicResource SliderTrackMinColor}" />
|
||||
<Setter Property="MaximumTrackColor"
|
||||
Value="{StaticResource SliderTrackMaxColor}" />
|
||||
Value="{DynamicResource SliderTrackMaxColor}" />
|
||||
<Setter Property="ThumbColor"
|
||||
Value="{StaticResource SliderThumbColor}" />
|
||||
Value="{DynamicResource SliderThumbColor}" />
|
||||
</Style>
|
||||
<Style TargetType="controls:ExtendedStepper">
|
||||
<Setter Property="StepperForegroundColor"
|
||||
Value="{DynamicResource StepperForegroundColor}" />
|
||||
</Style>
|
||||
|
||||
<!-- Buttons -->
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource ButtonBackgroundColor}" />
|
||||
Value="{DynamicResource ButtonBackgroundColor}" />
|
||||
<Setter Property="BorderColor"
|
||||
Value="{DynamicResource ButtonBorderColor}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="1" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource ButtonTextColor}" />
|
||||
Value="{DynamicResource ButtonTextColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="18" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 5, 0, 0" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource ButtonBackgroundColorPressed}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource ButtonBackgroundColorDisabled}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="0" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource ButtonTextColorDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
Class="btn-primary">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="BorderColor"
|
||||
Value="{DynamicResource PrimaryColor}" />
|
||||
<Setter Property="BorderWidth"
|
||||
Value="1" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource ButtonPrimaryTextColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="18" />
|
||||
<Setter Property="FontAttributes"
|
||||
Value="Bold" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 5, 0, 0" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource ButtonPrimaryBackgroundColorPressed}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource ButtonPrimaryTextColorDisabled}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{DynamicResource ButtonPrimaryBackgroundColorDisabled}" />
|
||||
<Setter Property="BorderColor"
|
||||
Value="{DynamicResource ButtonPrimaryBackgroundColorDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
ApplyToDerivedTypes="True"
|
||||
@@ -100,12 +187,12 @@
|
||||
Class="list-item-separator-bottom-platform"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource ListItemBorderColor}" />
|
||||
Value="{DynamicResource ListItemBorderColor}" />
|
||||
</Style>
|
||||
<Style TargetType="StackLayout"
|
||||
Class="list-row-header-container-platform">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource ListHeaderBackgroundColor}" />
|
||||
Value="{DynamicResource ListHeaderBackgroundColor}" />
|
||||
</Style>
|
||||
<Style TargetType="StackLayout"
|
||||
Class="list-row-header-platform">
|
||||
@@ -117,19 +204,19 @@
|
||||
<Style TargetType="Label"
|
||||
Class="list-header-platform">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
Value="{DynamicResource MutedColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
</Style>
|
||||
<Style TargetType="BoxView"
|
||||
Class="list-section-separator-top-platform">
|
||||
<Setter Property="Color"
|
||||
Value="{StaticResource ListSectionBorderColor}" />
|
||||
Value="{DynamicResource ListSectionBorderColor}" />
|
||||
</Style>
|
||||
<Style TargetType="BoxView"
|
||||
Class="list-section-separator-bottom-platform">
|
||||
<Setter Property="Color"
|
||||
Value="{StaticResource ListSectionBorderBottomColor}" />
|
||||
Value="{DynamicResource ListSectionBorderBottomColor}" />
|
||||
</Style>
|
||||
<Style TargetType="StackLayout"
|
||||
Class="list-row-platform">
|
||||
@@ -163,7 +250,7 @@
|
||||
<Style TargetType="Label"
|
||||
Class="box-header-platform">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource BoxHeaderTextColor}" />
|
||||
Value="{DynamicResource BoxHeaderTextColor}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="Small" />
|
||||
<Setter Property="FontAttributes"
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using Bit.App.Abstractions;
|
||||
using Bit.App.Models;
|
||||
using Bit.App.Services;
|
||||
using Bit.App.Styles;
|
||||
using Bit.Core;
|
||||
using Bit.Core.Utilities;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Utilities
|
||||
@@ -47,8 +46,7 @@ namespace Bit.App.Utilities
|
||||
}
|
||||
else
|
||||
{
|
||||
var deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService", true);
|
||||
if (deviceActionService?.UsingDarkTheme() ?? false)
|
||||
if (OsDarkModeEnabled())
|
||||
{
|
||||
resources.MergedDictionaries.Add(new Dark());
|
||||
UsingLightTheme = false;
|
||||
@@ -86,6 +84,17 @@ namespace Bit.App.Utilities
|
||||
!android ? "group.com.8bit.bitwarden" : default(string));
|
||||
}
|
||||
|
||||
public static bool OsDarkModeEnabled()
|
||||
{
|
||||
if (Application.Current == null)
|
||||
{
|
||||
// called from iOS extension
|
||||
var app = new App(new AppOptions { IosExtension = true });
|
||||
return app.RequestedTheme == OSAppTheme.Dark;
|
||||
}
|
||||
return Application.Current.RequestedTheme == OSAppTheme.Dark;
|
||||
}
|
||||
|
||||
public static void ApplyResourcesToPage(ContentPage page)
|
||||
{
|
||||
foreach (var resourceDict in Resources().MergedDictionaries)
|
||||
|
||||
Reference in New Issue
Block a user