Merge "Fix some jank with transitions" into ub-launcher3-edmonton
This commit is contained in:
@@ -41,8 +41,9 @@ public class WorkspacePageIndicator extends View implements Insettable, PageIndi
|
||||
private static final int LINE_ALPHA_ANIMATOR_INDEX = 0;
|
||||
private static final int NUM_PAGES_ANIMATOR_INDEX = 1;
|
||||
private static final int TOTAL_SCROLL_ANIMATOR_INDEX = 2;
|
||||
private static final int ANIMATOR_COUNT = 3;
|
||||
|
||||
private ValueAnimator[] mAnimators = new ValueAnimator[3];
|
||||
private ValueAnimator[] mAnimators = new ValueAnimator[ANIMATOR_COUNT];
|
||||
|
||||
private final Handler mDelayedLineFadeHandler = new Handler(Looper.getMainLooper());
|
||||
private final Launcher mLauncher;
|
||||
@@ -232,6 +233,28 @@ public class WorkspacePageIndicator extends View implements Insettable, PageIndi
|
||||
mAnimators[animatorIndex].start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Pauses all currently running animations.
|
||||
*/
|
||||
public void pauseAnimations() {
|
||||
for (int i = 0; i < ANIMATOR_COUNT; i++) {
|
||||
if (mAnimators[i] != null) {
|
||||
mAnimators[i].pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Force-ends all currently running or paused animations.
|
||||
*/
|
||||
public void skipAnimationsToEnd() {
|
||||
for (int i = 0; i < ANIMATOR_COUNT; i++) {
|
||||
if (mAnimators[i] != null) {
|
||||
mAnimators[i].end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInsets(Rect insets) {
|
||||
DeviceProfile grid = mLauncher.getDeviceProfile();
|
||||
|
||||
Reference in New Issue
Block a user