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:
@@ -22,8 +22,8 @@
|
||||
x:DataType="pages:GroupingsPageListItem">
|
||||
<ViewCell>
|
||||
<StackLayout Orientation="Horizontal"
|
||||
StyleClass="list-row">
|
||||
<controls:FaLabel Text=""
|
||||
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=""
|
||||
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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user