diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java index a28dabc6a3..ebc83c6bad 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -37,7 +37,7 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: { final float swipeHeight = LayoutUtils.getShelfTrackingDistance(mContext, mDeviceProfile, - PagedOrientationHandler.HOME_ROTATED); + PagedOrientationHandler.PORTRAIT); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight); return response; } diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java index fe5a6c90b1..5af3d7018a 100644 --- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java +++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java @@ -197,7 +197,7 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre mPreviousRotation = touchRotation; if (mLauncherRotation == mTouchRotation || canLauncherRotate()) { - mOrientationHandler = PagedOrientationHandler.HOME_ROTATED; + mOrientationHandler = PagedOrientationHandler.PORTRAIT; if (DEBUG) { Log.d(TAG, "current RecentsOrientedState: " + this); } diff --git a/src/com/android/launcher3/touch/HomeRotatedPageHandler.java b/src/com/android/launcher3/touch/HomeRotatedPageHandler.java deleted file mode 100644 index db5c659e04..0000000000 --- a/src/com/android/launcher3/touch/HomeRotatedPageHandler.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher3.touch; - -import android.graphics.RectF; -import android.view.Surface; -import android.widget.LinearLayout; - -public class HomeRotatedPageHandler extends PortraitPagedViewHandler { - @Override - public void offsetTaskRect(RectF rect, float value, int displayRotation, int launcherRotation) { - if (launcherRotation == Surface.ROTATION_0) { - super.offsetTaskRect(rect, value, displayRotation, launcherRotation); - } else if (launcherRotation == Surface.ROTATION_90) { - if (displayRotation == Surface.ROTATION_0) { - rect.offset(0, value); - } else if (displayRotation == Surface.ROTATION_90) { - rect.offset(value, 0); - } else if (displayRotation == Surface.ROTATION_180) { - rect.offset(-value, 0); - } else { - rect.offset(-value, 0); - } - } else if (launcherRotation == Surface.ROTATION_270) { - if (displayRotation == Surface.ROTATION_0) { - rect.offset(0, -value); - } else if (displayRotation == Surface.ROTATION_90) { - rect.offset(value, 0); - } else if (displayRotation == Surface.ROTATION_180) { - rect.offset(0, -value); - } else { - rect.offset(value, 0); - } - } // TODO (b/149609488) handle 180 case as well - } - - @Override - public int getTaskMenuLayoutOrientation(LinearLayout taskMenuLayout) { - return taskMenuLayout.getOrientation(); - } -} diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java index d02c731de3..48c773413f 100644 --- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java @@ -180,19 +180,6 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler { return Surface.ROTATION_90; } - @Override - public void offsetTaskRect(RectF rect, float value, int displayRotation, int launcherRotation) { - if (displayRotation == Surface.ROTATION_0) { - rect.offset(0, value); - } else if (displayRotation == Surface.ROTATION_90) { - rect.offset(value, 0); - } else if (displayRotation == Surface.ROTATION_180) { - rect.offset(0, -value); - } else { - rect.offset(-value, 0); - } - } - @Override public int getChildStart(View view) { return view.getTop(); diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java index 2e0268dc79..65b1a7a77e 100644 --- a/src/com/android/launcher3/touch/PagedOrientationHandler.java +++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java @@ -43,7 +43,6 @@ public interface PagedOrientationHandler { PagedOrientationHandler PORTRAIT = new PortraitPagedViewHandler(); PagedOrientationHandler LANDSCAPE = new LandscapePagedViewHandler(); PagedOrientationHandler SEASCAPE = new SeascapePagedViewHandler(); - PagedOrientationHandler HOME_ROTATED = new HomeRotatedPageHandler(); interface Int2DAction { void call(T target, int x, int y); @@ -82,7 +81,6 @@ public interface PagedOrientationHandler { boolean getRecentsRtlSetting(Resources resources); float getDegreesRotated(); int getRotation(); - void offsetTaskRect(RectF rect, float value, int delta, int launcherRotation); int getPrimaryValue(int x, int y); int getSecondaryValue(int x, int y); void delegateScrollTo(PagedView pagedView, int secondaryScroll, int primaryScroll); diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index 2fc7a9f40e..79e5c87785 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -178,19 +178,6 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { return Surface.ROTATION_0; } - @Override - public void offsetTaskRect(RectF rect, float value, int displayRotation, int launcherRotation) { - if (displayRotation == Surface.ROTATION_0) { - rect.offset(value, 0); - } else if (displayRotation == Surface.ROTATION_90) { - rect.offset(0, -value); - } else if (displayRotation == Surface.ROTATION_180) { - rect.offset(-value, 0); - } else { - rect.offset(0, value); - } - } - @Override public int getChildStart(View view) { return view.getLeft(); @@ -250,7 +237,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { @Override public int getTaskMenuLayoutOrientation(LinearLayout taskMenuLayout) { - return LinearLayout.VERTICAL; + return taskMenuLayout.getOrientation(); } @Override diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java index 4c1700ee9a..d5ae2dcb16 100644 --- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java @@ -18,7 +18,6 @@ package com.android.launcher3.touch; import android.content.res.Resources; import android.graphics.PointF; -import android.graphics.RectF; import android.view.Surface; import android.view.View; @@ -41,19 +40,6 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { return Utilities.isRtl(resources); } - @Override - public void offsetTaskRect(RectF rect, float value, int displayRotation, int launcherRotation) { - if (displayRotation == Surface.ROTATION_0) { - rect.offset(0, value); - } else if (displayRotation == Surface.ROTATION_90) { - rect.offset(value, 0); - } else if (displayRotation == Surface.ROTATION_180) { - rect.offset(0, -value); - } else { - rect.offset(-value, 0); - } - } - @Override public float getDegreesRotated() { return 270;