VisibilityPropagation


abstract class VisibilityPropagation : TransitionPropagation

Known direct subclasses
CircularPropagation

A propagation that varies with the distance to the epicenter of the Transition or center of the scene if no epicenter exists.

SidePropagation

A TransitionPropagation that propagates based on the distance to the side and, orthogonally, the distance to epicenter.


Base class for TransitionPropagations that care about View Visibility and the center position of the View.

Summary

Public constructors

Public functions

Unit
captureValues(transitionValues: TransitionValues)

Captures the values in the start or end scene for the properties that this transition propagation monitors.

Array<String!>?

Returns the set of property names stored in the TransitionValues object passed into captureValues that this transition propagation cares about for the purposes of preventing duplicate capturing of property values.

Int

Returns getVisibility for the View at the time the values were captured.

Int

Returns the View's center x coordinate, relative to the screen, at the time the values were captured.

Int

Returns the View's center y coordinate, relative to the screen, at the time the values were captured.

Inherited functions

From androidx.transition.TransitionPropagation
abstract Long
getStartDelay(
    sceneRoot: ViewGroup,
    transition: Transition,
    startValues: TransitionValues?,
    endValues: TransitionValues?
)

Called by Transition to alter the Animator start delay.

Public constructors

VisibilityPropagation

Added in 1.0.0
VisibilityPropagation()

Public functions

captureValues

Added in 1.5.1
fun captureValues(transitionValues: TransitionValues): Unit

Captures the values in the start or end scene for the properties that this transition propagation monitors. These values are then passed as the startValues or endValues structure in a later call to getStartDelay. The main concern for an implementation is what the properties are that the transition cares about and what the values are for all of those properties. The start and end values will be compared later during the getStartDelay. method to determine the start delay.

Subclasses must implement this method. The method should only be called by the transition system; it is not intended to be called from external classes.

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.

getPropagationProperties

Added in 1.5.1
fun getPropagationProperties(): Array<String!>?

Returns the set of property names stored in the TransitionValues object passed into captureValues that this transition propagation cares about for the purposes of preventing duplicate capturing of property values.

A TransitionPropagation must override this method to prevent duplicate capturing of values and must contain at least one

Returns
Array<String!>?

An array of property names as described in the class documentation for TransitionValues.

getViewVisibility

Added in 1.0.0
fun getViewVisibility(values: TransitionValues?): Int

Returns getVisibility for the View at the time the values were captured.

Parameters
values: TransitionValues?

The TransitionValues captured at the start or end of the Transition.

Returns
Int

getVisibility for the View at the time the values were captured.

getViewX

Added in 1.0.0
fun getViewX(values: TransitionValues?): Int

Returns the View's center x coordinate, relative to the screen, at the time the values were captured.

Parameters
values: TransitionValues?

The TransitionValues captured at the start or end of the Transition.

Returns
Int

the View's center x coordinate, relative to the screen, at the time the values were captured.

getViewY

Added in 1.0.0
fun getViewY(values: TransitionValues?): Int

Returns the View's center y coordinate, relative to the screen, at the time the values were captured.

Parameters
values: TransitionValues?

The TransitionValues captured at the start or end of the Transition.

Returns
Int

the View's center y coordinate, relative to the screen, at the time the values were captured.