Merge "Using the activity size for swipe-dow animation in fallback+multiWindow mode" into ub-launcher3-edmonton

This commit is contained in:
Sunny Goyal 2018-04-21 00:48:49 +00:00 committed by Android (Google) Code Review
commit d60c00cc87
5 changed files with 16 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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

View File

@ -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) {

View File

@ -138,4 +138,9 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
}
super.onTaskLaunched(success);
}
@Override
public boolean shouldUseMultiWindowTaskSizeStrategy() {
return mActivity.isInMultiWindowModeCompat();
}
}

View File

@ -1098,6 +1098,8 @@ public abstract class RecentsView<T extends BaseActivity>
return mPendingAnimation;
}
public abstract boolean shouldUseMultiWindowTaskSizeStrategy();
protected void onTaskLaunched(boolean success) {
resetTaskVisuals();
}