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

Commit 38dad54d authored by Alex Chau's avatar Alex Chau Committed by Automerger Merge Worker
Browse files

Add overviewShowAsGrid to DeviceProfile am: 646f8046 am: 989e308f

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

Change-Id: I0aa8ebd55ae03a68f52ce12ef3169ed4a5033eb5
parents 8242c1c9 989e308f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.Workspace;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.Themes;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.util.LayoutUtils;
@@ -104,7 +103,7 @@ public class OverviewState extends LauncherState {

    @Override
    public boolean displayOverviewTasksAsGrid(DeviceProfile deviceProfile) {
        return deviceProfile.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get();
        return deviceProfile.overviewShowAsGrid;
    }

    @Override
+1 −2
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StatefulActivity;
@@ -207,7 +206,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
    public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect,
            PagedOrientationHandler orientedState) {
        Resources res = context.getResources();
        if (dp.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get()) {
        if (dp.overviewShowAsGrid) {
            Rect gridRect = new Rect();
            calculateGridSize(context, dp, gridRect);

+2 −3
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager;
@@ -196,7 +195,7 @@ public final class TaskViewUtils {
        int taskIndex = recentsView.indexOfChild(v);
        Context context = v.getContext();
        DeviceProfile dp = BaseActivity.fromContext(context).getDeviceProfile();
        boolean showAsGrid = dp.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get();
        boolean showAsGrid = dp.overviewShowAsGrid;
        boolean parallaxCenterAndAdjacentTask =
                taskIndex != recentsView.getCurrentPage() && !showAsGrid;
        float gridTranslationSecondary = recentsView.getGridTranslationSecondary(taskIndex);
@@ -465,7 +464,7 @@ public final class TaskViewUtils {
        if (launcherClosing) {
            Context context = v.getContext();
            DeviceProfile dp = BaseActivity.fromContext(context).getDeviceProfile();
            launcherAnim = dp.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get()
            launcherAnim = dp.overviewShowAsGrid
                    ? ObjectAnimator.ofFloat(recentsView, RecentsView.CONTENT_ALPHA, 0)
                    : recentsView.createAdjacentPageAnimForTaskLaunch(taskView);
            launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR);
+1 −6
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.graphics.Color;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.util.Themes;
import com.android.quickstep.RecentsActivity;
@@ -134,11 +133,7 @@ public class RecentsState implements BaseState<RecentsState> {
     * For this state, whether tasks should layout as a grid rather than a list.
     */
    public boolean displayOverviewTasksAsGrid(DeviceProfile deviceProfile) {
        return hasFlag(FLAG_SHOW_AS_GRID) && showAsGrid(deviceProfile);
    }

    private boolean showAsGrid(DeviceProfile deviceProfile) {
        return deviceProfile.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get();
        return hasFlag(FLAG_SHOW_AS_GRID) && deviceProfile.overviewShowAsGrid;
    }

    /**
+3 −3
Original line number Diff line number Diff line
@@ -1139,7 +1139,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
     * required to focus the task in grid.
     */
    public void moveFocusedTaskToFront() {
        if (!(mActivity.getDeviceProfile().isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get())) {
        if (!mActivity.getDeviceProfile().overviewShowAsGrid) {
            return;
        }

@@ -1430,7 +1430,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        if (mActionsView != null) {
            FrameLayout.LayoutParams layoutParams =
                    (FrameLayout.LayoutParams) mActionsView.getLayoutParams();
            if (dp.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get()) {
            if (dp.overviewShowAsGrid) {
                layoutParams.gravity = Gravity.BOTTOM;
                layoutParams.bottomMargin =
                        dp.heightPx - mInsets.bottom - mLastComputedGridSize.bottom;
@@ -1563,7 +1563,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T

    @Override
    protected int getDestinationPage(int scaledScroll) {
        if (!(mActivity.getDeviceProfile().isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get())) {
        if (!mActivity.getDeviceProfile().overviewShowAsGrid) {
            return super.getDestinationPage(scaledScroll);
        }

Loading