Skip to content

Commit

Permalink
Fix NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavAntonyuk committed Nov 21, 2024
1 parent dc63095 commit 45a2e22
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class CustomShellBottomNavViewAppearanceTracker(IShellContext shellCont
public override void SetAppearance(BottomNavigationView bottomView, IShellAppearanceElement appearance)
{
base.SetAppearance(bottomView, appearance);
if (Shell.GetTabBarIsVisible(shellContext.Shell.CurrentPage))
if (Shell.GetTabBarIsVisible(shellContext.Shell.CurrentItem))
{
var backgroundDrawable = new GradientDrawable();
backgroundDrawable.SetShape(ShapeType.Rectangle);
Expand All @@ -37,6 +37,6 @@ public override void SetAppearance(BottomNavigationView bottomView, IShellAppear
protected override void SetBackgroundColor(BottomNavigationView bottomView, Color color)
{
base.SetBackgroundColor(bottomView, color);
bottomView.RootView?.SetBackgroundColor(shellContext.Shell.CurrentPage.BackgroundColor.ToPlatform());
bottomView.RootView?.SetBackgroundColor(shellContext.Shell.CurrentItem.BackgroundColor.ToPlatform());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class CustomShellToolbarAppearanceTracker(IShellContext shellContext)
public override void SetAppearance(Toolbar toolbar, IShellToolbarTracker toolbarTracker, ShellAppearance appearance)
{
base.SetAppearance(toolbar, toolbarTracker, appearance);
if (Shell.GetNavBarIsVisible(shellContext.Shell.CurrentPage))
if (Shell.GetNavBarIsVisible(shellContext.Shell.CurrentItem))
{
var backgroundDrawable = new GradientDrawable();
backgroundDrawable.SetShape(ShapeType.Rectangle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public void ResetAppearance(UINavigationController controller)
public void SetAppearance(UINavigationController controller, ShellAppearance appearance)
{
baseTracker.SetAppearance(controller, appearance);
if (controller.View is not null && shellContext.Shell.CurrentPage is not null)
if (controller.View is not null && shellContext.Shell.CurrentItem is not null)
{
controller.View.BackgroundColor = shellContext.Shell.CurrentPage.BackgroundColor.ToPlatform();
controller.View.BackgroundColor = shellContext.Shell.CurrentItem.BackgroundColor.ToPlatform();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public void ResetAppearance(UINavigationController controller)
public void SetAppearance(UINavigationController controller, ShellAppearance appearance)
{
baseTracker.SetAppearance(controller, appearance);
if (controller.View is not null && shellContext.Shell.CurrentPage is not null)
if (controller.View is not null && shellContext.Shell.CurrentItem is not null)
{
controller.View.BackgroundColor = shellContext.Shell.CurrentPage.BackgroundColor.ToPlatform();
controller.View.BackgroundColor = shellContext.Shell.CurrentItem.BackgroundColor.ToPlatform();
}
}

Expand Down

0 comments on commit 45a2e22

Please sign in to comment.