Most visited

Recently visited

Added in API level 21

SidePropagation

public class SidePropagation
extends VisibilityPropagation

java.lang.Object
   ↳ android.transition.TransitionPropagation
     ↳ android.transition.VisibilityPropagation
       ↳ android.transition.SidePropagation


一个TransitionPropagation ,基于到边的距离以及与震中的距离垂直传播。 如果转换视图在转换开始时可见,那么当转换视图靠近侧面时以及稍后转换时会更快转换。 如果视图在过渡开始时不可见,那么它将在靠近边时稍后过渡,并且在远离边缘时越早过渡。 这是与Slide使用的默认TransitionPropagation。

Summary

Public constructors

SidePropagation()

Public methods

long getStartDelay(ViewGroup sceneRoot, Transition transition, TransitionValues startValues, TransitionValues endValues)

由Transition调用以改变Animator启动延迟。

void setPropagationSpeed(float propagationSpeed)

设置转换传播发生的速度,相对于转换的持续时间。

void setSide(int side)

设置用于计算转场传播的一侧。

Inherited methods

From class android.transition.VisibilityPropagation
From class android.transition.TransitionPropagation
From class java.lang.Object

Public constructors

SidePropagation

Added in API level 21
SidePropagation ()

Public methods

getStartDelay

Added in API level 21
long getStartDelay (ViewGroup sceneRoot, 
                Transition transition, 
                TransitionValues startValues, 
                TransitionValues endValues)

由Transition调用以改变Animator启动延迟。 所有启动延迟将被调整,使得最小值变为零。

Parameters
sceneRoot ViewGroup: The root of the View hierarchy running the transition.
transition Transition: The transition that created the Animator
startValues TransitionValues: The values for a specific target in the start scene.
endValues TransitionValues: The values for the target in the end scene.
Returns
long A start delay to use with the Animator created by transition. The delay will be offset by the minimum delay of all TransitionPropagations used in the Transition so that the smallest delay will be 0. Returned values may be negative.

setPropagationSpeed

Added in API level 21
void setPropagationSpeed (float propagationSpeed)

设置转换传播发生的速度,相对于转换的持续时间。 1的propagationSpeed表示以setSide(int)设置的一侧为中心的视图和以相对边缘为中心的视图将具有与转换的持续时间大致相同的开始延迟。 速度2意味着启动延迟差将大约为转换持续时间的一半。 值0是非法的,但是负值会颠倒传播。

Parameters
propagationSpeed float: The speed at which propagation occurs, relative to the duration of the transition. A speed of 4 means it works 4 times as fast as the duration of the transition. May not be 0.

setSide

Added in API level 21
void setSide (int side)

设置用于计算转场传播的一侧。 如果转换视图在转换开始时可见,那么当转换视图靠近侧面时以及稍后转换时会更快转换。 如果视图在过渡开始时不可见,那么它将在靠近边时稍后过渡,并且在远离边缘时越早过渡。 默认值是BOTTOM

Parameters
side int: The side that is used to calculate the transition propagation. Must be one of LEFT, TOP, RIGHT, BOTTOM, START, or END.

Hooray!