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

Commit f3d73285 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Using the activity size for swipe-dow animation in fallback+multiWindow mode

Bug: 77281732
Change-Id: I2d652b801bcecd339fed00a43677b20d782997c6
parent e13659bd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -66,4 +66,9 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity> {
        LayoutUtils.calculateFallbackTaskSize(getContext(), dp, outRect);
    }

    @Override
    public boolean shouldUseMultiWindowTaskSizeStrategy() {
        // Just use the activity task size for multi-window as well.
        return false;
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskThumbnailView;
import com.android.systemui.shared.recents.utilities.RectFEvaluator;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -135,7 +136,7 @@ public class ClipAnimationHelper {
        }
    }

    public void fromTaskThumbnailView(TaskThumbnailView ttv) {
    public void fromTaskThumbnailView(TaskThumbnailView ttv, RecentsView rv) {
        BaseDraggingActivity activity = BaseDraggingActivity.fromContext(ttv.getContext());
        BaseDragLayer dl = activity.getDragLayer();

@@ -144,7 +145,7 @@ public class ClipAnimationHelper {
        mHomeStackBounds.set(0, 0, dl.getWidth(), dl.getHeight());
        mHomeStackBounds.offset(pos[0], pos[1]);

        if (activity.isInMultiWindowModeCompat()) {
        if (rv.shouldUseMultiWindowTaskSizeStrategy()) {
            // TODO: Fetch multi-window target bounds from system-ui
            DeviceProfile fullDp = activity.getDeviceProfile().getFullScreenProfile();
            // Use availableWidthPx and availableHeightPx instead of widthPx and heightPx to
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ public class TaskViewDrawable extends Drawable {

        mThumbnailView = tv.getThumbnail();
        mClipAnimationHelper = new ClipAnimationHelper();
        mClipAnimationHelper.fromTaskThumbnailView(mThumbnailView);
        mClipAnimationHelper.fromTaskThumbnailView(mThumbnailView, parent);
    }

    public void setProgress(float progress) {
+5 −0
Original line number Diff line number Diff line
@@ -138,4 +138,9 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
        }
        super.onTaskLaunched(success);
    }

    @Override
    public boolean shouldUseMultiWindowTaskSizeStrategy() {
        return mActivity.isInMultiWindowModeCompat();
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -1095,6 +1095,8 @@ public abstract class RecentsView<T extends BaseActivity>
        return mPendingAnimation;
    }

    public abstract boolean shouldUseMultiWindowTaskSizeStrategy();

    protected void onTaskLaunched(boolean success) {
        resetTaskVisuals();
    }