Most visited

Recently visited

Added in API level 21

Slide

public class Slide
extends Visibility

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


该转换跟踪对开始和结束场景中目标视图的可见性的更改,并将视图从场景的其中一个边缘移入或移出。 可见性由视图的setVisibility(int)状态以及它是否在当前视图层次结构中确定。 消失视图受到限制,如onDisappear(android.view.ViewGroup, TransitionValues, int, TransitionValues, int)

Summary

XML attributes

android:slideEdge  

Inherited XML attributes

From class android.transition.Visibility
From class android.transition.Transition

Inherited constants

From class android.transition.Visibility
From class android.transition.Transition

Public constructors

Slide()

构造函数使用默认的 BOTTOM滑动边缘方向。

Slide(int slideEdge)

构造函数使用提供的滑动边缘方向。

Slide(Context context, AttributeSet attrs)

Public methods

void captureEndValues(TransitionValues transitionValues)

在结束场景中捕获此转换监视的属性的值。

void captureStartValues(TransitionValues transitionValues)

捕获此转场监视的属性在开始场景中的值。

int getSlideEdge()

返回视图出现和消失的边缘。

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

此方法的默认实现将返回空Animator。

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

此方法的默认实现将返回空Animator。

void setSlideEdge(int slideEdge)

更改视图出现和消失的边缘。

Inherited methods

From class android.transition.Visibility
From class android.transition.Transition
From class java.lang.Object

XML attributes

android:slideEdge

相关方法:

Public constructors

Slide

Added in API level 21
Slide ()

构造函数使用默认的 BOTTOM滑动边缘方向。

Slide

Added in API level 21
Slide (int slideEdge)

构造函数使用提供的滑动边缘方向。

Parameters
slideEdge int

Slide

Added in API level 21
Slide (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

Public methods

captureEndValues

Added in API level 21
void captureEndValues (TransitionValues transitionValues)

在结束场景中捕获此转换监视的属性的值。 然后这些值作为endValues结构传递给createAnimator(ViewGroup, TransitionValues, TransitionValues) 实施的主要关注点是过渡期关注的属性以及所有这些属性的价值。 开始和结束值将在createAnimator(android.view.ViewGroup, TransitionValues, TransitionValues)方法后期进行比较,以确定应该运行哪些动画(如果有的话)。

子类必须实现此方法。 该方法只能由过渡系统调用; 它不打算从外部类中调用。

Parameters
transitionValues TransitionValues: The holder for any values that the Transition wishes to store. Values are stored in the values field of this TransitionValues object and are keyed from a String value. For example, to store a view's rotation value, a transition might call transitionValues.values.put("appname:transitionname:rotation", view.getRotation()). The target view will already be stored in the transitionValues structure when this method is called.

captureStartValues

Added in API level 21
void captureStartValues (TransitionValues transitionValues)

捕获此转场监视的属性在开始场景中的值。 然后这些值作为startValues结构在以后的调用中传递给createAnimator(ViewGroup, TransitionValues, TransitionValues) 实施的主要关注点是过渡期关注的属性以及所有这些属性的价值。 开始和结束值将在createAnimator(android.view.ViewGroup, TransitionValues, TransitionValues)方法后期进行比较,以确定应该运行哪些动画(如果有的话)。

子类必须实现此方法。 该方法只能由过渡系统调用; 它不打算从外部类中调用。

Parameters
transitionValues TransitionValues: The holder for any values that the Transition wishes to store. Values are stored in the values field of this TransitionValues object and are keyed from a String value. For example, to store a view's rotation value, a transition might call transitionValues.values.put("appname:transitionname:rotation", view.getRotation()). The target view will already be stored in the transitionValues structure when this method is called.

getSlideEdge

Added in API level 21
int getSlideEdge ()

返回视图出现和消失的边缘。

相关XML属性:

Returns
int the edge of the scene to use for Views appearing and disappearing. One of LEFT, TOP, RIGHT, BOTTOM, START, END.

onAppear

Added in API level 21
Animator onAppear (ViewGroup sceneRoot, 
                View view, 
                TransitionValues startValues, 
                TransitionValues endValues)

此方法的默认实现将返回空Animator。 子类应该重写此方法以使目标显示所需的转换。 该方法只能从onAppear(ViewGroup, TransitionValues, int, TransitionValues, int)

Parameters
sceneRoot ViewGroup: The root of the transition hierarchy
view View: The View to make appear. This will be in the target scene's View hierarchy and will be VISIBLE.
startValues TransitionValues: The target values in the start scene
endValues TransitionValues: The target values in the end scene
Returns
Animator 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.

onDisappear

Added in API level 21
Animator onDisappear (ViewGroup sceneRoot, 
                View view, 
                TransitionValues startValues, 
                TransitionValues endValues)

此方法的默认实现将返回空Animator。 子类应该重写此方法,使目标消失与所需的转换。 该方法只能从onDisappear(ViewGroup, TransitionValues, int, TransitionValues, int)

Parameters
sceneRoot ViewGroup: The root of the transition hierarchy
view 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 TransitionValues: The target values in the start scene
endValues TransitionValues: The target values in the end scene
Returns
Animator 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.

setSlideEdge

Added in API level 21
void setSlideEdge (int slideEdge)

更改视图出现和消失的边缘。

相关XML属性:

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

Hooray!