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

Commit b4f03805 authored by Matthew Ng's avatar Matthew Ng
Browse files

Fixes recents from disappearing when split and restarted

The launch flags are interpreted incorrectly when minimized causing
Recents to start an entrance animation by moving off screen and being
invisible when Recents is destroyed and shown again by density or font
system changes. When recents is restarted, reset the flags to ignore the
entrance animation from moving them off screen.

Fixes: 62195106
Test: Open settings, go to page to change font size, dock by holding
recents button, with at least one task in Recents, change density. Also
can minimize and unminimize and changing density would also get fixed.
Change-Id: I519f59faf5e98c9d116bf66297f033c7f5fb7138
parent ed0c5cf4
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -400,6 +400,17 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD

        // Notify of the next draw
        mRecentsView.getViewTreeObserver().addOnPreDrawListener(mRecentsDrawnEventListener);

        // If Recents was restarted, then it should complete the enter animation with partially
        // reset launch state with dock, app and home set to false
        Object isRelaunching = getLastNonConfigurationInstance();
        if (isRelaunching != null && isRelaunching instanceof Boolean && (boolean) isRelaunching) {
            RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
            launchState.launchedViaDockGesture = false;
            launchState.launchedFromApp = false;
            launchState.launchedFromHome = false;
            onEnterAnimationComplete();
        }
    }

    @Override
@@ -504,6 +515,11 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
    }

    @Override
    public Object onRetainNonConfigurationInstance() {
        return true;
    }

    @Override
    protected void onPause() {
        super.onPause();