1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-07 09:20:04 +01:00

hide status bar on homepage for ios

This commit is contained in:
Kyle Spearrin 2019-06-26 10:05:31 -04:00
parent b72808ab40
commit 92764eeae0
5 changed files with 41 additions and 10 deletions

View File

@ -1,14 +1,19 @@
using System;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System;
using Xamarin.Forms;
namespace Bit.App.Pages
{
public partial class EnvironmentPage : BaseContentPage
{
private EnvironmentPageViewModel _vm;
private readonly IMessagingService _messagingService;
private readonly EnvironmentPageViewModel _vm;
public EnvironmentPage()
{
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_messagingService.Send("showStatusBar", true);
InitializeComponent();
_vm = BindingContext as EnvironmentPageViewModel;
_vm.Page = this;
@ -33,10 +38,11 @@ namespace Bit.App.Pages
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
private async void Close_Clicked(object sender, EventArgs e)
{
if(DoOnce())
{
_messagingService.Send("showStatusBar", false);
await Navigation.PopModalAsync();
}
}

View File

@ -1,4 +1,6 @@
using Bit.App.Utilities;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
@ -7,8 +9,12 @@ namespace Bit.App.Pages
{
public partial class HomePage : BaseContentPage
{
private IMessagingService _messagingService;
public HomePage()
{
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_messagingService.Send("showStatusBar", false);
InitializeComponent();
var theme = ThemeManager.GetTheme(Device.RuntimePlatform == Device.Android);
var darkbasedTheme = theme == "dark" || theme == "black" || theme == "nord";
@ -21,6 +27,12 @@ namespace Bit.App.Pages
await Navigation.PushModalAsync(new NavigationPage(new LoginPage(email)));
}
protected override void OnAppearing()
{
base.OnAppearing();
_messagingService.Send("showStatusBar", false);
}
private void LogIn_Clicked(object sender, EventArgs e)
{
if(DoOnce())

View File

@ -1,14 +1,19 @@
using System;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System;
using Xamarin.Forms;
namespace Bit.App.Pages
{
public partial class LoginPage : BaseContentPage
{
private LoginPageViewModel _vm;
private readonly IMessagingService _messagingService;
private readonly LoginPageViewModel _vm;
public LoginPage(string email = null)
{
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_messagingService.Send("showStatusBar", true);
InitializeComponent();
_vm = BindingContext as LoginPageViewModel;
_vm.Page = this;
@ -55,10 +60,11 @@ namespace Bit.App.Pages
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
private async void Close_Clicked(object sender, EventArgs e)
{
if(DoOnce())
{
_messagingService.Send("showStatusBar", false);
await Navigation.PopModalAsync();
}
}

View File

@ -1,14 +1,19 @@
using System;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System;
using Xamarin.Forms;
namespace Bit.App.Pages
{
public partial class RegisterPage : BaseContentPage
{
private RegisterPageViewModel _vm;
private readonly IMessagingService _messagingService;
private readonly RegisterPageViewModel _vm;
public RegisterPage(HomePage homePage)
{
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_messagingService.Send("showStatusBar", true);
InitializeComponent();
_vm = BindingContext as RegisterPageViewModel;
_vm.Page = this;
@ -51,10 +56,11 @@ namespace Bit.App.Pages
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
private async void Close_Clicked(object sender, EventArgs e)
{
if(DoOnce())
{
_messagingService.Send("showStatusBar", false);
await Navigation.PopModalAsync();
}
}

View File

@ -80,7 +80,8 @@ namespace Bit.iOS
}
else if(message.Command == "showStatusBar")
{
UIApplication.SharedApplication.SetStatusBarHidden(!(bool)message.Data, false);
Device.BeginInvokeOnMainThread(() =>
UIApplication.SharedApplication.SetStatusBarHidden(!(bool)message.Data, false));
}
else if(message.Command == "syncCompleted")
{