Rotate Overview Task Action Menu

Fixes: 153371258
Test: Tap on icon in portrait,
landscape and seascape. Open menu
then rotate phone.

Change-Id: I38b018371561b502fe211a3c2ddea4ff7fde4274
This commit is contained in:
Vinit Nayak
2020-04-15 14:13:38 -07:00
parent cf3bed973c
commit e553e380d0
6 changed files with 124 additions and 12 deletions

View File

@@ -16,6 +16,7 @@
package com.android.launcher3.touch;
import static android.widget.ListPopupWindow.WRAP_CONTENT;
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
import static com.android.launcher3.touch.SingleAxisSwipeDetector.HORIZONTAL;
@@ -30,6 +31,7 @@ import android.view.Surface;
import android.view.VelocityTracker;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.widget.LinearLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.PagedView;
@@ -223,6 +225,33 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
return 1;
}
@Override
public float getTaskMenuX(float x, View thumbnailView) {
return thumbnailView.getMeasuredWidth() + x;
}
@Override
public float getTaskMenuY(float y, View thumbnailView) {
return y;
}
@Override
public int getTaskMenuWidth(View view) {
return view.getMeasuredHeight();
}
@Override
public int getTaskMenuLayoutOrientation() {
return LinearLayout.HORIZONTAL;
}
@Override
public void setLayoutParamsForTaskMenuOptionItem(LinearLayout.LayoutParams lp) {
lp.width = 0;
lp.height = WRAP_CONTENT;
lp.weight = 1;
}
@Override
public ChildBounds getChildBounds(View child, int childStart, int pageCenter,
boolean layoutChild) {