Package 

Class FirebaseImageLoader

  • All Implemented Interfaces:
    com.bumptech.glide.load.model.ModelLoader

    
    public class FirebaseImageLoader
     implements ModelLoader<StorageReference, InputStream>
                        

    ModelLoader implementation to download images from FirebaseStorage with Glide.

    First, register this class in your AppGlideModule:

            {@literal @}Override
            public void registerComponents(Context context, Registry registry) {
                // Register FirebaseImageLoader to handle StorageReference
                registry.append(StorageReference.class, InputStream.class,
                        new FirebaseImageLoader.Factory());
            }
    

    Then load a StorageReference into an ImageView.

        StorageReference ref = FirebaseStorage.getInstance().getReference().child("myimage");
        ImageView iv = (ImageView) findViewById(R.id.my_image_view);
    
        GlideApp.with(this)
            .load(ref)
            .into(iv);
    
    • Method Summary

      Modifier and Type Method Description
      ModelLoader.LoadData<InputStream> buildLoadData(@NonNull() StorageReference reference, int height, int width, @NonNull() Options options)
      boolean handles(@NonNull() StorageReference reference)
      • Methods inherited from class com.bumptech.glide.load.model.ModelLoader

        buildLoadData, handles
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait