1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-04 09:33:16 +00:00

cipher view cell and groupings styles

This commit is contained in:
Kyle Spearrin
2019-04-22 17:08:37 -04:00
parent 6cd1171fd5
commit 913cd23c45
18 changed files with 256 additions and 35 deletions

View File

@@ -22,8 +22,8 @@
x:DataType="pages:GroupingsPageListItem">
<ViewCell>
<StackLayout Orientation="Horizontal"
StyleClass="list-row">
<controls:FaLabel Text="&#xf07c;"
StyleClass="list-row, list-row-platform">
<controls:FaLabel Text="{Binding Icon, Mode=OneWay}"
HorizontalOptions="Start"
VerticalOptions="CenterAndExpand"
StyleClass="list-icon" />
@@ -40,8 +40,8 @@
x:DataType="pages:GroupingsPageListItem">
<ViewCell>
<StackLayout Orientation="Horizontal"
StyleClass="list-row">
<controls:FaLabel Text="&#xf1b2;"
StyleClass="list-row, list-row-platform">
<controls:FaLabel Text="{Binding Icon, Mode=OneWay}"
HorizontalOptions="Start"
VerticalOptions="CenterAndExpand"
StyleClass="list-icon" />
@@ -72,13 +72,13 @@
CachingStrategy="RecycleElement"
ItemTemplate="{StaticResource listItemDataTemplateSelector}"
IsGroupingEnabled="True"
StyleClass="list">
StyleClass="list, list-platform">
<ListView.GroupHeaderTemplate>
<DataTemplate x:DataType="pages:GroupingsPageListGroup">
<ViewCell>
<StackLayout StyleClass="list-row-header">
<Label Text="{Binding Name}"
StyleClass="list-header, list-header-themed, list-header-platform" />
StyleClass="list-header, list-header-platform" />
</StackLayout>
</ViewCell>
</DataTemplate>

View File

@@ -4,8 +4,29 @@ namespace Bit.App.Pages
{
public class GroupingsPageListItem
{
private string _icon;
public FolderView Folder { get; set; }
public CollectionView Collection { get; set; }
public CipherView Cipher { get; set; }
public string Icon
{
get
{
if(_icon != null)
{
return _icon;
}
if(Folder != null)
{
_icon = Folder.Id == null ? "" : "";
}
else if(Collection != null)
{
_icon = "";
}
return _icon;
}
}
}
}

View File

@@ -78,15 +78,18 @@ namespace Bit.App.Pages
var groupedItems = new List<GroupingsPageListGroup>();
if(favListItems?.Any() ?? false)
{
groupedItems.Add(new GroupingsPageListGroup(favListItems, AppResources.Favorites));
groupedItems.Add(new GroupingsPageListGroup(favListItems, AppResources.Favorites,
Device.RuntimePlatform == Device.iOS));
}
if(folderListItems?.Any() ?? false)
{
groupedItems.Add(new GroupingsPageListGroup(folderListItems, AppResources.Folders));
groupedItems.Add(new GroupingsPageListGroup(folderListItems, AppResources.Folders,
Device.RuntimePlatform == Device.iOS));
}
if(collectionListItems?.Any() ?? false)
{
groupedItems.Add(new GroupingsPageListGroup(collectionListItems, AppResources.Collections));
groupedItems.Add(new GroupingsPageListGroup(collectionListItems, AppResources.Collections,
Device.RuntimePlatform == Device.iOS));
}
GroupedItems.ResetWithRange(groupedItems);
}