Package icyllis.modernui.transition
Class SidePropagation
java.lang.Object
icyllis.modernui.transition.TransitionPropagation
icyllis.modernui.transition.VisibilityPropagation
icyllis.modernui.transition.SidePropagation
A
TransitionPropagation
that propagates based on the distance to the side
and, orthogonally, the distance to epicenter. If the transitioning View is visible in
the start of the transition, then it will transition sooner when closer to the side and
later when farther. If the view is not visible in the start of the transition, then
it will transition later when closer to the side and sooner when farther from the edge.
This is the default TransitionPropagation used with Slide
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
getStartDelay
(ViewGroup sceneRoot, Transition transition, TransitionValues startValues, TransitionValues endValues) Called by Transition to alter the Animator start delay.void
setPropagationSpeed
(float propagationSpeed) Sets the speed at which transition propagation happens, relative to the duration of the Transition.void
setSide
(int side) Sets the side that is used to calculate the transition propagation.Methods inherited from class icyllis.modernui.transition.VisibilityPropagation
captureValues, getPropagationProperties, getViewVisibility, getViewX, getViewY
-
Constructor Details
-
SidePropagation
public SidePropagation()
-
-
Method Details
-
setSide
public void setSide(int side) Sets the side that is used to calculate the transition propagation. If the transitioning View is visible in the start of the transition, then it will transition sooner when closer to the side and later when farther. If the view is not visible in the start of the transition, then it will transition later when closer to the side and sooner when farther from the edge. The default isGravity.BOTTOM
.- Parameters:
side
- The side that is used to calculate the transition propagation. Must be one ofGravity.LEFT
,Gravity.TOP
,Gravity.RIGHT
,Gravity.BOTTOM
,Gravity.START
, orGravity.END
.
-
setPropagationSpeed
public void setPropagationSpeed(float propagationSpeed) Sets the speed at which transition propagation happens, relative to the duration of the Transition. ApropagationSpeed
of 1 means that a View centered at the side set insetSide(int)
and View centered at the opposite edge will have a difference in start delay of approximately the duration of the Transition. A speed of 2 means the start delay difference will be approximately half of the duration of the transition. A value of 0 is illegal, but negative values will invert the propagation.- Parameters:
propagationSpeed
- 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.
-
getStartDelay
public long getStartDelay(@Nonnull ViewGroup sceneRoot, @Nonnull Transition transition, @Nullable TransitionValues startValues, @Nullable TransitionValues endValues) Description copied from class:TransitionPropagation
Called by Transition to alter the Animator start delay. All start delays will be adjusted such that the minimum becomes zero.- Specified by:
getStartDelay
in classTransitionPropagation
- Parameters:
sceneRoot
- The root of the View hierarchy running the transition.transition
- The transition that created the AnimatorstartValues
- The values for a specific target in the start scene.endValues
- The values for the target in the end scene.- Returns:
- A start delay to use with the Animator created by
transition
. The delay will be offset by the minimum delay of allTransitionPropagation
s used in the Transition so that the smallest delay will be 0. Returned values may be negative.
-