diff options
author | adrianknight89 <adrianknight89@outlook.com> | 2016-11-03 13:38:38 -0500 |
---|---|---|
committer | Samantha Houts <samantha@teamredwall.com> | 2016-11-03 11:38:38 -0700 |
commit | 84995a921221811d2e7047d54dcefde0c8063397 (patch) | |
tree | 5868bf9bd5ffd6dd2fb0c8d8b22fd8728b9c4764 /Xamarin.Forms.Platform.Android/AppCompat | |
parent | a2fae62d8384f78c1b5f0ba3dc088000946479bc (diff) | |
download | xamarin-forms-84995a921221811d2e7047d54dcefde0c8063397.tar.gz xamarin-forms-84995a921221811d2e7047d54dcefde0c8063397.tar.bz2 xamarin-forms-84995a921221811d2e7047d54dcefde0c8063397.zip |
[Android] Allow path-based icons to be loaded as toolbar icons (#437)
* Created a bitmap method to check for resource as well as path
* Update platform and navigationrenderer to get images from two locations
* CellAdapter could use path-based icon finding
* sample app to test toolbaritem icons
Diffstat (limited to 'Xamarin.Forms.Platform.Android/AppCompat')
-rw-r--r-- | Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs index b77063ee..dc3c5666 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs @@ -709,8 +709,8 @@ namespace Xamarin.Forms.Platform.Android.AppCompat FileImageSource icon = item.Icon; if (!string.IsNullOrEmpty(icon)) { - Drawable iconBitmap = context.Resources.GetDrawable(icon); - if (iconBitmap != null) + var iconBitmap = new BitmapDrawable(context.Resources, ResourceManager.GetBitmap(context.Resources, icon)); + if (iconBitmap != null && iconBitmap.Bitmap != null) menuItem.SetIcon(iconBitmap); } menuItem.SetEnabled(controller.IsEnabled); |