diff --git a/src/App/Pages/Settings/SettingsPage.xaml b/src/App/Pages/Settings/SettingsPage.xaml
index 6f6fd7bf5..4977f88ed 100644
--- a/src/App/Pages/Settings/SettingsPage.xaml
+++ b/src/App/Pages/Settings/SettingsPage.xaml
@@ -1,5 +1,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/App/Pages/Settings/SettingsPage.xaml.cs b/src/App/Pages/Settings/SettingsPage.xaml.cs
index 78daa1579..b91a7780c 100644
--- a/src/App/Pages/Settings/SettingsPage.xaml.cs
+++ b/src/App/Pages/Settings/SettingsPage.xaml.cs
@@ -8,7 +8,7 @@ using Xamarin.Forms.Xaml;
namespace Bit.App.Pages
{
- public partial class SettingsPage : ContentPage
+ public partial class SettingsPage : BaseContentPage
{
private SettingsPageViewModel _vm;
@@ -18,5 +18,20 @@ namespace Bit.App.Pages
_vm = BindingContext as SettingsPageViewModel;
_vm.Page = this;
}
+
+ private void RowSelected(object sender, SelectedItemChangedEventArgs e)
+ {
+ ((ListView)sender).SelectedItem = null;
+ if(!DoOnce())
+ {
+ return;
+ }
+ if(!(e.SelectedItem is SettingsPageListItem item))
+ {
+ return;
+ }
+
+ // TODO
+ }
}
}
diff --git a/src/App/Pages/Settings/SettingsPageListGroup.cs b/src/App/Pages/Settings/SettingsPageListGroup.cs
new file mode 100644
index 000000000..5b85c7771
--- /dev/null
+++ b/src/App/Pages/Settings/SettingsPageListGroup.cs
@@ -0,0 +1,26 @@
+using System.Collections.Generic;
+
+namespace Bit.App.Pages
+{
+ public class SettingsPageListGroup : List
+ {
+ public SettingsPageListGroup(List groupItems, string name, bool doUpper = true)
+ {
+ AddRange(groupItems);
+ if(string.IsNullOrWhiteSpace(name))
+ {
+ Name = "-";
+ }
+ else if(doUpper)
+ {
+ Name = name.ToUpperInvariant();
+ }
+ else
+ {
+ Name = name;
+ }
+ }
+
+ public string Name { get; set; }
+ }
+}
diff --git a/src/App/Pages/Settings/SettingsPageListItem.cs b/src/App/Pages/Settings/SettingsPageListItem.cs
new file mode 100644
index 000000000..dce875912
--- /dev/null
+++ b/src/App/Pages/Settings/SettingsPageListItem.cs
@@ -0,0 +1,9 @@
+namespace Bit.App.Pages
+{
+ public class SettingsPageListItem
+ {
+ public string Icon { get; set; }
+ public string Name { get; set; }
+ public string SubLabel { get; set; }
+ }
+}
diff --git a/src/App/Pages/Settings/SettingsPageListItemSelector.cs b/src/App/Pages/Settings/SettingsPageListItemSelector.cs
new file mode 100644
index 000000000..c58e7723f
--- /dev/null
+++ b/src/App/Pages/Settings/SettingsPageListItemSelector.cs
@@ -0,0 +1,18 @@
+using Xamarin.Forms;
+
+namespace Bit.App.Pages
+{
+ public class SettingsPageListItemSelector : DataTemplateSelector
+ {
+ public DataTemplate RegularTemplate { get; set; }
+
+ protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
+ {
+ if(item is SettingsPageListItem listItem)
+ {
+ return RegularTemplate;
+ }
+ return null;
+ }
+ }
+}
diff --git a/src/App/Pages/Settings/SettingsPageViewModel.cs b/src/App/Pages/Settings/SettingsPageViewModel.cs
index 7ca0a4e14..4b5d7fc28 100644
--- a/src/App/Pages/Settings/SettingsPageViewModel.cs
+++ b/src/App/Pages/Settings/SettingsPageViewModel.cs
@@ -1,7 +1,6 @@
using Bit.App.Resources;
using System;
using System.Collections.Generic;
-using System.Text;
using System.Windows.Input;
using Xamarin.Forms;
@@ -15,9 +14,48 @@ namespace Bit.App.Pages
ButtonCommand = new Command(() => Page.DisplayAlert("Button 1 Command", "Button 1 message", "Cancel"));
Button2Command = new Command(() => Page.DisplayAlert("Button 2 Command", "Button 2 message", "Cancel"));
+ BuildList();
}
public ICommand ButtonCommand { get; }
public ICommand Button2Command { get; }
+ public List GroupedItems { get; set; }
+
+ private void BuildList()
+ {
+ var doUpper = Device.RuntimePlatform != Device.Android;
+ var manageItems = new List
+ {
+ new SettingsPageListItem { Name = AppResources.Folders },
+ new SettingsPageListItem { Name = AppResources.Sync }
+ };
+ var securityItems = new List
+ {
+ new SettingsPageListItem { Name = AppResources.LockOptions },
+ new SettingsPageListItem { Name = string.Format(AppResources.UnlockWith, AppResources.Fingerprint) },
+ new SettingsPageListItem { Name = AppResources.UnlockWithPIN },
+ new SettingsPageListItem { Name = AppResources.Lock },
+ new SettingsPageListItem { Name = AppResources.TwoStepLogin }
+ };
+ var accountItems = new List
+ {
+ new SettingsPageListItem { Name = AppResources.ChangeMasterPassword },
+ new SettingsPageListItem { Name = AppResources.LogOut }
+ };
+ var otherItems = new List
+ {
+ new SettingsPageListItem { Name = AppResources.Options },
+ new SettingsPageListItem { Name = AppResources.About },
+ new SettingsPageListItem { Name = AppResources.HelpAndFeedback },
+ new SettingsPageListItem { Name = AppResources.RateTheApp }
+ };
+ GroupedItems = new List
+ {
+ new SettingsPageListGroup(manageItems, AppResources.Manage, doUpper),
+ new SettingsPageListGroup(securityItems, AppResources.Security, doUpper),
+ new SettingsPageListGroup(accountItems, AppResources.Account, doUpper),
+ new SettingsPageListGroup(otherItems, AppResources.Other, doUpper)
+ };
+ }
}
}
diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs
index d3a16219c..59b028041 100644
--- a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs
+++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs
@@ -87,7 +87,6 @@ namespace Bit.App.Pages
{
return;
}
-
if(!(e.SelectedItem is GroupingsPageListItem item))
{
return;