Snap for 9128909 from 226ad3d58c to udc-release
Change-Id: I41103b1d487ebf03a2f58241669fefd8a69af4a3
This commit is contained in:
commit
1edc7b2d0a
6 files changed
+52
-25
No files matched your search
@@ -139,10 +139,11 @@ public final class RecentsViewStateController extends
|
||||
|
||||
mRecentsView.createSplitSelectInitAnimation(builder,
|
||||
toState.getTransitionDuration(mLauncher, true /* isToState */));
|
||||
// Add properties to shift remaining taskViews to get out of placeholder view
|
||||
// Shift tasks vertically downward to get out of placeholder view
|
||||
builder.setFloat(mRecentsView, taskViewsFloat.first,
|
||||
toState.getSplitSelectTranslation(mLauncher),
|
||||
timings.getGridSlidePrimaryInterpolator());
|
||||
// Zero out horizontal translation
|
||||
builder.setFloat(mRecentsView, taskViewsFloat.second,
|
||||
0,
|
||||
timings.getGridSlideSecondaryInterpolator());
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
/**
|
||||
@@ -44,14 +47,14 @@ abstract class OverviewToSplitTimings implements SplitAnimationTimings {
|
||||
public int getInstructionsTextFadeInEnd() { return 300; }
|
||||
public int getInstructionsUnfoldStart() { return 167; }
|
||||
public int getInstructionsUnfoldEnd() { return 500; }
|
||||
public Interpolator getGridSlidePrimaryInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getGridSlideSecondaryInterpolator() { return INSTANT; }
|
||||
|
||||
abstract public int getDuration();
|
||||
abstract public Interpolator getStagedRectXInterpolator();
|
||||
abstract public Interpolator getStagedRectYInterpolator();
|
||||
abstract public Interpolator getStagedRectScaleXInterpolator();
|
||||
abstract public Interpolator getStagedRectScaleYInterpolator();
|
||||
abstract public Interpolator getGridSlidePrimaryInterpolator();
|
||||
abstract public Interpolator getGridSlideSecondaryInterpolator();
|
||||
|
||||
public float getGridSlideStartOffset() {
|
||||
return (float) getGridSlideStart() / getDuration();
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
@@ -41,6 +40,4 @@ public class PhoneOverviewToSplitTimings
|
||||
public Interpolator getStagedRectYInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getStagedRectScaleXInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getStagedRectScaleYInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getGridSlidePrimaryInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getGridSlideSecondaryInterpolator() { return INSTANT; }
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
@@ -41,6 +40,4 @@ public class TabletOverviewToSplitTimings
|
||||
public Interpolator getStagedRectYInterpolator() { return DEACCEL_2; }
|
||||
public Interpolator getStagedRectScaleXInterpolator() { return DEACCEL_2; }
|
||||
public Interpolator getStagedRectScaleYInterpolator() { return DEACCEL_2; }
|
||||
public Interpolator getGridSlidePrimaryInterpolator() { return LINEAR; }
|
||||
public Interpolator getGridSlideSecondaryInterpolator() { return LINEAR; }
|
||||
}
|
||||
@@ -3122,6 +3122,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
+ splitTimings.getGridSlideDurationOffset(), 0f, 1f)
|
||||
: 1f;
|
||||
|
||||
// Slide tiles in horizontally to fill dismissed area
|
||||
anim.setFloat(child, translationProperty, scrollDiff,
|
||||
clampToProgress(
|
||||
splitTimings.getGridSlidePrimaryInterpolator(),
|
||||
@@ -4293,6 +4294,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
snapToPageImmediately(pageToSnapTo);
|
||||
}
|
||||
onLayout(false /* changed */, getLeft(), getTop(), getRight(), getBottom());
|
||||
|
||||
// We are leaving split selection state, so it is safe to reset thumbnail translations for
|
||||
// the next time split is invoked.
|
||||
setTaskViewsPrimarySplitTranslation(0);
|
||||
setTaskViewsSecondarySplitTranslation(0);
|
||||
|
||||
resetTaskVisuals();
|
||||
mSplitHiddenTaskViewIndex = -1;
|
||||
}
|
||||
|
||||
@@ -153,6 +153,7 @@ public class PageIndicatorDots extends View implements PageIndicator {
|
||||
@Override
|
||||
public void setScroll(int currentScroll, int totalScroll) {
|
||||
if (mNumPages <= 1) {
|
||||
mCurrentScroll = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -296,8 +297,12 @@ public class PageIndicatorDots extends View implements PageIndicator {
|
||||
for (int i = 0; i < mEntryAnimationRadiusFactors.length; i++) {
|
||||
mPaginationPaint.setAlpha(i == mActivePage ? PAGE_INDICATOR_ALPHA : DOT_ALPHA);
|
||||
if (SHOW_DELIGHTFUL_PAGINATION_FOLDER.get()) {
|
||||
canvas.drawCircle(x, y, getRadius(x) * mEntryAnimationRadiusFactors[i],
|
||||
mPaginationPaint);
|
||||
if (i != mActivePage) {
|
||||
canvas.drawCircle(x, y, mDotRadius * mEntryAnimationRadiusFactors[i],
|
||||
mPaginationPaint);
|
||||
} else {
|
||||
drawPageIndicator(canvas, mEntryAnimationRadiusFactors[i]);
|
||||
}
|
||||
} else {
|
||||
canvas.drawCircle(x, y, mDotRadius * mEntryAnimationRadiusFactors[i],
|
||||
mPaginationPaint);
|
||||
@@ -319,26 +324,43 @@ public class PageIndicatorDots extends View implements PageIndicator {
|
||||
// Here we draw the current page indicator
|
||||
mPaginationPaint.setAlpha(PAGE_INDICATOR_ALPHA);
|
||||
if (SHOW_DELIGHTFUL_PAGINATION_FOLDER.get()) {
|
||||
RectF currRect = getActiveRect();
|
||||
|
||||
// Moves the canvas to start at the top left corner of the page indicator
|
||||
canvas.translate(currRect.left, currRect.top);
|
||||
|
||||
int scrollPerPage = getScrollPerPage();
|
||||
// This IF is to avoid division by 0
|
||||
if (scrollPerPage != 0) {
|
||||
int delta = mCurrentScroll % scrollPerPage;
|
||||
canvas.rotate((INDICATOR_ROTATION * delta) / scrollPerPage,
|
||||
mPageIndicatorRadius, mPageIndicatorRadius);
|
||||
}
|
||||
|
||||
mPageIndicatorDrawable.draw(canvas);
|
||||
drawPageIndicator(canvas, 1);
|
||||
} else {
|
||||
canvas.drawRoundRect(getActiveRect(), mDotRadius, mDotRadius, mPaginationPaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the page indicator, denoting the currently selected page
|
||||
*
|
||||
* @param canvas is used to draw the page indicator and to rotate it as we scroll
|
||||
* @param scale is used to set the scale of our canvas
|
||||
*/
|
||||
private void drawPageIndicator(Canvas canvas, float scale) {
|
||||
RectF currRect = getActiveRect();
|
||||
|
||||
// saves the canvas so we can later restore it to its original scale
|
||||
canvas.save();
|
||||
|
||||
// Moves the canvas to start at the top left corner of the page indicator
|
||||
canvas.translate(currRect.left, currRect.top);
|
||||
|
||||
// Scales the canvas in place to animate the indicator on entry
|
||||
canvas.scale(scale, scale, mPageIndicatorRadius, mPageIndicatorRadius);
|
||||
|
||||
int scrollPerPage = getScrollPerPage();
|
||||
// This IF is to avoid division by 0
|
||||
if (scrollPerPage != 0) {
|
||||
int delta = mCurrentScroll % scrollPerPage;
|
||||
canvas.rotate((INDICATOR_ROTATION * delta) / scrollPerPage,
|
||||
mPageIndicatorRadius, mPageIndicatorRadius);
|
||||
}
|
||||
|
||||
mPageIndicatorDrawable.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the radius of the circle based on how close the page indicator is to it
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user