Loading quickstep/src/com/android/quickstep/views/ClearAllButton.java +5 −7 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class ClearAllButton extends Button implements PageCallbacks { private float mGridTranslationPrimary; private float mGridTranslationSecondary; private float mGridScrollOffset; private float mOffsetTranslationPrimary; private float mScrollOffsetPrimary; private int mSidePadding; Loading Loading @@ -144,9 +144,8 @@ public class ClearAllButton extends Button implements PageCallbacks { mGridScrollOffset = gridScrollOffset; } public void setOffsetTranslationPrimary(float offsetTranslationPrimary) { mOffsetTranslationPrimary = offsetTranslationPrimary; applyPrimaryTranslation(); public void setScrollOffsetPrimary(float scrollOffsetPrimary) { mScrollOffsetPrimary = scrollOffsetPrimary; } public float getScrollAdjustment(boolean gridEnabled) { Loading @@ -154,7 +153,7 @@ public class ClearAllButton extends Button implements PageCallbacks { if (gridEnabled) { scrollAdjustment += mGridTranslationPrimary + mGridScrollOffset; } scrollAdjustment += mOffsetTranslationPrimary; scrollAdjustment += mScrollOffsetPrimary; return scrollAdjustment; } Loading @@ -181,8 +180,7 @@ public class ClearAllButton extends Button implements PageCallbacks { PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler(); orientationHandler.getPrimaryViewTranslate().set(this, orientationHandler.getPrimaryValue(0f, getOriginalTranslationY()) + mNormalTranslationPrimary + mOffsetTranslationPrimary + getGridTrans( mGridTranslationPrimary)); + mNormalTranslationPrimary + getGridTrans(mGridTranslationPrimary)); } private void applySecondaryTranslation() { Loading quickstep/src/com/android/quickstep/views/RecentsView.java +5 −10 Original line number Diff line number Diff line Loading @@ -1192,7 +1192,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView // Compensate page spacing widening caused by RecentsView scaling. widthDiff += mPageSpacing * (1 - 1 / mFullscreenScale); float fullscreenTranslationX = mIsRtl ? widthDiff : -widthDiff; fullscreenTranslations[i] += fullscreenTranslationX; accumulatedTranslationX += fullscreenTranslationX; } Loading @@ -1203,6 +1202,11 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView fullscreenTranslations[i] - fullscreenTranslations[firstNonHomeTaskIndex]); } // Align ClearAllButton to the left (RTL) or right (non-RTL), which is different from other // TaskViews. int clearAllWidthDiff = mTaskWidth - mClearAllButton.getWidth(); mClearAllButton.setScrollOffsetPrimary(mIsRtl ? clearAllWidthDiff : -clearAllWidthDiff); updateGridProperties(false); } Loading Loading @@ -1746,20 +1750,12 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView } } // If the first non-home task does not take full width of task Rect, shift all tasks // accordingly without affecting scrolls. int firstTaskWidth = getTaskViewAt(firstNonHomeTaskIndex).getLayoutParams().width; float firstNonHomeTaskOffset = firstTaskWidth == ViewGroup.LayoutParams.MATCH_PARENT ? 0 : mTaskWidth - firstTaskWidth; float offsetTranslation = mIsRtl ? firstNonHomeTaskOffset : -firstNonHomeTaskOffset; // We need to maintain first non-home task's grid translation at 0, now shift translation // of all the TaskViews to achieve that. for (int i = firstNonHomeTaskIndex; i < taskCount; i++) { TaskView taskView = getTaskViewAt(i); taskView.setGridTranslationX( gridTranslations[i] - gridTranslations[firstNonHomeTaskIndex]); taskView.setGridOffsetTranslationX(offsetTranslation); } // Use the accumulated translation of the longer row. Loading Loading @@ -1803,7 +1799,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView mClearAllButton.setGridScrollOffset( mIsRtl ? mLastComputedTaskSize.left - mLastComputedGridSize.left : mLastComputedTaskSize.right - mLastComputedGridSize.right); mClearAllButton.setOffsetTranslationPrimary(offsetTranslation); setGridProgress(mGridProgress); } Loading quickstep/src/com/android/quickstep/views/TaskView.java +4 −16 Original line number Diff line number Diff line Loading @@ -295,8 +295,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { // The following grid translations scales with mGridProgress. private float mGridTranslationX; private float mGridTranslationY; // Offset translation does not affect scroll calculation. private float mGridOffsetTranslationX; private ObjectAnimator mIconAndDimAnimator; private float mIconScaleAnimStartProgress = 0; Loading Loading @@ -792,8 +790,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { @Override public void onRecycle() { mFullscreenTranslationX = mGridTranslationX = mGridTranslationY = mGridOffsetTranslationX = mBoxTranslationY = 0f; mFullscreenTranslationX = mGridTranslationX = mGridTranslationY = mBoxTranslationY = 0f; resetViewTransforms(); // Clear any references to the thumbnail (it will be re-read either from the cache or the // system on next bind) Loading Loading @@ -874,7 +871,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); if (mActivity.getDeviceProfile().isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get()) { setPivotX(getLayoutDirection() == LAYOUT_DIRECTION_RTL ? (right - left) : 0); setPivotX(getLayoutDirection() == LAYOUT_DIRECTION_RTL ? 0 : right - left); setPivotY(mSnapshotView.getTop()); } else { setPivotX((right - left) * 0.5f); Loading Loading @@ -979,11 +976,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { return mGridTranslationY; } public void setGridOffsetTranslationX(float gridOffsetTranslationX) { mGridOffsetTranslationX = gridOffsetTranslationX; applyTranslationX(); } public float getScrollAdjustment(boolean fullscreenEnabled, boolean gridEnabled) { float scrollAdjustment = 0; if (fullscreenEnabled) { Loading @@ -996,11 +988,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { } public float getOffsetAdjustment(boolean fullscreenEnabled,boolean gridEnabled) { float offsetAdjustment = getScrollAdjustment(fullscreenEnabled, gridEnabled); if (gridEnabled) { offsetAdjustment += mGridOffsetTranslationX; } return offsetAdjustment; return getScrollAdjustment(fullscreenEnabled, gridEnabled); } public float getSizeAdjustment(boolean fullscreenEnabled) { Loading @@ -1019,7 +1007,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { private void applyTranslationX() { setTranslationX(mDismissTranslationX + mTaskOffsetTranslationX + mTaskResistanceTranslationX + getFullscreenTrans(mFullscreenTranslationX) + getGridTrans(mGridTranslationX + mGridOffsetTranslationX)); + getGridTrans(mGridTranslationX)); } private void applyTranslationY() { Loading src/com/android/launcher3/PagedView.java +4 −7 Original line number Diff line number Diff line Loading @@ -715,13 +715,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou final int primaryDimension = bounds.primaryDimension; final int childPrimaryEnd = bounds.childPrimaryEnd; // In case the pages are of different width, align the page to left or right edge // based on the orientation. // In case we have multiple panels on the screen, scrollOffsetEnd is the scroll // needed for the whole visible area, so we have to divide it by panelCount. final int pageScroll = mIsRtl ? (childStart - scrollOffsetStart) : Math.max(0, childPrimaryEnd - scrollOffsetEnd / getPanelCount()); // In case the pages are of different width, align the page to left edge for non-RTL // or right edge for RTL. final int pageScroll = mIsRtl ? childPrimaryEnd - scrollOffsetEnd : childStart - scrollOffsetStart; if (outPageScrolls[i] != pageScroll) { pageScrollChanged = true; outPageScrolls[i] = pageScroll; Loading Loading
quickstep/src/com/android/quickstep/views/ClearAllButton.java +5 −7 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class ClearAllButton extends Button implements PageCallbacks { private float mGridTranslationPrimary; private float mGridTranslationSecondary; private float mGridScrollOffset; private float mOffsetTranslationPrimary; private float mScrollOffsetPrimary; private int mSidePadding; Loading Loading @@ -144,9 +144,8 @@ public class ClearAllButton extends Button implements PageCallbacks { mGridScrollOffset = gridScrollOffset; } public void setOffsetTranslationPrimary(float offsetTranslationPrimary) { mOffsetTranslationPrimary = offsetTranslationPrimary; applyPrimaryTranslation(); public void setScrollOffsetPrimary(float scrollOffsetPrimary) { mScrollOffsetPrimary = scrollOffsetPrimary; } public float getScrollAdjustment(boolean gridEnabled) { Loading @@ -154,7 +153,7 @@ public class ClearAllButton extends Button implements PageCallbacks { if (gridEnabled) { scrollAdjustment += mGridTranslationPrimary + mGridScrollOffset; } scrollAdjustment += mOffsetTranslationPrimary; scrollAdjustment += mScrollOffsetPrimary; return scrollAdjustment; } Loading @@ -181,8 +180,7 @@ public class ClearAllButton extends Button implements PageCallbacks { PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler(); orientationHandler.getPrimaryViewTranslate().set(this, orientationHandler.getPrimaryValue(0f, getOriginalTranslationY()) + mNormalTranslationPrimary + mOffsetTranslationPrimary + getGridTrans( mGridTranslationPrimary)); + mNormalTranslationPrimary + getGridTrans(mGridTranslationPrimary)); } private void applySecondaryTranslation() { Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +5 −10 Original line number Diff line number Diff line Loading @@ -1192,7 +1192,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView // Compensate page spacing widening caused by RecentsView scaling. widthDiff += mPageSpacing * (1 - 1 / mFullscreenScale); float fullscreenTranslationX = mIsRtl ? widthDiff : -widthDiff; fullscreenTranslations[i] += fullscreenTranslationX; accumulatedTranslationX += fullscreenTranslationX; } Loading @@ -1203,6 +1202,11 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView fullscreenTranslations[i] - fullscreenTranslations[firstNonHomeTaskIndex]); } // Align ClearAllButton to the left (RTL) or right (non-RTL), which is different from other // TaskViews. int clearAllWidthDiff = mTaskWidth - mClearAllButton.getWidth(); mClearAllButton.setScrollOffsetPrimary(mIsRtl ? clearAllWidthDiff : -clearAllWidthDiff); updateGridProperties(false); } Loading Loading @@ -1746,20 +1750,12 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView } } // If the first non-home task does not take full width of task Rect, shift all tasks // accordingly without affecting scrolls. int firstTaskWidth = getTaskViewAt(firstNonHomeTaskIndex).getLayoutParams().width; float firstNonHomeTaskOffset = firstTaskWidth == ViewGroup.LayoutParams.MATCH_PARENT ? 0 : mTaskWidth - firstTaskWidth; float offsetTranslation = mIsRtl ? firstNonHomeTaskOffset : -firstNonHomeTaskOffset; // We need to maintain first non-home task's grid translation at 0, now shift translation // of all the TaskViews to achieve that. for (int i = firstNonHomeTaskIndex; i < taskCount; i++) { TaskView taskView = getTaskViewAt(i); taskView.setGridTranslationX( gridTranslations[i] - gridTranslations[firstNonHomeTaskIndex]); taskView.setGridOffsetTranslationX(offsetTranslation); } // Use the accumulated translation of the longer row. Loading Loading @@ -1803,7 +1799,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView mClearAllButton.setGridScrollOffset( mIsRtl ? mLastComputedTaskSize.left - mLastComputedGridSize.left : mLastComputedTaskSize.right - mLastComputedGridSize.right); mClearAllButton.setOffsetTranslationPrimary(offsetTranslation); setGridProgress(mGridProgress); } Loading
quickstep/src/com/android/quickstep/views/TaskView.java +4 −16 Original line number Diff line number Diff line Loading @@ -295,8 +295,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { // The following grid translations scales with mGridProgress. private float mGridTranslationX; private float mGridTranslationY; // Offset translation does not affect scroll calculation. private float mGridOffsetTranslationX; private ObjectAnimator mIconAndDimAnimator; private float mIconScaleAnimStartProgress = 0; Loading Loading @@ -792,8 +790,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { @Override public void onRecycle() { mFullscreenTranslationX = mGridTranslationX = mGridTranslationY = mGridOffsetTranslationX = mBoxTranslationY = 0f; mFullscreenTranslationX = mGridTranslationX = mGridTranslationY = mBoxTranslationY = 0f; resetViewTransforms(); // Clear any references to the thumbnail (it will be re-read either from the cache or the // system on next bind) Loading Loading @@ -874,7 +871,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); if (mActivity.getDeviceProfile().isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get()) { setPivotX(getLayoutDirection() == LAYOUT_DIRECTION_RTL ? (right - left) : 0); setPivotX(getLayoutDirection() == LAYOUT_DIRECTION_RTL ? 0 : right - left); setPivotY(mSnapshotView.getTop()); } else { setPivotX((right - left) * 0.5f); Loading Loading @@ -979,11 +976,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { return mGridTranslationY; } public void setGridOffsetTranslationX(float gridOffsetTranslationX) { mGridOffsetTranslationX = gridOffsetTranslationX; applyTranslationX(); } public float getScrollAdjustment(boolean fullscreenEnabled, boolean gridEnabled) { float scrollAdjustment = 0; if (fullscreenEnabled) { Loading @@ -996,11 +988,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { } public float getOffsetAdjustment(boolean fullscreenEnabled,boolean gridEnabled) { float offsetAdjustment = getScrollAdjustment(fullscreenEnabled, gridEnabled); if (gridEnabled) { offsetAdjustment += mGridOffsetTranslationX; } return offsetAdjustment; return getScrollAdjustment(fullscreenEnabled, gridEnabled); } public float getSizeAdjustment(boolean fullscreenEnabled) { Loading @@ -1019,7 +1007,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { private void applyTranslationX() { setTranslationX(mDismissTranslationX + mTaskOffsetTranslationX + mTaskResistanceTranslationX + getFullscreenTrans(mFullscreenTranslationX) + getGridTrans(mGridTranslationX + mGridOffsetTranslationX)); + getGridTrans(mGridTranslationX)); } private void applyTranslationY() { Loading
src/com/android/launcher3/PagedView.java +4 −7 Original line number Diff line number Diff line Loading @@ -715,13 +715,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou final int primaryDimension = bounds.primaryDimension; final int childPrimaryEnd = bounds.childPrimaryEnd; // In case the pages are of different width, align the page to left or right edge // based on the orientation. // In case we have multiple panels on the screen, scrollOffsetEnd is the scroll // needed for the whole visible area, so we have to divide it by panelCount. final int pageScroll = mIsRtl ? (childStart - scrollOffsetStart) : Math.max(0, childPrimaryEnd - scrollOffsetEnd / getPanelCount()); // In case the pages are of different width, align the page to left edge for non-RTL // or right edge for RTL. final int pageScroll = mIsRtl ? childPrimaryEnd - scrollOffsetEnd : childStart - scrollOffsetStart; if (outPageScrolls[i] != pageScroll) { pageScrollChanged = true; outPageScrolls[i] = pageScroll; Loading