Most visited

Recently visited

Added in API level 21

Explode

public class Explode
extends Visibility

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


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

如果没有提供震中,视图将从焦点视图或场景中心移开。

Summary

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

Explode()
Explode(Context context, AttributeSet attrs)

Public methods

void captureEndValues(TransitionValues transitionValues)

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

void captureStartValues(TransitionValues transitionValues)

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

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

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

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

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

Inherited methods

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

Public constructors

Explode

Added in API level 21
Explode ()

Explode

Added in API level 21
Explode (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)

捕获此转场监视的属性在开始场景中的值。 这些值然后在以后调用createAnimator(ViewGroup, 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.

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.

Hooray!