PedrozaGlide Extension (Load images or gifs to be sponsored!)

GLIDE EXTENSION

Hello makers!

I am super excited to contribute to AppInventor and all its distributions! Here I present to you a new extension to load images in a fast and efficient way, media decoding, memory and disk caching using the Glide Library 4.3.1!

Event Handlers

  • ClearedCache: Event handler when the clearing cache method is finished.
    image

  • ErrorOccurred: Event handler when an error occurred loading the image or gif, and clearing the cache.
    image

Methods

  • Glide: Method for loading an image or gif using the Glide library. Parameters: Image input:The image component where the image or gif will be displayed. String path:The path or the URL to the image to be loaded. Number scalingOptions: Number to specify which scaling option is going to be used. One (1) for fitCenter, two (2) for centerCrop and three (3) for circleCrop. Number priority: Number to set the priority of the image. Zero (0) for NORMAL, one (1) for LOW, two (2) for IMMEDIATE and three (3) for HIGH.
    image

  • GlideWithOverride: Method for loading an image or gif using the Glide library with override options. Parameters: Image input: The image component where the image or gif will be displayed. String path: The path or the URL to the image to be loaded. Number scalingOptions: Number to specify which scaling option is going to be used. One (1) for fitCenter, two (2) for centerCrop and three (3) for circleCrop. Number width: Number with the width of the image to be loaded. Number height: Number with the height of the image to be loaded. Number priority: Number to set the priority of the image. Zero (0) for NORMAL, one (1) for LOW, two (2) for IMMEDIATE and three (3) for HIGH.
    image

  • ClearDiskCache: Method for clearing the Disk Cache.
    image

  • ClearMemoryCache: Method for clearing the Memory Cache.
    image

Properties

  • ErrorImage: Specifies the path to the image that will be displayed when an error occurs.
    image
    image

  • Fallback: Specifies the path to the image that will be displayed when a fallback occurs.
    image
    image

  • PlaceHolder: Specifies the path to the image that will be used as a placeholder, when the image is loading.
    image
    image

  • Quality: Specifies and returns the quality of the image to be loaded. It is a float number between 0 and 1. Default: 1.
    image
    image

  • SkipDiskCache: Specifies whether the Disk Cache should be skipped or not in the caching process. Default: true.
    image

  • SkipMemoryCache: Specifies whether the Memory Cache should be skipped or not in the caching process. Default: false.
    image

Best practices

  1. The main feature of this library is to load images from an url fast and efficiently, and also, caching it for later use in the memory. If you like to use an image located in your assets or in the disk, you can too.
  2. This extensions works better when using it with a image with height and width parameters previously set. It works well with fill_parent too, but try not to use automatic for better performance. For responsiveness, please use WidthPercent and HeightPercent.
  3. Also, my favourite scaling option is centerCrop (number 2) or circleCrop.
  4. Please use images that are stored in the assets or in the memory for placeholder, error and fallback. The glide library doesn’t use its features in these.
  5. If you are going to use a circleCrop scaling option and a placeholder, it is a known issue that the placeholder will be seen after loading the image if it isn’t a rounded image.

Note: This library has other functions that I will be integrating little by little, for example, using animations to display the image. But in this case, it is a better practice to use @Andres_Cotes’s animation extension, or AnimationPlus (paid extension). If you are developer and like to help, please contact me to work in future updates.

For other GifViewer Extension, check @Said-Dev’s extension.

Test this extension

APK
https://goo.gl/9GU69C (3.14MB)

Youtube Video
English subtitles

Blocks used

Downloads

To get this extension, please follow the instructions in this post.

Early access

If you want to get early access, you can donate at:


Also, you can donate to the App Inventor launch on iOS crowfunding campaign! Send me a screenshot of your contribution by PM and I will send to you the extension! (Your name should appear in the Donor Wall)

Spread the word!

Why support by sponsoring extensions?

  1. Sponsoring gives you the opportunity to reward the developer for its efforts made to bring a feature you like/need in your projects.
  2. Get early access
  3. Full support.
22 Likes

Updated:

  1. Video demonstration (with english subtitles but no voice), apk test AND blocks used.
  2. New ways to get early access and to liberate the extension for free!
4 Likes

Half the goal accomplished! And this is how it looks in my cellphone:
image
Thank you all! To celebrate this Black Week, if the goal is accomplished before Sunday, I will also liberate the source code! Keep the likes and comments going!

6 Likes

After testing this extension on companion app, companion app forced close itself.
Blocks ==
1 =


2 =

I am getting this error
java.lang.NoSuchFieldError: No static field AUTOMATIC of type Lcom/bumptech/glide/load/engine/DiskCacheStrategy; in class Lcom/bumptech/glide/load/engine/DiskCacheStrategy; or its superclasses (declaration of ‘com.bumptech.glide.load.engine.DiskCacheStrategy’ appears in base.apk!classes4.dex)

1 Like

please make it work with card view extension.

1 Like

hi abhi. Do u got any solution? i’m getting same error while using glide extension.

No, I didn’t use this extension

it wont allow to compile the apk. Any idea?

Explain about the problem so that developer can help you with a specific solution

i tried in an empty project for a test, import the extension, and compile apk, it compile sucess… after that i decided to import the extension in my main project that has enough components,blocks and other extension, i just drag in one of my screen, didnt touch a block yet, just for a test, then compile an apk, after 85% percent, compile error…

Conflicts with another extension, you would have to figure out which one tho

/Boban

i will try to find out, which extension extension, i also thought that mught be the problem… thats the last option i have, thanks!

1 Like

its not the extension, i have test it in an empty prject, doing 12 extension exported in the project… and figuring which one extension is conflict. and apk compile sucess… so extension with other extension… work good

How to create a loading effect like placeholder

can this error help where can be the error?

not wotk:broken_heart:

congratulations to your very constructive contribution (sarcasm)

what about providing some more details, what exactly does not work, any error message? which Android device/Android version are you using for your tests, etc… mention everything which could help the developer to improve the extension…

Taifun

It is not compatible with kodular :sweat_smile:

It does not look like you read the other contributions in this thread…
Also it does not look like you want to help to identify the issue, so the developer could fix it…
Taifun

3 Likes