diff options
author | Rui Marinho <me@ruimarinho.net> | 2017-03-24 22:11:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 22:11:20 +0000 |
commit | 9dcce94937584e1ccbf52371736ee3b712f5107f (patch) | |
tree | d11544f3585205a3eccafe5fd9a0dbf4e901f5b2 /Xamarin.Forms.Platform.Android/AppCompat | |
parent | 349969f432ab0a85844d56b26d664beffb6f8a05 (diff) | |
download | xamarin-forms-9dcce94937584e1ccbf52371736ee3b712f5107f.tar.gz xamarin-forms-9dcce94937584e1ccbf52371736ee3b712f5107f.tar.bz2 xamarin-forms-9dcce94937584e1ccbf52371736ee3b712f5107f.zip |
[Android]Refactor to use a extension method to get the drawable (#841)
* [Android]Refactor to use a extension method to get the drawable
* [Android] Use local variable on check
Diffstat (limited to 'Xamarin.Forms.Platform.Android/AppCompat')
-rw-r--r-- | Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs index 1b4afba2..7fe1f1e8 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs @@ -744,9 +744,9 @@ namespace Xamarin.Forms.Platform.Android.AppCompat FileImageSource icon = item.Icon; if (!string.IsNullOrEmpty(icon)) { - Drawable iconBitmap = context.Resources.GetDrawable(icon) ?? new BitmapDrawable(context.Resources, ResourceManager.GetBitmap(context.Resources, icon)); - if (iconBitmap != null) - menuItem.SetIcon(iconBitmap); + Drawable iconDrawable = context.Resources.GetFormsDrawable(icon); + if (iconDrawable != null) + menuItem.SetIcon(iconDrawable); } menuItem.SetEnabled(controller.IsEnabled); menuItem.SetShowAsAction(ShowAsAction.Always); |