Package 

Class DrawableCrossFadeTransition

  • All Implemented Interfaces:
    com.mobwith.imgmodule.request.transition.Transition

    
    public class DrawableCrossFadeTransition
     implements Transition<Drawable>
                        

    A cross fade Transition for Drawables that uses an TransitionDrawable to transition from an existing drawable already visible on the target to a new drawable. If no existing drawable exists, this class can instead fall back to a default animation that doesn't rely on .

    • Method Summary

      Modifier and Type Method Description
      boolean transition(Drawable current, Transition.ViewAdapter adapter) Animates from the previous drawable to the current drawable in one of two ways.
      • Methods inherited from class com.mobwith.imgmodule.request.transition.Transition

        transition
      • Methods inherited from class java.lang.Object

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

      • DrawableCrossFadeTransition

        DrawableCrossFadeTransition(int duration, boolean isCrossFadeEnabled)
        Parameters:
        duration - The duration that the cross fade animation should run if there is something tocross fade from when a new Drawable is put.
        isCrossFadeEnabled - If {@code true}, animates the previous resource's alpha to 0 whileanimating the new resource's alpha to 100.
    • Method Detail

      • transition

         boolean transition(Drawable current, Transition.ViewAdapter adapter)

        Animates from the previous drawable to the current drawable in one of two ways.

        • Using the default animation provided in the constructor if the previous drawable is null
        • Using the cross fade animation with the duration provided in the constructor if theprevious drawable is non null
        Parameters:
        current - The new resource that will be displayed in the view.
        adapter - The ViewAdapter wrapping a view that can at least return anView from getView.