Merge "Align ClearAllButton to centre when the ENABLE_GRID_ONLY_OVERVIEW is enabled" into udc-qpr-dev am: 622a3eacb3

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23639282

Change-Id: I00afb637d32ea7d823a3b46ce5bf6b5e4726dfc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Helen Cheuk
2023-06-22 13:25:28 +00:00
committed by Automerger Merge Worker
@@ -16,6 +16,8 @@
package com.android.quickstep.views;
import static com.android.launcher3.config.FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW;
import android.content.Context;
import android.util.AttributeSet;
import android.util.FloatProperty;
@@ -248,8 +250,15 @@ public class ClearAllButton extends Button {
*/
private float getOriginalTranslationY() {
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
return deviceProfile.isTablet
? deviceProfile.overviewRowSpacing
: deviceProfile.overviewTaskThumbnailTopMarginPx / 2.0f;
if (deviceProfile.isTablet) {
if (ENABLE_GRID_ONLY_OVERVIEW.get()) {
return (getRecentsView().getLastComputedTaskSize().height()
+ deviceProfile.overviewTaskThumbnailTopMarginPx) / 2.0f
+ deviceProfile.overviewRowSpacing;
} else {
return deviceProfile.overviewRowSpacing;
}
}
return deviceProfile.overviewTaskThumbnailTopMarginPx / 2.0f;
}
}