Search in sources :

Example 31 with KeyguardAffordanceView

use of com.android.systemui.statusbar.KeyguardAffordanceView in project android_frameworks_base by AOSPA.

the class KeyguardAffordanceHelper method launchAffordance.

public void launchAffordance(boolean animate, boolean left) {
    if (mSwipingInProgress) {
        // We don't want to mess with the state if the user is actually swiping already.
        return;
    }
    KeyguardAffordanceView targetView = left ? mLeftIcon : mRightIcon;
    KeyguardAffordanceView otherView = left ? mRightIcon : mLeftIcon;
    startSwiping(targetView);
    if (animate) {
        fling(0, false, !left);
        updateIcon(otherView, 0.0f, 0, true, false, true, false);
        updateIcon(mCenterIcon, 0.0f, 0, true, false, true, false);
    } else {
        mCallback.onAnimationToSideStarted(!left, mTranslation, 0);
        mTranslation = left ? mCallback.getMaxTranslationDistance() : mCallback.getMaxTranslationDistance();
        updateIcon(mCenterIcon, 0.0f, 0.0f, false, false, true, false);
        updateIcon(otherView, 0.0f, 0.0f, false, false, true, false);
        targetView.instantFinishAnimation();
        mFlingEndListener.onAnimationEnd(null);
        mAnimationEndRunnable.run();
    }
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView)

Example 32 with KeyguardAffordanceView

use of com.android.systemui.statusbar.KeyguardAffordanceView in project android_frameworks_base by ResurrectionRemix.

the class NotificationPanelView method updateUnlockIcon.

private void updateUnlockIcon() {
    if (mStatusBar.getBarState() == StatusBarState.KEYGUARD || mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED) {
        boolean active = getMaxPanelHeight() - getExpandedHeight() > mUnlockMoveDistance;
        KeyguardAffordanceView lockIcon = mKeyguardBottomArea.getLockIcon();
        if (active && !mUnlockIconActive && mTracking) {
            lockIcon.setImageAlpha(1.0f, true, 150, Interpolators.FAST_OUT_LINEAR_IN, null);
            lockIcon.setImageScale(LOCK_ICON_ACTIVE_SCALE, true, 150, Interpolators.FAST_OUT_LINEAR_IN);
        } else if (!active && mUnlockIconActive && mTracking) {
            lockIcon.setImageAlpha(lockIcon.getRestingAlpha(), true, /* animate */
            150, Interpolators.FAST_OUT_LINEAR_IN, null);
            lockIcon.setImageScale(1.0f, true, 150, Interpolators.FAST_OUT_LINEAR_IN);
        }
        mUnlockIconActive = active;
    }
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView)

Example 33 with KeyguardAffordanceView

use of com.android.systemui.statusbar.KeyguardAffordanceView in project android_frameworks_base by DirtyUnicorns.

the class KeyguardAffordanceHelper method startFinishingCircleAnimation.

private void startFinishingCircleAnimation(float velocity, Runnable mAnimationEndRunnable, boolean right) {
    KeyguardAffordanceView targetView = right ? mRightIcon : mLeftIcon;
    targetView.finishAnimation(velocity, mAnimationEndRunnable);
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView)

Example 34 with KeyguardAffordanceView

use of com.android.systemui.statusbar.KeyguardAffordanceView in project android_frameworks_base by DirtyUnicorns.

the class KeyguardAffordanceHelper method launchAffordance.

public void launchAffordance(boolean animate, boolean left) {
    if (mSwipingInProgress) {
        // We don't want to mess with the state if the user is actually swiping already.
        return;
    }
    KeyguardAffordanceView targetView = left ? mLeftIcon : mRightIcon;
    KeyguardAffordanceView otherView = left ? mRightIcon : mLeftIcon;
    startSwiping(targetView);
    if (animate) {
        fling(0, false, !left);
        updateIcon(otherView, 0.0f, 0, true, false, true, false);
        updateIcon(mCenterIcon, 0.0f, 0, true, false, true, false);
    } else {
        mCallback.onAnimationToSideStarted(!left, mTranslation, 0);
        mTranslation = left ? mCallback.getMaxTranslationDistance() : mCallback.getMaxTranslationDistance();
        updateIcon(mCenterIcon, 0.0f, 0.0f, false, false, true, false);
        updateIcon(otherView, 0.0f, 0.0f, false, false, true, false);
        targetView.instantFinishAnimation();
        mFlingEndListener.onAnimationEnd(null);
        mAnimationEndRunnable.run();
    }
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView)

Example 35 with KeyguardAffordanceView

use of com.android.systemui.statusbar.KeyguardAffordanceView in project android_frameworks_base by DirtyUnicorns.

the class KeyguardAffordanceHelper method startHintAnimationPhase1.

private void startHintAnimationPhase1(final boolean right, final Runnable onFinishedListener) {
    final KeyguardAffordanceView targetView = right ? mRightIcon : mLeftIcon;
    ValueAnimator animator = getAnimatorToRadius(right, mHintGrowAmount);
    animator.addListener(new AnimatorListenerAdapter() {

        private boolean mCancelled;

        @Override
        public void onAnimationCancel(Animator animation) {
            mCancelled = true;
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            if (mCancelled) {
                mSwipeAnimator = null;
                mTargetedView = null;
                onFinishedListener.run();
            } else {
                startUnlockHintAnimationPhase2(right, onFinishedListener);
            }
        }
    });
    animator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
    animator.setDuration(HINT_PHASE1_DURATION);
    animator.start();
    mSwipeAnimator = animator;
    mTargetedView = targetView;
}
Also used : Animator(android.animation.Animator) ValueAnimator(android.animation.ValueAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView) ValueAnimator(android.animation.ValueAnimator)

Aggregations

KeyguardAffordanceView (com.android.systemui.statusbar.KeyguardAffordanceView)40 ValueAnimator (android.animation.ValueAnimator)10 Animator (android.animation.Animator)5 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)5