Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56d007b9 authored by John Spurlock's avatar John Spurlock
Browse files

Manage keyguard nav elements using transitions.

Move the logic for managing dimming the navigation bar
elements on the lockscreen into BarTransitions.

Replace search light + camera assets with new
versions at full brightness, and apply 50% dimming
at runtime, including the IME dismiss button.

Remove unused StatusBarManager _NOP hints.

Improve choreography between camera button +
password security (w/ IME).  Fix a few found bugs
in PagedView.

Improve password security unlock transition, manually
fade in back along with the rest of the icons.

Bug:11221659
Change-Id: Ifd1f8c9f400d90542f0ca858b9a4deacabbd518a
parent e6411e68
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -58,10 +58,7 @@ public class StatusBarManager {
            | DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK
            | DISABLE_SEARCH;

    public static final int NAVIGATION_HINT_BACK_NOP      = 1 << 0;
    public static final int NAVIGATION_HINT_HOME_NOP      = 1 << 1;
    public static final int NAVIGATION_HINT_RECENT_NOP    = 1 << 2;
    public static final int NAVIGATION_HINT_BACK_ALT      = 1 << 3;
    public static final int NAVIGATION_HINT_BACK_ALT      = 1 << 0;

    public static final int WINDOW_STATUS_BAR = 1;
    public static final int WINDOW_NAVIGATION_BAR = 2;
+21 −2
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@
 */
package com.android.keyguard;

import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.AnimatorListenerAdapter;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
@@ -46,6 +49,20 @@ public class KeyguardViewStateManager implements

    int mChallengeTop = 0;

    private final AnimatorListener mPauseListener = new AnimatorListenerAdapter() {
        public void onAnimationEnd(Animator animation) {
            mKeyguardSecurityContainer.onPause();
        }
    };

    private final AnimatorListener mResumeListener = new AnimatorListenerAdapter() {
        public void onAnimationEnd(Animator animation) {
            if (((View)mKeyguardSecurityContainer).isShown()) {
                mKeyguardSecurityContainer.onResume(0);
            }
        }
    };

    public KeyguardViewStateManager(KeyguardHostView hostView) {
        mKeyguardHostView = hostView;
    }
@@ -102,11 +119,13 @@ public class KeyguardViewStateManager implements
    }

    public void fadeOutSecurity(int duration) {
        ((View) mKeyguardSecurityContainer).animate().alpha(0f).setDuration(duration).start();
        ((View) mKeyguardSecurityContainer).animate().alpha(0f).setDuration(duration)
                .setListener(mPauseListener).start();
    }

    public void fadeInSecurity(int duration) {
        ((View) mKeyguardSecurityContainer).animate().alpha(1f).setDuration(duration).start();
        ((View) mKeyguardSecurityContainer).animate().alpha(1f).setDuration(duration)
                .setListener(mResumeListener).start();
    }

    public void onPageBeginMoving() {
+25 −7
Original line number Diff line number Diff line
@@ -267,6 +267,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc

    private boolean mIsCameraEvent;
    private float mWarpPeekAmount;
    private boolean mOnPageEndWarpCalled;
    private boolean mOnPageBeginWarpCalled;

    public interface PageSwitchListener {
        void onPageSwitching(View newPage, int newPageIndex);
@@ -491,7 +493,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        if (!mIsPageMoving) {
            mIsPageMoving = true;
            if (isWarping()) {
                onPageBeginWarp();
                dispatchOnPageBeginWarp();
                if (mPageSwapIndex != -1) {
                    swapPages(mPageSwapIndex, mPageWarpIndex);
                }
@@ -500,6 +502,22 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        }
    }

    private void dispatchOnPageBeginWarp() {
        if (!mOnPageBeginWarpCalled) {
            onPageBeginWarp();
            mOnPageBeginWarpCalled = true;
        }
        mOnPageEndWarpCalled = false;
    }

    private void dispatchOnPageEndWarp() {
        if (!mOnPageEndWarpCalled) {
            onPageEndWarp();
            mOnPageEndWarpCalled = true;
        }
        mOnPageBeginWarpCalled = false;
    }

    protected void pageEndMoving() {
        if (DEBUG_WARP) Log.v(TAG, "pageEndMoving(" + mIsPageMoving + ")");
        if (mIsPageMoving) {
@@ -508,7 +526,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
                if (mPageSwapIndex != -1) {
                    swapPages(mPageSwapIndex, mPageWarpIndex);
                }
                onPageEndWarp();
                dispatchOnPageEndWarp();
                resetPageWarp();
            }
            onPageEndMoving();
@@ -1919,7 +1937,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        }

        if (isWarping()) {
            onPageEndWarp();
            dispatchOnPageEndWarp();
            resetPageWarp();
        }

@@ -2702,7 +2720,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        @Override
        public void onAnimationEnd(Animator animation) {
            mWarpAnimation = null;
            mWarpPageExposed = true;
            mWarpPageExposed = false;
        }
    };

@@ -2727,9 +2745,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc

    private void animateWarpPageOnScreen(String reason) {
        if (DEBUG_WARP) Log.v(TAG, "animateWarpPageOnScreen(" + reason + ")");
        if (isWarping()) {
        if (isWarping() && !mWarpPageExposed) {
            mWarpPageExposed = true;
            onPageBeginWarp();
            dispatchOnPageBeginWarp();
            KeyguardWidgetFrame v = (KeyguardWidgetFrame) getPageAt(mPageWarpIndex);
            if (DEBUG_WARP) Log.v(TAG, "moving page on screen: Tx=" + v.getTranslationX());
            DecelerateInterpolator interp = new DecelerateInterpolator(1.5f);
@@ -2744,7 +2762,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
    private void animateWarpPageOffScreen(String reason, boolean animate) {
        if (DEBUG_WARP) Log.v(TAG, "animateWarpPageOffScreen(" + reason + " anim:" + animate + ")");
        if (isWarping()) {
            onPageEndWarp();
            dispatchOnPageEndWarp();
            KeyguardWidgetFrame v = (KeyguardWidgetFrame) getPageAt(mPageWarpIndex);
            if (DEBUG_WARP) Log.v(TAG, "moving page off screen: Tx=" + v.getTranslationX());
            AccelerateInterpolator interp = new AccelerateInterpolator(1.5f);
+10 B (1.48 KiB)
Loading image diff...
−268 B (685 B)
Loading image diff...
Loading