Search in sources :

Example 1 with AnimatedHoverAnchor

use of com.android.tools.sherpa.animation.AnimatedHoverAnchor in project android by JetBrains.

the class SceneDraw method setCurrentUnderneathAnchor.

/**
     * Start an animation for the current anchor (under the mouse)
     *
     * @param underneathAnchor
     */
public void setCurrentUnderneathAnchor(ConstraintAnchor underneathAnchor) {
    if (mCurrentUnderneathAnchor != underneathAnchor) {
        mCurrentUnderneathAnchor = underneathAnchor;
        mChoreographer.removeAnimation(mAnimationCurrentAnchor);
        if (mCurrentUnderneathAnchor != null) {
            ConstraintHandle constraintHandle = WidgetInteractionTargets.constraintHandle(mCurrentUnderneathAnchor);
            mAnimationCurrentAnchor = new AnimatedHoverAnchor(mColorSet, constraintHandle);
            mChoreographer.addAnimation(mAnimationCurrentAnchor);
        } else {
            mAnimationCurrentAnchor = null;
        }
    }
}
Also used : AnimatedHoverAnchor(com.android.tools.sherpa.animation.AnimatedHoverAnchor) ConstraintHandle(com.android.tools.sherpa.interaction.ConstraintHandle)

Aggregations

AnimatedHoverAnchor (com.android.tools.sherpa.animation.AnimatedHoverAnchor)1 ConstraintHandle (com.android.tools.sherpa.interaction.ConstraintHandle)1