summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorSoftlion (Benjamin Mayrargue) <benjamin@vapolia.fr>2017-09-12 14:09:38 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 04:30:51 (GMT)
commita5689472ef1fe9c2f301adf61d167dcc6fd95242 (patch)
tree7d3ba533a80c2e4abca5d558516709fa742f6ff0 /Xamarin.Forms.Platform.Android
parent89ae5eca1b8fabc6431fdc42c7cc1f96ff708bc6 (diff)
downloadxamarin-forms-a5689472ef1fe9c2f301adf61d167dcc6fd95242.zip
xamarin-forms-a5689472ef1fe9c2f301adf61d167dcc6fd95242.tar.gz
xamarin-forms-a5689472ef1fe9c2f301adf61d167dcc6fd95242.tar.bz2
Enables custom images (especially SVG) through the new IImageSourceHandler to work with tab bar icons on Android (like it does on iOS). And also on cell adapters and navigation page menu. (#1130)
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/ResourceManager.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/ResourceManager.cs b/Xamarin.Forms.Platform.Android/ResourceManager.cs
index 402e52b..f09f997 100644
--- a/Xamarin.Forms.Platform.Android/ResourceManager.cs
+++ b/Xamarin.Forms.Platform.Android/ResourceManager.cs
@@ -24,6 +24,11 @@ namespace Xamarin.Forms.Platform.Android
if(drawable == null)
{
var bitmap = GetBitmap(resource, file) ?? BitmapFactory.DecodeFile(file);
+ if (bitmap == null)
+ {
+ var source = Registrar.Registered.GetHandler<IImageSourceHandler>(fileImageSource.GetType());
+ bitmap = source.LoadImageAsync(fileImageSource, Forms.Context).GetAwaiter().GetResult();
+ }
if (bitmap != null)
drawable = new BitmapDrawable(resource, bitmap);
}