Package 

Class DrawableResource

  • All Implemented Interfaces:
    com.mobwith.imgmodule.load.engine.Initializable , com.mobwith.imgmodule.load.engine.Resource

    
    public abstract class DrawableResource<T extends Drawable>
     implements Resource<T>, Initializable
                        

    Simple wrapper for an Android Drawable which returns a new drawable based on it's state.

    Suggested usages only include {@code T}s where the new drawable is of the same or descendant class.

    • Method Summary

      Modifier and Type Method Description
      final T get() Returns an instance of the wrapped resource.
      void initialize() Called on a background thread so the Resource can do some eager initialization.
      • Methods inherited from class com.mobwith.imgmodule.load.engine.Resource

        get, getResourceClass, getSize, recycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DrawableResource

        DrawableResource(T drawable)
    • Method Detail

      • get

        @NonNull() final T get()

        Returns an instance of the wrapped resource.

        Note - This does not have to be the same instance of the wrapped resource class and in factit is often appropriate to return a new instance for each call. For example, Drawables should only be used by a single View at a time so each call to this method for Resources that wrap Drawables should always return a new Drawable.

      • initialize

         void initialize()

        Called on a background thread so the Resource can do some eager initialization.