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

Commit 118724e7 authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Fix issue with alphas not being applied to the same view on unlock"...

Merge "Fix issue with alphas not being applied to the same view on unlock" into sc-v2-dev am: 9e4c6144 am: 3ff5002d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16326286

Change-Id: I87e487ea69139de1196a17f81f19b404968eae4e
parents 922c436e 3ff5002d
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ public class NavigationBarView extends FrameLayout implements
    private final int mNavColorSampleMargin;
    private final SysUiState mSysUiFlagContainer;

    // The current view is one of mHorizontal or mVertical depending on the current configuration
    View mCurrentView = null;
    private View mVertical;
    private View mHorizontal;
@@ -397,12 +398,6 @@ public class NavigationBarView extends FrameLayout implements
        }
    }

    @Override
    protected boolean onSetAlpha(int alpha) {
        Log.e(TAG, "onSetAlpha", new Throwable());
        return super.onSetAlpha(alpha);
    }

    public void setAutoHideController(AutoHideController autoHideController) {
        mAutoHideController = autoHideController;
    }
@@ -505,6 +500,18 @@ public class NavigationBarView extends FrameLayout implements
        return mCurrentView;
    }

    /**
     * Applies {@param consumer} to each of the nav bar views.
     */
    public void forEachView(Consumer<View> consumer) {
        if (mVertical != null) {
            consumer.accept(mVertical);
        }
        if (mHorizontal != null) {
            consumer.accept(mHorizontal);
        }
    }

    public RotationButtonController getRotationButtonController() {
        return mRotationButtonController;
    }
+14 −23
Original line number Diff line number Diff line
@@ -555,12 +555,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    public void onStartedWakingUp() {
        mStatusBar.getNotificationShadeWindowView().getWindowInsetsController()
                .setAnimationsDisabled(false);
        View currentView = getCurrentNavBarView();
        if (currentView != null) {
            currentView.animate()
        NavigationBarView navBarView = mStatusBar.getNavigationBarView();
        if (navBarView != null) {
            navBarView.forEachView(view ->
                    view.animate()
                            .alpha(1f)
                            .setDuration(NAV_BAR_CONTENT_FADE_DURATION)
                    .start();
                            .start());
        }
    }

@@ -568,12 +569,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    public void onStartedGoingToSleep() {
        mStatusBar.getNotificationShadeWindowView().getWindowInsetsController()
                .setAnimationsDisabled(true);
        View currentView = getCurrentNavBarView();
        if (currentView != null) {
            currentView.animate()
        NavigationBarView navBarView = mStatusBar.getNavigationBarView();
        if (navBarView != null) {
            navBarView.forEachView(view ->
                    view.animate()
                            .alpha(0f)
                            .setDuration(NAV_BAR_CONTENT_FADE_DURATION)
                    .start();
                            .start());
        }
    }

@@ -1015,17 +1017,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        mStatusBar.onKeyguardViewManagerStatesUpdated();
    }

    /**
     * Updates the visibility of the nav bar content views.
     */
    private void updateNavigationBarContentVisibility(boolean navBarContentVisible) {
        final NavigationBarView navBarView = mStatusBar.getNavigationBarView();
        if (navBarView != null && navBarView.getCurrentView() != null) {
            final View currentView = navBarView.getCurrentView();
            currentView.setVisibility(navBarContentVisible ? View.VISIBLE : View.INVISIBLE);
        }
    }

    private View getCurrentNavBarView() {
        final NavigationBarView navBarView = mStatusBar.getNavigationBarView();
        return navBarView != null ? navBarView.getCurrentView() : null;