Removing some new object creation during touch handling
> Motion various transformation methods to Orientation Handler
> Moving orientation handler to quickstep package
Bug: 150300347
Bug: 151269990
Bug: 149610456
Change-Id: I28434c1d1f62a3b85f3583740f0a8f827513fab3
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 5e47e2f..e36ae94 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -38,7 +38,6 @@
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
-import android.view.Surface;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
@@ -55,12 +54,10 @@
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.model.PagedViewOrientedState;
import com.android.launcher3.pageindicators.PageIndicator;
import com.android.launcher3.touch.OverScroll;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.touch.PagedOrientationHandler.ChildBounds;
-import com.android.launcher3.touch.PortraitPagedViewHandler;
import com.android.launcher3.util.OverScroller;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.views.ActivityContext;
@@ -121,8 +118,7 @@
private float mLastMotion;
private float mLastMotionRemainder;
private float mTotalMotion;
- protected PagedOrientationHandler mOrientationHandler = new PortraitPagedViewHandler();
- protected final PagedViewOrientedState mOrientationState = new PagedViewOrientedState();
+ protected PagedOrientationHandler mOrientationHandler = PagedOrientationHandler.PORTRAIT;
protected int[] mPageScrolls;
private boolean mIsBeingDragged;
@@ -144,9 +140,6 @@
protected int mUnboundedScroll;
- protected int mLayoutRotation = Surface.ROTATION_0;
- protected int mDisplayRotation = Surface.ROTATION_0;
-
// Page Indicator
@Thunk int mPageIndicatorViewId;
protected T mPageIndicator;
@@ -417,37 +410,6 @@
return mUnboundedScroll;
}
- protected void updateLayoutRotation(int touchRotation) {
- setLayoutRotation(touchRotation, mDisplayRotation);
- }
-
- /** @param touchRotation Must be one of {@link android.view.Surface.ROTATION_0/90/180/270} */
- public void setLayoutRotation(int touchRotation, int displayRotation) {
- if (mLayoutRotation == touchRotation && mDisplayRotation == displayRotation) {
- return;
- }
-
- mOrientationState.update(touchRotation, displayRotation);
- mOrientationHandler = mOrientationState.getOrientationHandler();
- mLayoutRotation = touchRotation;
- mDisplayRotation = displayRotation;
- requestLayout();
- }
-
- public PagedViewOrientedState getPagedViewOrientedState() {
- return mOrientationState;
- }
-
- public PagedOrientationHandler getPagedOrientationHandler() {
- return getPagedViewOrientedState().getOrientationHandler();
- }
-
- public void disableMultipleLayoutRotations(boolean disable) {
- mOrientationState.disableMultipleOrientations(disable);
- mOrientationHandler = mOrientationState.getOrientationHandler();
- requestLayout();
- }
-
@Override
public void scrollBy(int x, int y) {
mOrientationHandler.delegateScrollBy(this, getUnboundedScroll(), x, y);