1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-05 10:03:26 +00:00

generator tile and icon size adjustments

This commit is contained in:
Kyle Spearrin
2019-06-05 16:37:54 -04:00
parent a1a5d3b363
commit e0c52dea3a
26 changed files with 170 additions and 31 deletions

View File

@@ -122,6 +122,28 @@ namespace Bit.App
await Task.Delay(1000);
await SetMainPageAsync();
}
else if(message.Command == "popAllAndGoToTabGenerator" ||
message.Command == "popAllAndGoToTabMyVault")
{
Device.BeginInvokeOnMainThread(async () =>
{
if(Current.MainPage is TabsPage tabsPage)
{
while(tabsPage.Navigation.ModalStack.Count > 0)
{
await tabsPage.Navigation.PopModalAsync(false);
}
if(message.Command == "popAllAndGoToTabMyVault")
{
tabsPage.ResetToVaultPage();
}
else
{
tabsPage.ResetToGeneratorPage();
}
}
});
}
});
}
@@ -214,7 +236,7 @@ namespace Bit.App
}
else
{
Current.MainPage = new TabsPage();
Current.MainPage = new TabsPage(_appOptions);
}
}
else

View File

@@ -5,6 +5,7 @@ namespace Bit.App.Models
public class AppOptions
{
public bool MyVaultTile { get; set; }
public bool GeneratorTile { get; set; }
public bool FromAutofillFramework { get; set; }
public CipherType? FillType { get; set; }
public string Uri { get; set; }

View File

@@ -1,5 +1,8 @@
using Bit.App.Effect;
using Bit.App.Models;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using Xamarin.Forms;
namespace Bit.App.Pages
@@ -7,8 +10,9 @@ namespace Bit.App.Pages
public class TabsPage : TabbedPage
{
private NavigationPage _groupingsPage;
private NavigationPage _generatorPage;
public TabsPage()
public TabsPage(AppOptions appOptions = null)
{
_groupingsPage = new NavigationPage(new GroupingsPage(true))
{
@@ -17,12 +21,12 @@ namespace Bit.App.Pages
};
Children.Add(_groupingsPage);
var generatorPage = new NavigationPage(new GeneratorPage(true, null, this))
_generatorPage = new NavigationPage(new GeneratorPage(true, null, this))
{
Title = AppResources.Generator,
Icon = "refresh.png"
};
Children.Add(generatorPage);
Children.Add(_generatorPage);
var settingsPage = new NavigationPage(new SettingsPage(this))
{
@@ -44,6 +48,12 @@ namespace Bit.App.Pages
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetBarItemColor(this,
(Color)Application.Current.Resources["TabBarItemColor"]);
}
if(appOptions?.GeneratorTile ?? false)
{
appOptions.GeneratorTile = false;
ResetToGeneratorPage();
}
}
public void ResetToVaultPage()
@@ -51,6 +61,11 @@ namespace Bit.App.Pages
CurrentPage = _groupingsPage;
}
public void ResetToGeneratorPage()
{
CurrentPage = _generatorPage;
}
protected async override void OnCurrentPageChanged()
{
if(CurrentPage is NavigationPage navPage)