diff --git a/src/App/Controls/AccountViewCell/AccountViewCell.xaml.cs b/src/App/Controls/AccountViewCell/AccountViewCell.xaml.cs index 573f17ef0..8195b429b 100644 --- a/src/App/Controls/AccountViewCell/AccountViewCell.xaml.cs +++ b/src/App/Controls/AccountViewCell/AccountViewCell.xaml.cs @@ -7,18 +7,18 @@ namespace Bit.App.Controls { public static readonly BindableProperty AccountProperty = BindableProperty.Create( nameof(Account), typeof(AccountView), typeof(AccountViewCell), default(AccountView), BindingMode.OneWay); - + public AccountViewCell() { InitializeComponent(); } - + public AccountView Account { get => GetValue(AccountProperty) as AccountView; set => SetValue(AccountProperty, value); } - + protected override void OnPropertyChanged(string propertyName = null) { base.OnPropertyChanged(propertyName); @@ -33,4 +33,3 @@ namespace Bit.App.Controls } } } - diff --git a/src/App/Controls/AccountViewCell/AccountViewCellViewModel.cs b/src/App/Controls/AccountViewCell/AccountViewCellViewModel.cs index 69e67ca89..d20a8974e 100644 --- a/src/App/Controls/AccountViewCell/AccountViewCellViewModel.cs +++ b/src/App/Controls/AccountViewCell/AccountViewCellViewModel.cs @@ -11,7 +11,7 @@ namespace Bit.App.Controls { AccountView = accountView; } - + public AccountView AccountView { get => _accountView; @@ -22,7 +22,7 @@ namespace Bit.App.Controls { get => AccountView.IsAccount; } - + public string AuthStatusText { get => AccountView.AuthStatus.ToString(); diff --git a/src/App/Controls/AvatarImageSource.cs b/src/App/Controls/AvatarImageSource.cs index 68c323309..202e290df 100644 --- a/src/App/Controls/AvatarImageSource.cs +++ b/src/App/Controls/AvatarImageSource.cs @@ -10,12 +10,12 @@ namespace Bit.App.Controls public class AvatarImageSource : StreamImageSource { private string _data; - + public AvatarImageSource(string data = null) { _data = data; } - + public override Func> Stream => GetStreamAsync; private Task GetStreamAsync(CancellationToken userToken = new CancellationToken()) @@ -31,7 +31,7 @@ namespace Bit.App.Controls { string chars = null; string upperData = null; - + if (string.IsNullOrEmpty(_data)) { chars = ".."; @@ -41,11 +41,11 @@ namespace Bit.App.Controls upperData = _data.ToUpper(); chars = upperData.Substring(0, 2).ToUpper(); } - + var bgColor = StringToColor(upperData); - var textColor = Color.White;; + var textColor = Color.White; var size = 50; - + var bitmap = new SKBitmap( size * 2, size * 2, @@ -84,7 +84,7 @@ namespace Bit.App.Controls return SKImage.FromBitmap(bitmap).Encode(SKEncodedImageFormat.Png, 100).AsStream(); } - + private Color StringToColor(string str) { if (str == null) diff --git a/src/App/Pages/Accounts/HomePage.xaml b/src/App/Pages/Accounts/HomePage.xaml index d57cbbefd..375a9d4e5 100644 --- a/src/App/Pages/Accounts/HomePage.xaml +++ b/src/App/Pages/Accounts/HomePage.xaml @@ -15,6 +15,18 @@ + + - - - ("broadcasterService"); @@ -29,9 +27,9 @@ namespace Bit.App.Pages _vm.StartEnvironmentAction = () => Device.BeginInvokeOnMainThread(async () => await StartEnvironmentAsync()); UpdateLogo(); - if (_appOptions?.IosExtension ?? false) + if (!_appOptions?.IosExtension ?? false) { - ToolbarItems.Add(_closeItem); + ToolbarItems.Remove(_closeItem); } } @@ -44,6 +42,15 @@ namespace Bit.App.Pages protected override async void OnAppearing() { base.OnAppearing(); + _mainContent.Content = _mainLayout; + if (await HasMultipleAccountsAsync()) + { + _vm.AvatarImageSource = await GetAvatarImageSourceAsync(false); + } + else + { + ToolbarItems.Remove(_accountAvatar); + } _broadcasterService.Subscribe(nameof(HomePage), async (message) => { if (message.Command == "updatedTheme") @@ -54,17 +61,6 @@ namespace Bit.App.Pages }); } }); - if (_appeared) - { - return; - } - _appeared = true; - _mainContent.Content = _mainLayout; - if (await HasMultipleAccountsAsync()) - { - ToolbarItems.Add(_accountAvatar); - _vm.AvatarImageSource = await GetAvatarImageSourceAsync(false); - } } protected override void OnDisappearing() diff --git a/src/App/Pages/Accounts/LockPage.xaml b/src/App/Pages/Accounts/LockPage.xaml index 48570ed74..dde114331 100644 --- a/src/App/Pages/Accounts/LockPage.xaml +++ b/src/App/Pages/Accounts/LockPage.xaml @@ -15,10 +15,8 @@ - - - - + + + + + + - - - - - - - + + + + + +