Browse Source

Minor cold clean up to avoid unnecessary code execution

pull/200/head
Ahmed Aderopo Alejo 7 years ago
committed by GitHub
parent
commit
6950839d77
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomNavigationPageRenderer.cs

+ 6
- 6
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomNavigationPageRenderer.cs View File

@ -12,17 +12,17 @@ namespace eShopOnContainers.Droid.Renderers
{ {
base.OnLayout(changed, l, t, r, b); base.OnLayout(changed, l, t, r, b);
if (Element.CurrentPage == null)
{
return;
}
var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
if (toolbar != null) if (toolbar != null)
{ {
var image = toolbar.FindViewById<ImageView>(Resource.Id.toolbar_image); var image = toolbar.FindViewById<ImageView>(Resource.Id.toolbar_image);
if (Element.CurrentPage == null)
{
return;
}
if (!string.IsNullOrEmpty(Element.CurrentPage.Title)) if (!string.IsNullOrEmpty(Element.CurrentPage.Title))
image.Visibility = Android.Views.ViewStates.Invisible; image.Visibility = Android.Views.ViewStates.Invisible;
else else
@ -30,4 +30,4 @@ namespace eShopOnContainers.Droid.Renderers
} }
} }
} }
}
}

Loading…
Cancel
Save