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

Commit 7aceb9a0 authored by Winson Chung's avatar Winson Chung
Browse files

Bug fixes and cleanup

- Don't reinflate the search bar view every time you return to recents
- Fixing an issue where the default thumbnail was not being used when querying the thumbnail cache (thought WM still seems to not be giving us screenshots in many cases)
- Fixing an issue where an invisible header bar color was used instead of the default header bar color
- Fixing an issue where swipe-to-dismiss logic was running before the animation back into place
- Using outline clipping instead of doing it ourselves for the rounded TaskView
- Small optimization in finding the visible range
- Renaming some of the callbacks to make them more clear
- Removing some unused code
parent be55c0d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ public class Console {
    public static final String AnsiWhite = "\u001B[37m";

    // Console enabled state
    public static final boolean Enabled = false;
    public static boolean Enabled = false;

    /** Logs a key */
    public static void log(String key) {
+3 −3
Original line number Diff line number Diff line
@@ -55,9 +55,9 @@ public class Constants {
            public static final String TimeRecentsStartupKey = "startup";
            public static final String TimeRecentsLaunchKey = "launchTask";
            public static final String TimeRecentsScreenshotTransitionKey = "screenshot";
            public static final boolean TimeRecentsStartup = true;
            public static final boolean TimeRecentsLaunchTask = true;
            public static final boolean TimeRecentsScreenshotTransition = true;
            public static final boolean TimeRecentsStartup = false;
            public static final boolean TimeRecentsLaunchTask = false;
            public static final boolean TimeRecentsScreenshotTransition = false;


            public static final boolean RecentsComponent = false;
+12 −21
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    AppWidgetHostView mSearchAppWidgetHostView;

    boolean mVisible;
    boolean mTaskLaunched;

    // Runnables to finish the Recents activity
    FinishRecentsRunnable mFinishRunnable = new FinishRecentsRunnable(true);
@@ -198,9 +197,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
                AlternateRecentsComponent.EXTRA_TRIGGERED_FROM_ALT_TAB, false);
        mConfig.launchedWithNoRecentTasks = !root.hasTasks();

        // Show the scrim if we animate into Recents without window transitions
        mScrimViews.prepareEnterRecentsAnimation();

        // Add the default no-recents layout
        if (mEmptyView == null) {
            mEmptyView = mEmptyViewStub.inflate();
@@ -210,6 +206,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        } else {
            mEmptyView.setVisibility(View.GONE);
        }

        // Show the scrim if we animate into Recents without window transitions
        mScrimViews.prepareEnterRecentsAnimation();
    }

    /** Attempts to allocate and bind the search bar app widget */
@@ -355,13 +354,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        // Update the recent tasks
        updateRecentsTasks(getIntent());

        // Prepare the screenshot transition if necessary
        if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
            mFullScreenOverlayView = (FullscreenTransitionOverlayView) mFullscreenOverlayStub.inflate();
            mFullScreenOverlayView.setCallbacks(this);
            mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot());
        }

        // Bind the search app widget when we first start up
        bindSearchBarAppWidget();
        // Add the search bar layout
@@ -390,6 +382,13 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }

        // Prepare the screenshot transition if necessary
        if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
            mFullScreenOverlayView = (FullscreenTransitionOverlayView) mFullscreenOverlayStub.inflate();
            mFullScreenOverlayView.setCallbacks(this);
            mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot());
        }
    }

    void onConfigurationChange() {
@@ -404,8 +403,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        // Reset the task launched flag if we encounter an onNewIntent() before onStop()
        mTaskLaunched = false;

        if (Console.Enabled) {
            Console.logDivider(Constants.Log.App.SystemUIHandshake);
@@ -426,9 +423,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
            mFullScreenOverlayView.prepareAnimateOnEnterRecents(AlternateRecentsComponent.getLastScreenshot());
        }

        // Don't attempt to rebind the search bar widget, but just add the search bar layout
        addSearchBarAppWidgetView();
    }

    @Override
@@ -509,7 +503,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        }

        mVisible = false;
        mTaskLaunched = false;
    }

    @Override
@@ -632,15 +625,13 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    }

    @Override
    public void onTaskLaunching() {
        mTaskLaunched = true;

    public void onTaskViewClicked() {
        // Mark recents as no longer visible
        AlternateRecentsComponent.notifyVisibilityChanged(false);
    }

    @Override
    public void onLastTaskRemoved() {
    public void onAllTaskViewsDismissed() {
        mFinishLaunchHomeRunnable.run();
    }

+3 −0
Original line number Diff line number Diff line
@@ -149,6 +149,9 @@ public class RecentsConfiguration {

        // Debug mode
        debugModeEnabled = settings.getBoolean(Constants.Values.App.Key_DebugModeEnabled, false);
        if (debugModeEnabled) {
            Console.Enabled = true;
        }

        // Animations
        animationPxMovementPerSecond =
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ class SystemUIMessageHandler extends Handler {
                // since that is done when we compute the animation itself in the Recents component

                // Create a dummy task stack & compute the rect for the thumbnail to animate to
                TaskStack stack = new TaskStack(context);
                TaskStack stack = new TaskStack();
                TaskStackView tsv = new TaskStackView(context, stack);
                TaskStackViewLayoutAlgorithm algo = tsv.getStackAlgorithm();
                Bundle replyData = new Bundle();
Loading