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

Commit 743d5c95 authored by Winson Chung's avatar Winson Chung
Browse files

Clipping the task bar against the task view.

- Skipping nav bar scrim animation when animating without window transitions

Change-Id: I8652f3956971f07bb410b801bf627d51c5e987cd
parent ad6f2766
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -492,6 +492,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        Rect taskRect = getAnimationTaskRect(recentTasks);
        boolean useThumbnailTransition = !isTopTaskHome &&
                hasValidTaskRects();
        boolean hasRecentTasks = !recentTasks.isEmpty();

        if (useThumbnailTransition) {
            // Try starting with a thumbnail transition
@@ -506,14 +507,14 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
                // Fall through below to the non-thumbnail transition
                useThumbnailTransition = false;
            }
        }

        // If there is no thumbnail transition, then just use a generic transition
        if (!useThumbnailTransition) {
            if (Constants.DebugFlags.App.EnableHomeTransition) {
        } else {
            // If there is no thumbnail transition, but is launching from home into recents, then
            // use a quick home transition and do the animation from home
            if (hasRecentTasks && Constants.DebugFlags.App.EnableHomeTransition) {
                ActivityOptions opts = getHomeTransitionActivityOptions();
                startAlternateRecentsActivity(opts, EXTRA_FROM_HOME);
            } else {
                // Otherwise we do the normal fade from an unknown source
                ActivityOptions opts = getUnknownTransitionActivityOptions();
                startAlternateRecentsActivity(opts, null);
            }
+8 −3
Original line number Diff line number Diff line
@@ -179,8 +179,13 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
            mRecentsView.setBSP(root);
        }

        // Hide the scrim by default when we enter recents
        if (mConfig.shouldAnimateNavBarScrim()) {
            // Hide the scrim if we animate into Recents with window transitions
            mNavBarScrimView.setVisibility(View.INVISIBLE);
        } else {
            // Show the scrim if we animate into Recents without window transitions
            mNavBarScrimView.setVisibility(View.VISIBLE);
        }

        // Add the default no-recents layout
        if (stacks.size() == 1 && stacks.get(0).getTaskCount() == 0) {
@@ -560,7 +565,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView

    public void onEnterAnimationTriggered() {
        // Fade in the scrim
        if (mConfig.hasNavBarScrim()) {
        if (mConfig.shouldAnimateNavBarScrim() && mConfig.hasNavBarScrim()) {
            mNavBarScrimView.setVisibility(View.VISIBLE);
            mNavBarScrimView.setAlpha(0f);
            mNavBarScrimView.animate().alpha(1f)
+5 −0
Original line number Diff line number Diff line
@@ -255,6 +255,11 @@ public class RecentsConfiguration {
        return searchBarAppWidgetId >= 0;
    }

    /** Returns whether the nav bar scrim should be animated when shown for the first time. */
    public boolean shouldAnimateNavBarScrim() {
        return !launchedFromHome && !launchedFromAppWithScreenshot;
    }

    /** Returns whether the nav bar scrim should be visible. */
    public boolean hasNavBarScrim() {
        return !transposeRecentsLayoutWithOrientation || !isLandscape;
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.recents.model;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
+0 −1
Original line number Diff line number Diff line
@@ -73,7 +73,6 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
        super(context);
        mConfig = RecentsConfiguration.getInstance();
        mInflater = LayoutInflater.from(context);
        setWillNotDraw(false);
    }

    /** Sets the callbacks */
Loading