diff --git a/src/App/Pages/MainPage.cs b/src/App/Pages/MainPage.cs index 0657c8fd8..881330384 100644 --- a/src/App/Pages/MainPage.cs +++ b/src/App/Pages/MainPage.cs @@ -13,9 +13,13 @@ namespace Bit.App.Pages TintColor = Color.FromHex("ffffff"); var settingsNavigation = new ExtendedNavigationPage(new SettingsPage()); + var favoritesNavigation = new ExtendedNavigationPage(new VaultListSitesPage()); var vaultNavigation = new ExtendedNavigationPage(new VaultListSitesPage()); var syncNavigation = new ExtendedNavigationPage(new SyncPage()); + favoritesNavigation.Title = AppResources.Favorites; + favoritesNavigation.Icon = "star"; + vaultNavigation.Title = AppResources.MyVault; vaultNavigation.Icon = "fa-lock"; @@ -25,6 +29,7 @@ namespace Bit.App.Pages settingsNavigation.Title = AppResources.Settings; settingsNavigation.Icon = "fa-cogs"; + Children.Add(favoritesNavigation); Children.Add(vaultNavigation); Children.Add(syncNavigation); Children.Add(settingsNavigation); diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 542410d9b..e0eccd502 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -178,6 +178,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to Favorites. + /// + internal static string Favorites { + get { + return ResourceManager.GetString("Favorites", resourceCulture); + } + } + /// /// Looks up a localized string similar to Folder. /// diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 415ae9eed..8519e6c16 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -168,6 +168,10 @@ Email Address Full label for a email address. + + Favorites + Title for your favorite items in the vault. + Folder Label for a folder. diff --git a/src/iOS/Controls/ExtendedTabbedPageRenderer.cs b/src/iOS/Controls/ExtendedTabbedPageRenderer.cs index b099d6311..80fa57254 100644 --- a/src/iOS/Controls/ExtendedTabbedPageRenderer.cs +++ b/src/iOS/Controls/ExtendedTabbedPageRenderer.cs @@ -1,6 +1,7 @@ using System; using Bit.App.Controls; using Bit.iOS.Controls; +using UIKit; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; @@ -19,5 +20,45 @@ namespace Bit.iOS.Controls TabBar.BarTintColor = page.BarTintColor.ToUIColor(); TabBar.BackgroundColor = page.BackgroundColor.ToUIColor(); } + + public override void ViewWillAppear(bool animated) + { + if(TabBar?.Items == null) + { + return; + } + + var tabs = Element as TabbedPage; + if(tabs != null) + { + for(int i = 0; i < TabBar.Items.Length; i++) + { + UpdateItem(TabBar.Items[i], tabs.Children[i].Icon); + } + } + + base.ViewWillAppear(animated); + } + + private void UpdateItem(UITabBarItem item, string icon) + { + if(item == null) + { + return; + } + + try + { + icon = string.Concat(icon, "_selected"); + if(item?.SelectedImage?.AccessibilityIdentifier == icon) + { + return; + } + + item.SelectedImage = UIImage.FromBundle(icon); + item.SelectedImage.AccessibilityIdentifier = icon; + } + catch { } + } } } diff --git a/src/iOS/Resources/star.png b/src/iOS/Resources/star.png new file mode 100644 index 000000000..5bab92717 Binary files /dev/null and b/src/iOS/Resources/star.png differ diff --git a/src/iOS/Resources/star@2x.png b/src/iOS/Resources/star@2x.png new file mode 100644 index 000000000..f0b893e46 Binary files /dev/null and b/src/iOS/Resources/star@2x.png differ diff --git a/src/iOS/Resources/star@3x.png b/src/iOS/Resources/star@3x.png new file mode 100644 index 000000000..36d080c54 Binary files /dev/null and b/src/iOS/Resources/star@3x.png differ diff --git a/src/iOS/Resources/star_selected.png b/src/iOS/Resources/star_selected.png new file mode 100644 index 000000000..b9d048110 Binary files /dev/null and b/src/iOS/Resources/star_selected.png differ diff --git a/src/iOS/Resources/star_selected@2x.png b/src/iOS/Resources/star_selected@2x.png new file mode 100644 index 000000000..085f1257f Binary files /dev/null and b/src/iOS/Resources/star_selected@2x.png differ diff --git a/src/iOS/Resources/star_selected@3x.png b/src/iOS/Resources/star_selected@3x.png new file mode 100644 index 000000000..54e26da3a Binary files /dev/null and b/src/iOS/Resources/star_selected@3x.png differ diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index 59eae034b..2470f00e7 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -375,6 +375,24 @@ + + + + + + + + + + + + + + + + + +