mirror of
https://github.com/bitwarden/mobile
synced 2025-02-02 03:27:06 +01:00
Added favorites tab with new selected icon capabilities in TabbedPage
This commit is contained in:
parent
0007cac17b
commit
e4926c4425
@ -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);
|
||||
|
9
src/App/Resources/AppResources.Designer.cs
generated
9
src/App/Resources/AppResources.Designer.cs
generated
@ -178,6 +178,15 @@ namespace Bit.App.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Favorites.
|
||||
/// </summary>
|
||||
internal static string Favorites {
|
||||
get {
|
||||
return ResourceManager.GetString("Favorites", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Folder.
|
||||
/// </summary>
|
||||
|
@ -168,6 +168,10 @@
|
||||
<value>Email Address</value>
|
||||
<comment>Full label for a email address.</comment>
|
||||
</data>
|
||||
<data name="Favorites" xml:space="preserve">
|
||||
<value>Favorites</value>
|
||||
<comment>Title for your favorite items in the vault.</comment>
|
||||
</data>
|
||||
<data name="Folder" xml:space="preserve">
|
||||
<value>Folder</value>
|
||||
<comment>Label for a folder.</comment>
|
||||
|
@ -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 { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
src/iOS/Resources/star.png
Normal file
BIN
src/iOS/Resources/star.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 556 B |
BIN
src/iOS/Resources/star@2x.png
Normal file
BIN
src/iOS/Resources/star@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1005 B |
BIN
src/iOS/Resources/star@3x.png
Normal file
BIN
src/iOS/Resources/star@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
src/iOS/Resources/star_selected.png
Normal file
BIN
src/iOS/Resources/star_selected.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 444 B |
BIN
src/iOS/Resources/star_selected@2x.png
Normal file
BIN
src/iOS/Resources/star_selected@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 706 B |
BIN
src/iOS/Resources/star_selected@3x.png
Normal file
BIN
src/iOS/Resources/star_selected@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 956 B |
@ -375,6 +375,24 @@
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\bg%403x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\star.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\star%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\star%403x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\star_selected.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\star_selected%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\star_selected%403x.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user