public virtual void SetAppearance(BottomNavigationView bottomView, ShellAppearance appearance)
{
IShellAppearanceElement controller = appearance;
- var background = controller.EffectiveTabBarBackgroundColor;
- var foreground = controller.EffectiveTabBarForegroundColor;
- var disabled = controller.EffectiveTabBarDisabledColor;
- var unselected = controller.EffectiveTabBarUnselectedColor;
- var title = controller.EffectiveTabBarTitleColor;
+ var backgroundColor = controller.EffectiveTabBarBackgroundColor;
+ var foregroundColor = controller.EffectiveTabBarForegroundColor; // currently unused
+ var disabledColor = controller.EffectiveTabBarDisabledColor;
+ var unselectedColor = controller.EffectiveTabBarUnselectedColor;
+ var titleColor = controller.EffectiveTabBarTitleColor;
if (_defaultList == null)
{
#if __ANDROID_28__
- _defaultList = bottomView.ItemTextColor ?? MakeColorStateList(title.ToAndroid().ToArgb(), disabled.ToAndroid().ToArgb(), unselected.ToAndroid().ToArgb());
+ _defaultList = bottomView.ItemTextColor ?? MakeColorStateList(titleColor.ToAndroid().ToArgb(), disabledColor.ToAndroid().ToArgb(), unselectedColor.ToAndroid().ToArgb());
#else
_defaultList = bottomView.ItemTextColor;
#endif
}
- var colorStateList = MakeColorStateList(title, disabled, unselected);
+ var colorStateList = MakeColorStateList(titleColor, disabledColor, unselectedColor);
bottomView.ItemTextColor = colorStateList;
bottomView.ItemIconTintList = colorStateList;
colorStateList.Dispose();
- SetBackgroundColor(bottomView, background);
+ SetBackgroundColor(bottomView, backgroundColor);
}
protected virtual void SetBackgroundColor(BottomNavigationView bottomView, Color color)
public void SetAppearance(UITabBarController controller, ShellAppearance appearance)
{
- var background = appearance.BackgroundColor;
- var foreground = appearance.ForegroundColor;
- var unselectedColor = appearance.UnselectedColor;
+ IShellAppearanceElement appearanceElement = appearance;
+ var backgroundColor = appearanceElement.EffectiveTabBarBackgroundColor;
+ var foregroundColor = appearanceElement.EffectiveTabBarForegroundColor; // currently unused
+ var disabledColor = appearanceElement.EffectiveTabBarDisabledColor; // unused on iOS
+ var unselectedColor = appearanceElement.EffectiveTabBarUnselectedColor;
+ var titleColor = appearanceElement.EffectiveTabBarTitleColor;
+
var tabBar = controller.TabBar;
if (_defaultTint == null)
_defaultUnselectedTint = tabBar.UnselectedItemTintColor;
}
- if (!background.IsDefault)
- tabBar.BarTintColor = background.ToUIColor();
- if (!foreground.IsDefault)
- tabBar.TintColor = foreground.ToUIColor();
+ if (!backgroundColor.IsDefault)
+ tabBar.BarTintColor = backgroundColor.ToUIColor();
+ if (!titleColor.IsDefault)
+ tabBar.TintColor = titleColor.ToUIColor();
if (!unselectedColor.IsDefault)
tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor();
}
public void SetAppearance(UITabBarController controller, ShellAppearance appearance)
{
- var background = appearance.BackgroundColor;
- var foreground = appearance.ForegroundColor;
- var titleColor = appearance.TitleColor;
- var disabledColor = appearance.DisabledColor;
- var unselectedColor = appearance.UnselectedColor;
+ IShellAppearanceElement el = appearance;
+ var backgroundColor = el.EffectiveTabBarBackgroundColor;
+ var foregroundColor = el.EffectiveTabBarForegroundColor;
+ var titleColor = el.EffectiveTabBarTitleColor;
+ var disabledColor = el.EffectiveTabBarDisabledColor;
+ var unselectedColor = el.EffectiveTabBarUnselectedColor;
+
var tabBar = controller.TabBar;
if (_blurView == null)
tabBar.InsertSubview(_colorView, 0);
tabBar.InsertSubview(_blurView, 0);
- if (!background.IsDefault)
- _colorView.BackgroundColor = background.ToUIColor();
- if (!foreground.IsDefault)
- tabBar.TintColor = foreground.ToUIColor();
+ if (!backgroundColor.IsDefault)
+ _colorView.BackgroundColor = backgroundColor.ToUIColor();
+ if (!foregroundColor.IsDefault)
+ tabBar.TintColor = foregroundColor.ToUIColor();
if (!unselectedColor.IsDefault)
tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor();
}
}
#region IDisposable Support
-
+
protected virtual void Dispose(bool disposing)
{
if (!_disposed)