mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-27 17:08:00 +01:00
remove my vault as default page options
This commit is contained in:
parent
b6a4efa7ba
commit
a4a93f0999
@ -250,7 +250,7 @@ namespace Bit.Android
|
||||
var options = new AppOptions
|
||||
{
|
||||
Uri = Intent.GetStringExtra("uri") ?? Intent.GetStringExtra("autofillFrameworkUri"),
|
||||
MyVault = Intent.GetBooleanExtra("myVaultTile", false),
|
||||
MyVaultTile = Intent.GetBooleanExtra("myVaultTile", false),
|
||||
FromAutofillFramework = Intent.GetBooleanExtra("autofillFramework", false)
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,6 @@ namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IAppSettingsService
|
||||
{
|
||||
bool DefaultPageVault { get; set; }
|
||||
bool Locked { get; set; }
|
||||
DateTime LastActivity { get; set; }
|
||||
DateTime LastCacheClear { get; set; }
|
||||
|
@ -78,7 +78,7 @@ namespace Bit.App
|
||||
}
|
||||
else
|
||||
{
|
||||
MainPage = new MainPage(myVault: _options.MyVault);
|
||||
MainPage = new MainPage();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -13,7 +13,6 @@
|
||||
public const string SettingDisableTotpCopy = "setting:disableAutoCopyTotp";
|
||||
public const string AutofillPersistNotification = "setting:persistNotification";
|
||||
public const string AutofillPasswordField = "setting:autofillPasswordField";
|
||||
public const string SettingDefaultPageVault = "setting:defaultPageVault";
|
||||
|
||||
public const string PasswordGeneratorLength = "pwGenerator:length";
|
||||
public const string PasswordGeneratorUppercase = "pwGenerator:uppercase";
|
||||
|
@ -4,7 +4,7 @@ namespace Bit.App.Models
|
||||
{
|
||||
public class AppOptions
|
||||
{
|
||||
public bool MyVault { get; set; }
|
||||
public bool MyVaultTile { get; set; }
|
||||
public bool FromAutofillFramework { get; set; }
|
||||
public CipherType? FillType { get; set; }
|
||||
public string Uri { get; set; }
|
||||
|
@ -8,7 +8,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
public class MainPage : ExtendedTabbedPage
|
||||
{
|
||||
public MainPage(bool myVault = false)
|
||||
public MainPage()
|
||||
{
|
||||
TintColor = Color.FromHex("3c8dbc");
|
||||
|
||||
@ -24,10 +24,7 @@ namespace Bit.App.Pages
|
||||
Children.Add(toolsNavigation);
|
||||
Children.Add(settingsNavigation);
|
||||
|
||||
if(myVault || Resolver.Resolve<IAppSettingsService>().DefaultPageVault)
|
||||
{
|
||||
SelectedItem = vaultNavigation;
|
||||
}
|
||||
SelectedItem = vaultNavigation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ namespace Bit.App.Pages
|
||||
}
|
||||
|
||||
private StackLayout StackLayout { get; set; }
|
||||
private ExtendedSwitchCell DefaultPageVaultCell { get; set; }
|
||||
private Label DefaultPageVaultLabel { get; set; }
|
||||
private ExtendedSwitchCell CopyTotpCell { get; set; }
|
||||
private Label CopyTotpLabel { get; set; }
|
||||
private ExtendedSwitchCell AnalyticsCell { get; set; }
|
||||
@ -42,30 +40,13 @@ namespace Bit.App.Pages
|
||||
|
||||
private void Init()
|
||||
{
|
||||
DefaultPageVaultCell = new ExtendedSwitchCell
|
||||
{
|
||||
Text = AppResources.DefaultPageVault,
|
||||
On = _appSettings.DefaultPageVault
|
||||
};
|
||||
|
||||
var defaultPageVaultTable = new FormTableView(true)
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection(Helpers.GetEmptyTableSectionTitle())
|
||||
{
|
||||
DefaultPageVaultCell
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WebsiteIconsCell = new ExtendedSwitchCell
|
||||
{
|
||||
Text = AppResources.DisableWebsiteIcons,
|
||||
On = _appSettings.DisableWebsiteIcons
|
||||
};
|
||||
|
||||
var websiteIconsTable = new FormTableView
|
||||
var websiteIconsTable = new FormTableView(true)
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
@ -110,11 +91,6 @@ namespace Bit.App.Pages
|
||||
}
|
||||
};
|
||||
|
||||
DefaultPageVaultLabel = new FormTableLabel(this)
|
||||
{
|
||||
Text = AppResources.DefaultPageVaultDescription
|
||||
};
|
||||
|
||||
CopyTotpLabel = new FormTableLabel(this)
|
||||
{
|
||||
Text = AppResources.DisableAutoTotpCopyDescription
|
||||
@ -134,7 +110,6 @@ namespace Bit.App.Pages
|
||||
{
|
||||
Children =
|
||||
{
|
||||
defaultPageVaultTable, DefaultPageVaultLabel,
|
||||
websiteIconsTable, WebsiteIconsLabel,
|
||||
totpTable, CopyTotpLabel,
|
||||
analyticsTable, AnalyticsLabel
|
||||
@ -239,7 +214,6 @@ namespace Bit.App.Pages
|
||||
{
|
||||
base.OnAppearing();
|
||||
|
||||
DefaultPageVaultCell.OnChanged += DefaultPageVaultCell_Changed;
|
||||
AnalyticsCell.OnChanged += AnalyticsCell_Changed;
|
||||
WebsiteIconsCell.OnChanged += WebsiteIconsCell_Changed;
|
||||
CopyTotpCell.OnChanged += CopyTotpCell_OnChanged;
|
||||
@ -257,7 +231,6 @@ namespace Bit.App.Pages
|
||||
{
|
||||
base.OnDisappearing();
|
||||
|
||||
DefaultPageVaultCell.OnChanged -= DefaultPageVaultCell_Changed;
|
||||
AnalyticsCell.OnChanged -= AnalyticsCell_Changed;
|
||||
WebsiteIconsCell.OnChanged -= WebsiteIconsCell_Changed;
|
||||
CopyTotpCell.OnChanged -= CopyTotpCell_OnChanged;
|
||||
@ -273,7 +246,6 @@ namespace Bit.App.Pages
|
||||
|
||||
private void Layout_LayoutChanged(object sender, EventArgs e)
|
||||
{
|
||||
DefaultPageVaultLabel.WidthRequest = StackLayout.Bounds.Width - DefaultPageVaultLabel.Bounds.Left * 2;
|
||||
AnalyticsLabel.WidthRequest = StackLayout.Bounds.Width - AnalyticsLabel.Bounds.Left * 2;
|
||||
WebsiteIconsLabel.WidthRequest = StackLayout.Bounds.Width - WebsiteIconsLabel.Bounds.Left * 2;
|
||||
CopyTotpLabel.WidthRequest = StackLayout.Bounds.Width - CopyTotpLabel.Bounds.Left * 2;
|
||||
@ -295,17 +267,6 @@ namespace Bit.App.Pages
|
||||
}
|
||||
}
|
||||
|
||||
private void DefaultPageVaultCell_Changed(object sender, ToggledEventArgs e)
|
||||
{
|
||||
var cell = sender as ExtendedSwitchCell;
|
||||
if(cell == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_appSettings.DefaultPageVault = cell.On;
|
||||
}
|
||||
|
||||
private void WebsiteIconsCell_Changed(object sender, ToggledEventArgs e)
|
||||
{
|
||||
var cell = sender as ExtendedSwitchCell;
|
||||
|
@ -311,7 +311,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
if(_fromAutofillFramework)
|
||||
{
|
||||
Application.Current.MainPage = new MainPage(true);
|
||||
Application.Current.MainPage = new MainPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
18
src/App/Resources/AppResources.Designer.cs
generated
18
src/App/Resources/AppResources.Designer.cs
generated
@ -915,24 +915,6 @@ namespace Bit.App.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Default To "My Vault".
|
||||
/// </summary>
|
||||
public static string DefaultPageVault {
|
||||
get {
|
||||
return ResourceManager.GetString("DefaultPageVault", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Default to the "My Vault" page instead of "Favorites" whenever I open the app..
|
||||
/// </summary>
|
||||
public static string DefaultPageVaultDescription {
|
||||
get {
|
||||
return ResourceManager.GetString("DefaultPageVaultDescription", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Delete.
|
||||
/// </summary>
|
||||
|
@ -1194,12 +1194,6 @@
|
||||
<data name="Collections" xml:space="preserve">
|
||||
<value>Collections</value>
|
||||
</data>
|
||||
<data name="DefaultPageVault" xml:space="preserve">
|
||||
<value>Default To "My Vault"</value>
|
||||
</data>
|
||||
<data name="DefaultPageVaultDescription" xml:space="preserve">
|
||||
<value>Default to the "My Vault" page instead of "Favorites" whenever I open the app.</value>
|
||||
</data>
|
||||
<data name="NoItemsCollection" xml:space="preserve">
|
||||
<value>There are no items in this collection.</value>
|
||||
</data>
|
||||
|
@ -14,18 +14,6 @@ namespace Bit.App.Services
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
public bool DefaultPageVault
|
||||
{
|
||||
get
|
||||
{
|
||||
return _settings.GetValueOrDefault(Constants.SettingDefaultPageVault, false);
|
||||
}
|
||||
set
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.SettingDefaultPageVault, value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Locked
|
||||
{
|
||||
get
|
||||
|
Loading…
Reference in New Issue
Block a user