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

Commit 21eb86a5 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Bring back some status bar animations.

Change Ie817b396 removed the layout transition from the main
status bar, fixing a number of weird bugs caused by the
translations on CHANGE_APPEARING and CHANGE_DISAPPEARING.

This change restores the layout transitions, but only the
alpha fade on APPEARING and DISAPPEARING. Doing this should
bring back the useful part of the status bar animations
(i.e. things fading in & out) without the buggy part (things
sliding around to make room for the things fading in & out).

Additionally, these fade-only layout transitions are now
properly applied to the clock/notification area (when
bringing up the notifications panel) and the icons within
the navigation cluster (so the legacy MENU key will fade
in).

Bug: 3503960
Bug: 3489129
Change-Id: I1ea433c41f2f930342ae2486505b0fee19709f9c
parent 957ac326
Loading
Loading
Loading
Loading
+21 −6
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ public class TabletStatusBar extends StatusBar implements
    View mNotificationArea;
    View mNotificationTrigger;
    NotificationIconArea mNotificationIconArea;
    View mNavigationArea;
    ViewGroup mNavigationArea;

    boolean mNotificationDNDMode;
    NotificationData.Entry mNotificationDNDDummyEntry;
@@ -146,7 +146,8 @@ public class TabletStatusBar extends StatusBar implements
    LocationController mLocationController;
    NetworkController mNetworkController;

    View mBarContents;
    ViewGroup mBarContents;
    LayoutTransition mBarContentsLayoutTransition;

    // hide system chrome ("lights out") support
    View mShadow;
@@ -346,7 +347,20 @@ public class TabletStatusBar extends StatusBar implements

        sb.setHandler(mHandler);

        mBarContents = sb.findViewById(R.id.bar_contents);
        mBarContents = (ViewGroup) sb.findViewById(R.id.bar_contents);
        // layout transitions for the status bar's contents
        mBarContentsLayoutTransition = new LayoutTransition();
        // add/removal will fade as normal
        mBarContentsLayoutTransition.setAnimator(LayoutTransition.APPEARING,
                ObjectAnimator.ofFloat(null, "alpha", 0f, 1f));
        mBarContentsLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING,
                ObjectAnimator.ofFloat(null, "alpha", 1f, 0f));
        // no animations for siblings on change: just jump into place please
        mBarContentsLayoutTransition.setAnimator(LayoutTransition.CHANGE_APPEARING, null);
        mBarContentsLayoutTransition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, null);
        // quick like bunny
        mBarContentsLayoutTransition.setDuration(250 * (DEBUG?10:1));
        mBarContents.setLayoutTransition(mBarContentsLayoutTransition);

        // the whole right-hand side of the bar
        mNotificationArea = sb.findViewById(R.id.notificationArea);
@@ -385,11 +399,12 @@ public class TabletStatusBar extends StatusBar implements

        // The navigation buttons
        mBackButton = (ImageView)sb.findViewById(R.id.back);
        mNavigationArea = sb.findViewById(R.id.navigationArea);
        mNavigationArea = (ViewGroup) sb.findViewById(R.id.navigationArea);
        mHomeButton = mNavigationArea.findViewById(R.id.home);
        mMenuButton = mNavigationArea.findViewById(R.id.menu);
        mRecentButton = mNavigationArea.findViewById(R.id.recent_apps);
        mRecentButton.setOnClickListener(mOnClickListener);
        mNavigationArea.setLayoutTransition(mBarContentsLayoutTransition);

        // The bar contents buttons
        mNotificationAndImeArea = (ViewGroup)sb.findViewById(R.id.notificationAndImeArea);
@@ -574,7 +589,7 @@ public class TabletStatusBar extends StatusBar implements
                    if (!mNotificationPanel.isShowing()) {
                        mNotificationPeekWindow.setVisibility(View.GONE);
                        mNotificationPanel.show(true, true);
                        mNotificationArea.setVisibility(View.GONE);
                        mNotificationArea.setVisibility(View.INVISIBLE);
                        mTicker.halt();
                    }
                    break;
@@ -832,7 +847,7 @@ public class TabletStatusBar extends StatusBar implements
        if ((diff & StatusBarManager.DISABLE_NAVIGATION) != 0) {
            if ((state & StatusBarManager.DISABLE_NAVIGATION) != 0) {
                Slog.i(TAG, "DISABLE_NAVIGATION: yes");
                mNavigationArea.setVisibility(View.GONE);
                mNavigationArea.setVisibility(View.INVISIBLE);
                mInputMethodSwitchButton.setScreenLocked(true);
            } else {
                Slog.i(TAG, "DISABLE_NAVIGATION: no");