diff --git a/src/App/Controls/CipherViewCell/CipherViewCell.xaml b/src/App/Controls/CipherViewCell/CipherViewCell.xaml
index 7edfa6836..638fc9545 100644
--- a/src/App/Controls/CipherViewCell/CipherViewCell.xaml
+++ b/src/App/Controls/CipherViewCell/CipherViewCell.xaml
@@ -43,8 +43,8 @@
ErrorPlaceholder="login.png"
HorizontalOptions="Center"
VerticalOptions="Center"
- WidthRequest="20"
- HeightRequest="20"
+ WidthRequest="22"
+ HeightRequest="22"
IsVisible="False"/>
-
-
-
-
-
-
-
-
-
-
-
+ GroupTemplate="{StaticResource groupTemplate}" />
diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs
index f2c6379ea..027b9e487 100644
--- a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs
+++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs
@@ -90,6 +90,10 @@ namespace Bit.App.Pages
{
await _viewModel.SelectCollectionAsync(item.Collection);
}
+ else if(item.Type != null)
+ {
+ await _viewModel.SelectTypeAsync(item.Type.Value);
+ }
}
}
}
diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageListGroup.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageListGroup.cs
index 4963e1447..3a556349b 100644
--- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageListGroup.cs
+++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageListGroup.cs
@@ -4,6 +4,10 @@ namespace Bit.App.Pages
{
public class GroupingsPageListGroup : List
{
+ public GroupingsPageListGroup(string name, bool doUpper = true)
+ : this(new List(), name, doUpper)
+ { }
+
public GroupingsPageListGroup(List groupItems, string name, bool doUpper = true)
{
AddRange(groupItems);
diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs
index acdba5124..48f5a4053 100644
--- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs
+++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs
@@ -1,14 +1,59 @@
-using Bit.Core.Models.View;
+using Bit.App.Resources;
+using Bit.Core.Enums;
+using Bit.Core.Models.View;
namespace Bit.App.Pages
{
public class GroupingsPageListItem
{
private string _icon;
+ private string _name;
public FolderView Folder { get; set; }
public CollectionView Collection { get; set; }
public CipherView Cipher { get; set; }
+ public CipherType? Type { get; set; }
+
+ public string Name
+ {
+ get
+ {
+ if(_name != null)
+ {
+ return _name;
+ }
+ if(Folder != null)
+ {
+ _name = Folder.Name;
+ }
+ else if(Collection != null)
+ {
+ _name = Collection.Name;
+ }
+ else if(Type != null)
+ {
+ switch(Type.Value)
+ {
+ case CipherType.Login:
+ _name = AppResources.TypeLogin;
+ break;
+ case CipherType.SecureNote:
+ _name = AppResources.TypeSecureNote;
+ break;
+ case CipherType.Card:
+ _name = AppResources.TypeCard;
+ break;
+ case CipherType.Identity:
+ _name = AppResources.TypeIdentity;
+ break;
+ default:
+ break;
+ }
+ }
+ return _name;
+ }
+ }
+
public string Icon
{
get
@@ -25,6 +70,27 @@ namespace Bit.App.Pages
{
_icon = "";
}
+ else if(Type != null)
+ {
+ switch(Type.Value)
+ {
+ case CipherType.Login:
+ _icon = "";
+ break;
+ case CipherType.SecureNote:
+ _icon = "";
+ break;
+ case CipherType.Card:
+ _icon = "";
+ break;
+ case CipherType.Identity:
+ _icon = "";
+ break;
+ default:
+ _icon = "";
+ break;
+ }
+ }
return _icon;
}
}
diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItemSelector.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItemSelector.cs
index 51bea988d..4fea472ba 100644
--- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItemSelector.cs
+++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageListItemSelector.cs
@@ -5,22 +5,13 @@ namespace Bit.App.Pages
public class GroupingsPageListItemSelector : DataTemplateSelector
{
public DataTemplate CipherTemplate { get; set; }
- public DataTemplate FolderTemplate { get; set; }
- public DataTemplate CollectionTemplate { get; set; }
+ public DataTemplate GroupTemplate { get; set; }
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
{
if(item is GroupingsPageListItem listItem)
{
- if(listItem.Collection != null)
- {
- return CollectionTemplate;
- }
- else if(listItem.Folder != null)
- {
- return FolderTemplate;
- }
- return CipherTemplate;
+ return listItem.Cipher != null ? CipherTemplate : GroupTemplate;
}
return null;
}
diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs
index 82b60ffa8..4cae844f5 100644
--- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs
+++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs
@@ -125,6 +125,17 @@ namespace Bit.App.Pages
groupedItems.Add(new GroupingsPageListGroup(favListItems, AppResources.Favorites,
Device.RuntimePlatform == Device.iOS));
}
+ if(MainPage)
+ {
+ groupedItems.Add(new GroupingsPageListGroup(
+ AppResources.Types, Device.RuntimePlatform == Device.iOS)
+ {
+ new GroupingsPageListItem { Type = CipherType.Login },
+ new GroupingsPageListItem { Type = CipherType.Card },
+ new GroupingsPageListItem { Type = CipherType.Identity },
+ new GroupingsPageListItem { Type = CipherType.SecureNote }
+ });
+ }
if(folderListItems?.Any() ?? false)
{
groupedItems.Add(new GroupingsPageListGroup(folderListItems, AppResources.Folders,
@@ -158,10 +169,10 @@ namespace Bit.App.Pages
await Page.Navigation.PushModalAsync(new NavigationPage(page));
}
- public async Task SelectFolderAsync(CipherType type)
+ public async Task SelectTypeAsync(CipherType type)
{
string title = null;
- switch(Type.Value)
+ switch(type)
{
case CipherType.Login:
title = AppResources.Logins;
diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs
index 5d2fbbb34..c5d60c0a0 100644
--- a/src/App/Resources/AppResources.Designer.cs
+++ b/src/App/Resources/AppResources.Designer.cs
@@ -3219,6 +3219,15 @@ namespace Bit.App.Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Types.
+ ///
+ public static string Types {
+ get {
+ return ResourceManager.GetString("Types", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Secure Note.
///
diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx
index 3767ff445..763df10c4 100644
--- a/src/App/Resources/AppResources.resx
+++ b/src/App/Resources/AppResources.resx
@@ -1390,4 +1390,7 @@
Password History
+
+ Types
+
\ No newline at end of file
diff --git a/src/App/Styles/Base.xaml b/src/App/Styles/Base.xaml
index 5b6b1f6ba..d6296273f 100644
--- a/src/App/Styles/Base.xaml
+++ b/src/App/Styles/Base.xaml
@@ -62,7 +62,7 @@