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

Bug: 77281732
Change-Id: I2d652b801bcecd339fed00a43677b20d782997c6
This commit is contained in:
Sunny Goyal
2018-04-20 09:29:45 -07:00
parent e13659bd5b
commit f3d7328518
5 changed files with 16 additions and 3 deletions
@@ -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;
}
}
@@ -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
@@ -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) {
@@ -138,4 +138,9 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
}
super.onTaskLaunched(success);
}
@Override
public boolean shouldUseMultiWindowTaskSizeStrategy() {
return mActivity.isInMultiWindowModeCompat();
}
}
@@ -1095,6 +1095,8 @@ public abstract class RecentsView<T extends BaseActivity>
return mPendingAnimation;
}
public abstract boolean shouldUseMultiWindowTaskSizeStrategy();
protected void onTaskLaunched(boolean success) {
resetTaskVisuals();
}