glidex.forms 1.0.3

A library containing Xamarin.Forms custom renderers to speed up images on Android. Based on Glide. Just add Android.Glide.Forms.Init(); after Xamarin.Forms.Forms.Init();

There is a newer version of this package available.
See the version list below for details.
Install-Package glidex.forms -Version 1.0.3
dotnet add package glidex.forms --version 1.0.3
<PackageReference Include="glidex.forms" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add glidex.forms --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: glidex.forms, 1.0.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install glidex.forms as a Cake Addin
#addin nuget:?package=glidex.forms&version=1.0.3

// Install glidex.forms as a Cake Tool
#tool nuget:?package=glidex.forms&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

glidex and glidex.forms

glidex is a minimalist Xamarin.Android binding of Glide. Google recommends Glide for simplifying the complexity of managing Android.Graphics.Bitmap within your apps (docs here).

glidex.forms is a prototype of what we can do to improve Xamarin.Forms image performance on Android by taking a dependency on Glide. See my post on the topic here.

We don't want or care to bind the entirety of Glide's public API surface. Our goal here is to just bind the "useful" APIs for Glide.

For example take the following C#:

var image = FindViewById<ImageView> (Resource.Id.testImage);
Glide.With (this)
    .Load ("https://botlist.co/system/BotList/Bot/logos/000/002/271/medium/chuck_norris.jpg")
    .Apply (RequestOptions.CircleCropTransform ().Placeholder (Android.Resource.Drawable.IcMenuCamera))
    .Into (image);

This code loads an image from a URL dynamically, taking care of all of Glide's cool caching functionality. These are the only APIs we need to make the library useful.

If you have a "classic" Xamarin.Android app that is not Xamarin.Forms, it could be useful to use the glidex NuGet package directly.

glidex is currently using the 4.7.0 release of Glide from Github

glidex.forms for Xamarin.Forms on Android

My goal with this repo is to get fast Images for Xamarin.Forms on Android by using Glide.

The new IImageViewHandler API in Xamarin.Forms 3.3.x, allows glidex.forms to operate without using any custom renderers!

But to set this library up in your existing project, merely:

  • Add the glidex.forms NuGet package
  • Add this one liner after your app's Forms.Init call:
Xamarin.Forms.Forms.Init (this, bundle);
//This forces the custom renderers to be used
Android.Glide.Forms.Init ();
LoadApplication (new App ());

How do I know my app is using Glide?

On first use, you may want to enable debug logging:

Android.Glide.Forms.Init (debug: true);

glidex.forms will print out log messages in your device log as to what is happening under the hood.

If you want to customize how Glide is used in your app, currently your option is to implement your own IImageViewHandler. See the GlideExtensions class for details.

Features

In my samples, I tested the following types of images:

  • ImageSource.FromFile with a temp file
  • ImageSource.FromFile with AndroidResource
  • ImageSource.FromResource with EmbeddedResource
  • ImageSource.FromUri with web URLs
  • ImageSource.FromStream with AndroidAsset

glidex and glidex.forms

glidex is a minimalist Xamarin.Android binding of Glide. Google recommends Glide for simplifying the complexity of managing Android.Graphics.Bitmap within your apps (docs here).

glidex.forms is a prototype of what we can do to improve Xamarin.Forms image performance on Android by taking a dependency on Glide. See my post on the topic here.

We don't want or care to bind the entirety of Glide's public API surface. Our goal here is to just bind the "useful" APIs for Glide.

For example take the following C#:

var image = FindViewById<ImageView> (Resource.Id.testImage);
Glide.With (this)
    .Load ("https://botlist.co/system/BotList/Bot/logos/000/002/271/medium/chuck_norris.jpg")
    .Apply (RequestOptions.CircleCropTransform ().Placeholder (Android.Resource.Drawable.IcMenuCamera))
    .Into (image);

This code loads an image from a URL dynamically, taking care of all of Glide's cool caching functionality. These are the only APIs we need to make the library useful.

If you have a "classic" Xamarin.Android app that is not Xamarin.Forms, it could be useful to use the glidex NuGet package directly.

glidex is currently using the 4.7.0 release of Glide from Github

glidex.forms for Xamarin.Forms on Android

My goal with this repo is to get fast Images for Xamarin.Forms on Android by using Glide.

The new IImageViewHandler API in Xamarin.Forms 3.3.x, allows glidex.forms to operate without using any custom renderers!

But to set this library up in your existing project, merely:

  • Add the glidex.forms NuGet package
  • Add this one liner after your app's Forms.Init call:
Xamarin.Forms.Forms.Init (this, bundle);
//This forces the custom renderers to be used
Android.Glide.Forms.Init ();
LoadApplication (new App ());

How do I know my app is using Glide?

On first use, you may want to enable debug logging:

Android.Glide.Forms.Init (debug: true);

glidex.forms will print out log messages in your device log as to what is happening under the hood.

If you want to customize how Glide is used in your app, currently your option is to implement your own IImageViewHandler. See the GlideExtensions class for details.

Features

In my samples, I tested the following types of images:

  • ImageSource.FromFile with a temp file
  • ImageSource.FromFile with AndroidResource
  • ImageSource.FromResource with EmbeddedResource
  • ImageSource.FromUri with web URLs
  • ImageSource.FromStream with AndroidAsset

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on glidex.forms:

Repository Stars
jamesmontemagno/Hanselman.Forms
The most awesome Hanselman app
jamesmontemagno/MediaPlugin
Take & Pick Photos and Video Plugin for Xamarin and Windows
roubachof/Xamarin-Forms-Practices
Collection of good practices for Xamarin forms developement
o1298098/Xamarin-CloudMusic
Xamarin.Forms goodlooking UI sample
jsuarezruiz/xamarin-forms-perf-playground
Xamarin.Forms Performance Playground (Layouts, Bindings, XAMLC, etc)

Version History

Version Downloads Last updated
2.1.0.470 16,519 7/7/2020
2.0.1.394 20,823 1/12/2020
2.0.0.336 4,967 9/24/2019
2.0.0-pre1 451 6/23/2019
1.0.4 9,705 2/15/2019
1.0.3 4,637 10/30/2018
1.0.3-pre 401 10/15/2018
1.0.2 691 8/19/2018
1.0.1 535 7/12/2018
1.0.0 718 3/16/2018
0.1.0-beta 539 3/2/2018
Show less