Android APIs
public class

Slide

extends Visibility
java.lang.Object
   ↳ android.transition.Transition
     ↳ android.transition.Visibility
       ↳ android.transition.Slide

Class Overview

This transition tracks changes to the visibility of target views in the start and end scenes and moves views in or out from one of the edges of the scene. Visibility is determined by both the setVisibility(int) state of the view as well as whether it is parented in the current view hierarchy. Disappearing Views are limited as described in onDisappear(android.view.ViewGroup, TransitionValues, int, TransitionValues, int).

Summary

[Expand]
Inherited XML Attributes
From class android.transition.Transition
[Expand]
Inherited Constants
From class android.transition.Transition
Public Constructors
Slide()
Constructor using the default BOTTOM slide edge direction.
Slide(int slideEdge)
Constructor using the provided slide edge direction.
Public Methods
Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)
The default implementation of this method returns a null Animator.
Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)
The default implementation of this method returns a null Animator.
void setSlideEdge(int slideEdge)
Change the edge that Views appear and disappear from.
[Expand]
Inherited Methods
From class android.transition.Visibility
From class android.transition.Transition
From class java.lang.Object

Public Constructors

public Slide ()

Constructor using the default BOTTOM slide edge direction.

public Slide (int slideEdge)

Constructor using the provided slide edge direction.

Public Methods

public Animator onAppear (ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)

The default implementation of this method returns a null Animator. Subclasses should override this method to make targets appear with the desired transition. The method should only be called from onAppear(ViewGroup, TransitionValues, int, TransitionValues, int).

Parameters
sceneRoot The root of the transition hierarchy
view The View to make appear. This will be in the target scene's View hierarchy and will be VISIBLE.
startValues The target values in the start scene
endValues The target values in the end scene
Returns
  • An Animator to be started at the appropriate time in the overall transition for this scene change. A null value means no animation should be run.

public Animator onDisappear (ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)

The default implementation of this method returns a null Animator. Subclasses should override this method to make targets disappear with the desired transition. The method should only be called from onDisappear(ViewGroup, TransitionValues, int, TransitionValues, int).

Parameters
sceneRoot The root of the transition hierarchy
view The View to make disappear. This will be in the target scene's View hierarchy or in an ViewGroupOverlay and will be VISIBLE.
startValues The target values in the start scene
endValues The target values in the end scene
Returns
  • An Animator to be started at the appropriate time in the overall transition for this scene change. A null value means no animation should be run.

public void setSlideEdge (int slideEdge)

Change the edge that Views appear and disappear from.

Parameters
slideEdge The edge of the scene to use for Views appearing and disappearing. One of LEFT, TOP, RIGHT, BOTTOM.