From 383a49b75c97f8a0976943e63540b572b7c5985d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 18 May 2016 23:30:46 -0400 Subject: [PATCH] icon resources for android. more places for extended obs collection. --- src/Android/Android.csproj | 18 +++++++ .../Controls/ExtendedTextCellRenderer.cs | 3 +- src/Android/Resources/Resource.Designer.cs | 46 ++++++++++-------- .../drawable-mdpi/ion_chevron_right.png} | Bin .../Resources/drawable-mdpi/ion_plus.png} | Bin .../drawable-xhdpi/ion_chevron_right.png} | Bin .../Resources/drawable-xhdpi/ion_plus.png} | Bin .../drawable-xxhdpi/ion_chevron_right.png} | Bin .../Resources/drawable-xxhdpi/ion_plus.png} | Bin src/App/Pages/SettingsListFoldersPage.cs | 15 +++--- src/App/Pages/VaultListSitesPage.cs | 11 ++--- .../Utilities/ExtendedObservableCollection.cs | 2 +- src/iOS/Resources/ion_chevron_right.png | Bin 0 -> 261 bytes src/iOS/Resources/ion_chevron_right@2x.png | Bin 0 -> 515 bytes src/iOS/Resources/ion_chevron_right@3x.png | Bin 0 -> 595 bytes src/iOS/Resources/ion_plus.png | Bin 0 -> 127 bytes src/iOS/Resources/ion_plus@2x.png | Bin 0 -> 134 bytes src/iOS/Resources/ion_plus@3x.png | Bin 0 -> 147 bytes src/iOS/iOS.csproj | 12 ++--- 19 files changed, 63 insertions(+), 44 deletions(-) rename src/{iOS/Resources/ion-chevron-right.png => Android/Resources/drawable-mdpi/ion_chevron_right.png} (100%) rename src/{iOS/Resources/ion-plus.png => Android/Resources/drawable-mdpi/ion_plus.png} (100%) rename src/{iOS/Resources/ion-chevron-right@2x.png => Android/Resources/drawable-xhdpi/ion_chevron_right.png} (100%) rename src/{iOS/Resources/ion-plus@2x.png => Android/Resources/drawable-xhdpi/ion_plus.png} (100%) rename src/{iOS/Resources/ion-chevron-right@3x.png => Android/Resources/drawable-xxhdpi/ion_chevron_right.png} (100%) rename src/{iOS/Resources/ion-plus@3x.png => Android/Resources/drawable-xxhdpi/ion_plus.png} (100%) create mode 100644 src/iOS/Resources/ion_chevron_right.png create mode 100644 src/iOS/Resources/ion_chevron_right@2x.png create mode 100644 src/iOS/Resources/ion_chevron_right@3x.png create mode 100644 src/iOS/Resources/ion_plus.png create mode 100644 src/iOS/Resources/ion_plus@2x.png create mode 100644 src/iOS/Resources/ion_plus@3x.png diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 5d37b12e0..2fc4a5038 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -252,6 +252,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Android/Controls/ExtendedTextCellRenderer.cs b/src/Android/Controls/ExtendedTextCellRenderer.cs index 51dfd375f..06bb30c73 100644 --- a/src/Android/Controls/ExtendedTextCellRenderer.cs +++ b/src/Android/Controls/ExtendedTextCellRenderer.cs @@ -26,8 +26,7 @@ namespace Bit.Android.Controls if(extendedCell.ShowDisclousure) { - // TODO: different image - var resourceId = Resource.Drawable.fa_folder_open; + var resourceId = Resource.Drawable.ion_chevron_right; if(!string.IsNullOrWhiteSpace(extendedCell.DisclousureImage)) { var fileName = System.IO.Path.GetFileNameWithoutExtension(extendedCell.DisclousureImage); diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index 13a3115f5..055b01506 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -2258,58 +2258,64 @@ namespace Bit.Android public const int icon = 2130837652; // aapt resource value: 0x7f020095 - public const int mr_dialog_material_background_dark = 2130837653; + public const int ion_chevron_right = 2130837653; // aapt resource value: 0x7f020096 - public const int mr_dialog_material_background_light = 2130837654; + public const int ion_plus = 2130837654; // aapt resource value: 0x7f020097 - public const int mr_ic_audiotrack_light = 2130837655; + public const int mr_dialog_material_background_dark = 2130837655; // aapt resource value: 0x7f020098 - public const int mr_ic_cast_dark = 2130837656; + public const int mr_dialog_material_background_light = 2130837656; // aapt resource value: 0x7f020099 - public const int mr_ic_cast_light = 2130837657; + public const int mr_ic_audiotrack_light = 2130837657; // aapt resource value: 0x7f02009a - public const int mr_ic_close_dark = 2130837658; + public const int mr_ic_cast_dark = 2130837658; // aapt resource value: 0x7f02009b - public const int mr_ic_close_light = 2130837659; + public const int mr_ic_cast_light = 2130837659; // aapt resource value: 0x7f02009c - public const int mr_ic_media_route_connecting_mono_dark = 2130837660; + public const int mr_ic_close_dark = 2130837660; // aapt resource value: 0x7f02009d - public const int mr_ic_media_route_connecting_mono_light = 2130837661; + public const int mr_ic_close_light = 2130837661; // aapt resource value: 0x7f02009e - public const int mr_ic_media_route_mono_dark = 2130837662; + public const int mr_ic_media_route_connecting_mono_dark = 2130837662; // aapt resource value: 0x7f02009f - public const int mr_ic_media_route_mono_light = 2130837663; + public const int mr_ic_media_route_connecting_mono_light = 2130837663; // aapt resource value: 0x7f0200a0 - public const int mr_ic_pause_dark = 2130837664; + public const int mr_ic_media_route_mono_dark = 2130837664; // aapt resource value: 0x7f0200a1 - public const int mr_ic_pause_light = 2130837665; + public const int mr_ic_media_route_mono_light = 2130837665; // aapt resource value: 0x7f0200a2 - public const int mr_ic_play_dark = 2130837666; + public const int mr_ic_pause_dark = 2130837666; // aapt resource value: 0x7f0200a3 - public const int mr_ic_play_light = 2130837667; - - // aapt resource value: 0x7f0200a6 - public const int notification_template_icon_bg = 2130837670; + public const int mr_ic_pause_light = 2130837667; // aapt resource value: 0x7f0200a4 - public const int roundedbg = 2130837668; + public const int mr_ic_play_dark = 2130837668; // aapt resource value: 0x7f0200a5 - public const int roundedbgdark = 2130837669; + public const int mr_ic_play_light = 2130837669; + + // aapt resource value: 0x7f0200a8 + public const int notification_template_icon_bg = 2130837672; + + // aapt resource value: 0x7f0200a6 + public const int roundedbg = 2130837670; + + // aapt resource value: 0x7f0200a7 + public const int roundedbgdark = 2130837671; static Drawable() { diff --git a/src/iOS/Resources/ion-chevron-right.png b/src/Android/Resources/drawable-mdpi/ion_chevron_right.png similarity index 100% rename from src/iOS/Resources/ion-chevron-right.png rename to src/Android/Resources/drawable-mdpi/ion_chevron_right.png diff --git a/src/iOS/Resources/ion-plus.png b/src/Android/Resources/drawable-mdpi/ion_plus.png similarity index 100% rename from src/iOS/Resources/ion-plus.png rename to src/Android/Resources/drawable-mdpi/ion_plus.png diff --git a/src/iOS/Resources/ion-chevron-right@2x.png b/src/Android/Resources/drawable-xhdpi/ion_chevron_right.png similarity index 100% rename from src/iOS/Resources/ion-chevron-right@2x.png rename to src/Android/Resources/drawable-xhdpi/ion_chevron_right.png diff --git a/src/iOS/Resources/ion-plus@2x.png b/src/Android/Resources/drawable-xhdpi/ion_plus.png similarity index 100% rename from src/iOS/Resources/ion-plus@2x.png rename to src/Android/Resources/drawable-xhdpi/ion_plus.png diff --git a/src/iOS/Resources/ion-chevron-right@3x.png b/src/Android/Resources/drawable-xxhdpi/ion_chevron_right.png similarity index 100% rename from src/iOS/Resources/ion-chevron-right@3x.png rename to src/Android/Resources/drawable-xxhdpi/ion_chevron_right.png diff --git a/src/iOS/Resources/ion-plus@3x.png b/src/Android/Resources/drawable-xxhdpi/ion_plus.png similarity index 100% rename from src/iOS/Resources/ion-plus@3x.png rename to src/Android/Resources/drawable-xxhdpi/ion_plus.png diff --git a/src/App/Pages/SettingsListFoldersPage.cs b/src/App/Pages/SettingsListFoldersPage.cs index 63b5c671e..3a7a3d5a1 100644 --- a/src/App/Pages/SettingsListFoldersPage.cs +++ b/src/App/Pages/SettingsListFoldersPage.cs @@ -1,11 +1,13 @@ using System; using System.Collections.ObjectModel; +using System.Linq; using System.Threading.Tasks; using Acr.UserDialogs; using Bit.App.Abstractions; using Bit.App.Controls; using Bit.App.Models.Page; using Bit.App.Resources; +using Bit.App.Utilities; using Xamarin.Forms; using XLabs.Ioc; @@ -23,7 +25,7 @@ namespace Bit.App.Pages Init(); } - public ObservableCollection Folders { get; private set; } = new ObservableCollection(); + public ExtendedObservableCollection Folders { get; private set; } = new ExtendedObservableCollection(); private void Init() { @@ -49,14 +51,9 @@ namespace Bit.App.Pages private async Task LoadFoldersAsync() { - Folders.Clear(); - var folders = await _folderService.GetAllAsync(); - foreach(var folder in folders) - { - var f = new SettingsFolderPageModel(folder); - Folders.Add(f); - } + var pageFolders = folders.Select(f => new SettingsFolderPageModel(f)); + Folders.ResetWithRange(pageFolders); } private void FolderSelected(object sender, SelectedItemChangedEventArgs e) @@ -74,7 +71,7 @@ namespace Bit.App.Pages { _page = page; Text = AppResources.Add; - Icon = "ion-plus"; + Icon = "ion_plus"; Clicked += ClickedItem; } diff --git a/src/App/Pages/VaultListSitesPage.cs b/src/App/Pages/VaultListSitesPage.cs index e5517d8c4..f05576b4e 100644 --- a/src/App/Pages/VaultListSitesPage.cs +++ b/src/App/Pages/VaultListSitesPage.cs @@ -41,12 +41,11 @@ namespace Bit.App.Pages IsGroupingEnabled = true, ItemsSource = Folders, HasUnevenRows = true, - SeparatorColor = Color.FromHex("d2d6de") + SeparatorColor = Color.FromHex("d2d6de"), + GroupHeaderTemplate = new DataTemplate(() => new VaultListHeaderViewCell(this)), + ItemTemplate = new DataTemplate(() => new VaultListViewCell(this)) }; - listView.GroupDisplayBinding = new Binding("Name"); - listView.GroupHeaderTemplate = new DataTemplate(() => new VaultListHeaderViewCell(this)); listView.ItemSelected += SiteSelected; - listView.ItemTemplate = new DataTemplate(() => new VaultListViewCell(this)); Title = AppResources.MyVault; Content = listView; @@ -67,7 +66,7 @@ namespace Bit.App.Pages var noneFolder = new VaultListPageModel.Folder(sites.Where(s => s.FolderId == null)); pageFolders.Add(noneFolder); - Folders.Reset(pageFolders); + Folders.ResetWithRange(pageFolders); } private void SiteSelected(object sender, SelectedItemChangedEventArgs e) @@ -146,7 +145,7 @@ namespace Bit.App.Pages { _page = page; Text = AppResources.Add; - Icon = "ion-plus"; + Icon = "ion_plus"; Clicked += ClickedItem; } diff --git a/src/App/Utilities/ExtendedObservableCollection.cs b/src/App/Utilities/ExtendedObservableCollection.cs index 191161c8d..4a5c0fa5d 100644 --- a/src/App/Utilities/ExtendedObservableCollection.cs +++ b/src/App/Utilities/ExtendedObservableCollection.cs @@ -24,7 +24,7 @@ namespace Bit.App.Utilities OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } - public void Reset(IEnumerable range) + public void ResetWithRange(IEnumerable range) { Items.Clear(); AddRange(range); diff --git a/src/iOS/Resources/ion_chevron_right.png b/src/iOS/Resources/ion_chevron_right.png new file mode 100644 index 0000000000000000000000000000000000000000..dd7cb2406a632c8e484d840ec507326f224a3943 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh3?wzC-F*zC0t0+PT!A!oLCi`~C!mQ^B|(0{ z42(=Htn8dT3d%VZm8}ye&0Vo}>xqjuA3S^UUNK4)sLIpR#W93qW^zJ8!UKVnBnPHL zK}|g#F=>LDj45{AD@5cs6@?jU#--TJ-XUUcG(R?|i+iSa;~7@1X9rV7E-2N_Ipn{URCj)#!T!HlP0IO`&{eV7kDhcun zW?*DuW?^Mx=iub#;o}z&7LkyYQ&Cmd(K9hMGk0+G2~Wx`uV`-VpS5(u_FV@K9zApJ z;^nK?@7#Ox?8WQ1A3uNp{r8Se>S~~A%ROBjLo|X*FSt7~1qiqt?2il#Fj%lCL1~7t zo4|_S@~2pD&)mK?v|O{>Z_cze$ug-wx_;I*U6nsGtMl5i8Shkg{ciWPy?9Jy|Lsn* z^dGmpz9jVZ_qs%X*f%XhdS1AYZS(P`F4hIxMUtQL@+H4H9GYXhqw}rQuZ^*X76{#9 z`h&A!F@u9@=duwPc;|B5t4m$(dp QouH`nboFyt=akR{0C!V@nE(I) literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/ion_chevron_right@3x.png b/src/iOS/Resources/ion_chevron_right@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..8df8be9aa8e4ff7765cb0306589101afb7612d2a GIT binary patch literal 595 zcmeAS@N?(olHy`uVBq!ia0vp^S|H593?x6vT4n;Ns{uYCu0VSD0lw5AL7=bPN`m}? z8JL(^SlQS)IJtOu`2_?;L?tAp1a@=v_TuH+_n*K2{u{~Wcn)adb59q?5R21mueu8zGT>po;K0;!q5Az^ z;i~s9{<$Y59^CM#duGM!?Hf{GMql1H&G1#`rqmlQvKv*hykE3*bgWQa!0fuRab@gTe~DWM4feJ`TJ literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/ion_plus.png b/src/iOS/Resources/ion_plus.png new file mode 100644 index 0000000000000000000000000000000000000000..fd7be4f4c5265e17f6b6356ac1c929fbad682b26 GIT binary patch literal 127 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@I3?$8F6>~X%;pFQhRzGVIc0{| QH-k*`boFyt=akR{0C(~pHUIzs literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/ion_plus@3x.png b/src/iOS/Resources/ion_plus@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..de42046a816052685eb74920679e8b3c683bb62b GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&}3?v1sWN!m0{s5m4S0IfH{P~{u0{JW@L4Lsu zi~_69O$Y&*q3`M97~;{HoZ!HAMo&TEK!bG8Dv40TRZY*dVmKI<2a1{m7)B)3ha6qe d6)5V$%&_zA8o|HarX?VwJzf1=);T3K0RRenBai?9 literal 0 HcmV?d00001 diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index 2039723f7..f3e4d97fc 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -258,22 +258,22 @@ - + - + - + - + - + - +