Search in sources :

Example 6 with KeyguardAffordanceView

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

the class NotificationPanelView method onTrackingStopped.

@Override
protected void onTrackingStopped(boolean expand) {
    mFalsingManager.onTrackingStopped();
    super.onTrackingStopped(expand);
    if (expand) {
        mNotificationStackScroller.setOverScrolledPixels(0.0f, true, /* onTop */
        true);
    }
    mNotificationStackScroller.onPanelTrackingStopped();
    if (expand && (mStatusBar.getBarState() == StatusBarState.KEYGUARD || mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED)) {
        if (!mHintAnimationRunning) {
            mAfforanceHelper.reset(true);
        }
    }
    if (!expand && (mStatusBar.getBarState() == StatusBarState.KEYGUARD || mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED)) {
        KeyguardAffordanceView lockIcon = mKeyguardBottomArea.getLockIcon();
        lockIcon.setImageAlpha(0.0f, true, 100, Interpolators.FAST_OUT_LINEAR_IN, null);
        lockIcon.setImageScale(2.0f, true, 100, Interpolators.FAST_OUT_LINEAR_IN);
    }
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView)

Example 7 with KeyguardAffordanceView

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

the class KeyguardAffordanceHelper method updateIconsFromTranslation.

private void updateIconsFromTranslation(KeyguardAffordanceView targetView) {
    float absTranslation = Math.abs(mTranslation);
    float alpha = absTranslation / getMinTranslationAmount();
    // We interpolate the alpha of the other icons to 0
    float fadeOutAlpha = 1.0f - alpha;
    fadeOutAlpha = Math.max(0.0f, fadeOutAlpha);
    // We interpolate the alpha of the targetView to 1
    KeyguardAffordanceView otherView = targetView == mRightIcon ? mLeftIcon : mRightIcon;
    updateIconAlpha(targetView, alpha + fadeOutAlpha * targetView.getRestingAlpha(), false);
    updateIconAlpha(otherView, fadeOutAlpha * otherView.getRestingAlpha(), false);
    updateIconAlpha(mCenterIcon, fadeOutAlpha * mCenterIcon.getRestingAlpha(), false);
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView)

Example 8 with KeyguardAffordanceView

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

the class KeyguardAffordanceHelper method getAnimatorToRadius.

private ValueAnimator getAnimatorToRadius(final boolean right, int radius) {
    final KeyguardAffordanceView targetView = right ? mRightIcon : mLeftIcon;
    ValueAnimator animator = ValueAnimator.ofFloat(targetView.getCircleRadius(), radius);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float newRadius = (float) animation.getAnimatedValue();
            targetView.setCircleRadiusWithoutAnimation(newRadius);
            float translation = getTranslationFromRadius(newRadius);
            mTranslation = right ? -translation : translation;
            updateIconsFromTranslation(targetView);
        }
    });
    return animator;
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView) ValueAnimator(android.animation.ValueAnimator)

Example 9 with KeyguardAffordanceView

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

the class KeyguardAffordanceHelper method setTranslation.

private void setTranslation(float translation, boolean isReset, boolean animateReset) {
    translation = rightSwipePossible() ? translation : Math.max(0, translation);
    translation = leftSwipePossible() ? translation : Math.min(0, translation);
    float absTranslation = Math.abs(translation);
    if (translation != mTranslation || isReset) {
        KeyguardAffordanceView targetView = translation > 0 ? mLeftIcon : mRightIcon;
        KeyguardAffordanceView otherView = translation > 0 ? mRightIcon : mLeftIcon;
        float alpha = absTranslation / getMinTranslationAmount();
        // We interpolate the alpha of the other icons to 0
        float fadeOutAlpha = 1.0f - alpha;
        fadeOutAlpha = Math.max(fadeOutAlpha, 0.0f);
        boolean animateIcons = isReset && animateReset;
        boolean forceNoCircleAnimation = isReset && !animateReset;
        float radius = getRadiusFromTranslation(absTranslation);
        boolean slowAnimation = isReset && isBelowFalsingThreshold();
        if (!isReset) {
            updateIcon(targetView, radius, alpha + fadeOutAlpha * targetView.getRestingAlpha(), false, false, false, false);
        } else {
            updateIcon(targetView, 0.0f, fadeOutAlpha * targetView.getRestingAlpha(), animateIcons, slowAnimation, false, forceNoCircleAnimation);
        }
        updateIcon(otherView, 0.0f, fadeOutAlpha * otherView.getRestingAlpha(), animateIcons, slowAnimation, false, forceNoCircleAnimation);
        updateIcon(mCenterIcon, 0.0f, fadeOutAlpha * mCenterIcon.getRestingAlpha(), animateIcons, slowAnimation, false, forceNoCircleAnimation);
        mTranslation = translation;
    }
}
Also used : KeyguardAffordanceView(com.android.systemui.statusbar.KeyguardAffordanceView)

Example 10 with KeyguardAffordanceView

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

the class KeyguardAffordanceHelper method getAnimatorToRadius.

private ValueAnimator getAnimatorToRadius(final boolean right, int radius) {
    final KeyguardAffordanceView targetView = right ? mRightIcon : mLeftIcon;
    ValueAnimator animator = ValueAnimator.ofFloat(targetView.getCircleRadius(), radius);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float newRadius = (float) animation.getAnimatedValue();
            targetView.setCircleRadiusWithoutAnimation(newRadius);
            float translation = getTranslationFromRadius(newRadius);
            mTranslation = right ? -translation : translation;
            updateIconsFromTranslation(targetView);
        }
    });
    return animator;
}
Also used : 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