Class BitmapContainerTransitionFactory<R>

java.lang.Object
com.bumptech.glide.request.transition.BitmapContainerTransitionFactory<R>
Type Parameters:
R - The type of the composite object that contains the Bitmap to be transitioned.
All Implemented Interfaces:
TransitionFactory<R>
Direct Known Subclasses:
BitmapTransitionFactory

public abstract class BitmapContainerTransitionFactory<R> extends Object implements TransitionFactory<R>
A TransitionFactory for complex types that have a Bitmap inside. The transitioning bitmap is wrapped in a BitmapDrawable. Most commonly used with DrawableCrossFadeFactory.
  • Constructor Details

  • Method Details

    • build

      public Transition<R> build(DataSource dataSource, boolean isFirstResource)
      Description copied from interface: TransitionFactory
      Returns a new Transition.
      Specified by:
      build in interface TransitionFactory<R>
      Parameters:
      dataSource - The DataSource the resource was loaded from.
      isFirstResource - True if this is the first resource to be loaded into the target.
    • getBitmap

      protected abstract Bitmap getBitmap(R current)
      Retrieve the Bitmap from a composite object.

      Warning: Do not convert any arbitrary object to Bitmap via expensive drawing here, this method is called on the UI thread.

      Parameters:
      current - composite object containing a Bitmap and some other information
      Returns:
      the Bitmap contained within current