Move tab bar colors to styles (#764)

This commit is contained in:
Kyle Spearrin 2020-03-11 09:46:48 -04:00 committed by GitHub
parent f10114ee17
commit 120e179fb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 11 deletions

View file

@ -15,21 +15,21 @@ namespace Bit.App.Pages
_groupingsPage = new NavigationPage(new GroupingsPage(true, previousPage: previousPage))
{
Title = AppResources.MyVault,
Icon = "lock.png"
IconImageSource = "lock.png"
};
Children.Add(_groupingsPage);
_generatorPage = new NavigationPage(new GeneratorPage(true, null, this))
{
Title = AppResources.Generator,
Icon = "refresh.png"
IconImageSource = "refresh.png"
};
Children.Add(_generatorPage);
var settingsPage = new NavigationPage(new SettingsPage(this))
{
Title = AppResources.Settings,
Icon = "cog.png"
IconImageSource = "cog.png"
};
Children.Add(settingsPage);
@ -41,10 +41,6 @@ namespace Bit.App.Pages
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.ToolbarPlacement.Bottom);
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSwipePagingEnabled(this, false);
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSmoothScrollEnabled(this, false);
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetBarSelectedItemColor(this,
(Color)Application.Current.Resources["TabBarSelectedItemColor"]);
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetBarItemColor(this,
(Color)Application.Current.Resources["TabBarItemColor"]);
}
if(appOptions?.GeneratorTile ?? false)

View file

@ -65,6 +65,10 @@
ApplyToDerivedTypes="True">
<Setter Property="BarBackgroundColor"
Value="{StaticResource TabBarBackgroundColor}" />
<Setter Property="SelectedTabColor"
Value="{StaticResource TabBarSelectedItemColor}" />
<Setter Property="UnselectedTabColor"
Value="{StaticResource TabBarItemColor}" />
</Style>
<Style TargetType="NavigationPage"
ApplyToDerivedTypes="True">

View file

@ -12,10 +12,6 @@ namespace Bit.iOS.Renderers
base.OnElementChanged(e);
TabBar.Translucent = false;
TabBar.Opaque = true;
TabBar.SelectedImageTintColor =
((Color)Xamarin.Forms.Application.Current.Resources["TabBarSelectedItemColor"]).ToUIColor();
TabBar.UnselectedItemTintColor =
((Color)Xamarin.Forms.Application.Current.Resources["TabBarItemColor"]).ToUIColor();
}
}
}