calculateCameraAnimationHint

fun AnimatorSet.calculateCameraAnimationHint(fractions: List<Float>, startCameraState: CameraState? = null): CameraAnimationHint?

Calculates camera animation hints for provided AnimatorSet at specified fractions. This API must be called right before the animation is started: moving camera in-between should be avoided.

Requirements:

  1. AnimatorSet must have startDelay = 0 (TODO support non-zero startDelay). However, a child animator is allowed to have a non-zero startDelay.

  2. All child animations must be instances of CameraAnimator.

  3. None of the child animations are allowed to have infinite duration. Note: AnimatorSet itself may have infinite duration.

If AnimatorSet has zero duration, no camera animation hints are calculated: null is returned.

Return

CameraAnimationHint object, null if calculation could not be performed

Parameters

fractions

list of fractions at which to calculate intermediate camera states

startCameraState

start value of the animations. Must be provided in case your AnimatorSet's child animators do not have a startValue.


fun <T : CameraAnimator<*>> List<T>.calculateCameraAnimationHint(fractions: List<Float>, startCameraState: CameraState? = null): CameraAnimationHint?

Calculates camera animation hints for provided list of Animator at specified fractions. This API must be called right before the animation is started: moving camera in-between should be avoided.

Requirements:

  1. None of the animations are allowed to have infinite duration.

If all animators have zero duration, no camera animation hints are calculated: null is returned.

Return

CameraAnimationHint object, null if calculation could not be performed

Parameters

fractions

list of fractions at which to calculate intermediate camera states

startCameraState

start value of the animations. Must be provided in case your AnimatorSet's child animators do not have a startValue.