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

Commit 622a3eac authored by Helen Cheuk's avatar Helen Cheuk Committed by Android (Google) Code Review
Browse files

Merge "Align ClearAllButton to centre when the ENABLE_GRID_ONLY_OVERVIEW is...

Merge "Align ClearAllButton to centre when the ENABLE_GRID_ONLY_OVERVIEW is enabled" into udc-qpr-dev
parents 7a12786c 4ecef9aa
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -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;
    }
}