Merge cherrypicks of ['googleplex-android-review.googlesource.com/26497774', 'googleplex-android-review.googlesource.com/26544858', 'googleplex-android-review.googlesource.com/26553571'] into 24Q2-release.

Change-Id: I9688377ae9f2d17236449736df91b7302b8f6a0b
This commit is contained in:
Android Build Coastguard Worker committed 2024-03-14 01:01:04 +00:00
commit 2e64c71a2d
7 files changed
+28 -11

No files matched your search

@@ -135,8 +135,7 @@ public class QuickstepAtomicAnimationFactory extends
config.duration = Math.max(config.duration, scrollDuration);
// Sync scroll so that it ends before or at the same time as the taskbar animation.
if (DisplayController.isTransientTaskbar(mActivity)
&& mActivity.getDeviceProfile().isTaskbarPresent) {
if (mActivity.getDeviceProfile().isTaskbarPresent) {
config.duration = Math.min(config.duration, TASKBAR_TO_HOME_DURATION);
}
overview.snapToPage(DEFAULT_PAGE, Math.toIntExact(config.duration));
@@ -56,7 +56,7 @@ public class ViewUtils {
boolean mSurfaceCallbackRegistered = false;
boolean mFinished;
int mDeferFrameCount = 1;
int mDeferFrameCount = 2;
FrameHandler(View view, Runnable finishCallback, BooleanSupplier cancelled) {
mViewRoot = view.getViewRootImpl();
@@ -304,6 +304,12 @@ public class LandscapePagedViewHandler implements RecentsPagedOrientationHandler
}
}
@Override
public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile,
float taskMenuX, float taskMenuY) {
return (int) (taskMenuX - taskInsetMargin);
}
@Override
public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
LinearLayout taskMenuLayout, int dividerSpacing,
@@ -209,6 +209,12 @@ public class PortraitPagedViewHandler extends DefaultPagedViewHandler implements
: thumbnailView.getMeasuredWidth()) - (2 * padding);
}
@Override
public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile,
float taskMenuX, float taskMenuY) {
return (int) (deviceProfile.availableHeightPx - taskInsetMargin - taskMenuY);
}
@Override
public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
LinearLayout taskMenuLayout, int dividerSpacing,
@@ -176,6 +176,9 @@ public interface RecentsPagedOrientationHandler extends PagedOrientationHandler
View taskMenuView, float taskInsetMargin, View taskViewIcon);
int getTaskMenuWidth(View thumbnailView, DeviceProfile deviceProfile,
@StagePosition int stagePosition);
int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile, float taskMenuX,
float taskMenuY);
/**
* Sets linear layout orientation for {@link com.android.launcher3.popup.SystemShortcut} items
* inside task menu view.
@@ -113,6 +113,12 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
}
}
@Override
public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile,
float taskMenuX, float taskMenuY) {
return (int) (deviceProfile.availableWidthPx - taskInsetMargin - taskMenuX);
}
@Override
public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect, SplitBounds splitInfo,
int desiredStagePosition) {
@@ -140,11 +140,9 @@ public class TaskMenuView extends AbstractFloatingView {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (!enableOverviewIconMenu()) {
int maxMenuHeight = calculateMaxHeight();
if (MeasureSpec.getSize(heightMeasureSpec) > maxMenuHeight) {
heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxMenuHeight, MeasureSpec.AT_MOST);
}
int maxMenuHeight = calculateMaxHeight();
if (MeasureSpec.getSize(heightMeasureSpec) > maxMenuHeight) {
heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxMenuHeight, MeasureSpec.AT_MOST);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@@ -416,10 +414,9 @@ public class TaskMenuView extends AbstractFloatingView {
* with a margin on the top and bottom.
*/
private int calculateMaxHeight() {
float taskBottom = mTaskView.getHeight() + mTaskView.getPersistentTranslationY();
float taskInsetMargin = getResources().getDimension(R.dimen.task_card_margin);
return (int) (taskBottom - taskInsetMargin - getTranslationY());
return mTaskView.getPagedOrientationHandler().getTaskMenuHeight(taskInsetMargin,
mActivity.getDeviceProfile(), getTranslationX(), getTranslationY());
}
private void setOnClosingStartCallback(Runnable onClosingStartCallback) {