am f10b0f92: am 3e232794: am 76bf5553: Merge "A bit of code cleanup (issue 11026590)" into jb-ub-now-jetsonic
* commit 'f10b0f921ad1c9352aef14d8b5661a992031c7f8': A bit of code cleanup (issue 11026590)
This commit is contained in:
@@ -3011,7 +3011,7 @@ public class Launcher extends Activity
|
|||||||
|
|
||||||
dispatchOnLauncherTransitionPrepare(fromView, animated, true);
|
dispatchOnLauncherTransitionPrepare(fromView, animated, true);
|
||||||
dispatchOnLauncherTransitionPrepare(toView, animated, true);
|
dispatchOnLauncherTransitionPrepare(toView, animated, true);
|
||||||
mAppsCustomizeContent.pauseScrolling();
|
mAppsCustomizeContent.stopScrolling();
|
||||||
|
|
||||||
mStateAnimation.addListener(new AnimatorListenerAdapter() {
|
mStateAnimation.addListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
@@ -3023,7 +3023,6 @@ public class Launcher extends Activity
|
|||||||
onCompleteRunnable.run();
|
onCompleteRunnable.run();
|
||||||
}
|
}
|
||||||
mAppsCustomizeContent.updateCurrentPageScroll();
|
mAppsCustomizeContent.updateCurrentPageScroll();
|
||||||
mAppsCustomizeContent.resumeScrolling();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -506,33 +506,39 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||||||
}
|
}
|
||||||
scrollTo(newX, 0);
|
scrollTo(newX, 0);
|
||||||
mScroller.setFinalX(newX);
|
mScroller.setFinalX(newX);
|
||||||
mScroller.forceFinished(true);
|
forceFinishScroller();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called during AllApps/Home transitions to avoid unnecessary work. When that other animation
|
* Called during AllApps/Home transitions to avoid unnecessary work. When that other animation
|
||||||
* ends, {@link #resumeScrolling()} should be called, along with
|
* {@link #updateCurrentPageScroll()} should be called, to correctly set the final state and
|
||||||
* {@link #updateCurrentPageScroll()} to correctly set the final state and re-enable scrolling.
|
* re-enable scrolling.
|
||||||
*/
|
*/
|
||||||
void pauseScrolling() {
|
void stopScrolling() {
|
||||||
mScroller.forceFinished(true);
|
mCurrentPage = mNextPage;
|
||||||
|
forceFinishScroller();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void abortScrollerAnimation() {
|
||||||
* Enables scrolling again.
|
mScroller.abortAnimation();
|
||||||
* @see #pauseScrolling()
|
// We need to clean up the next page here to avoid computeScrollHelper from
|
||||||
*/
|
// updating current page on the pass.
|
||||||
void resumeScrolling() {
|
mNextPage = INVALID_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void forceFinishScroller() {
|
||||||
|
mScroller.forceFinished(true);
|
||||||
|
// We need to clean up the next page here to avoid computeScrollHelper from
|
||||||
|
// updating current page on the pass.
|
||||||
|
mNextPage = INVALID_PAGE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current page.
|
* Sets the current page.
|
||||||
*/
|
*/
|
||||||
void setCurrentPage(int currentPage) {
|
void setCurrentPage(int currentPage) {
|
||||||
if (!mScroller.isFinished()) {
|
if (!mScroller.isFinished()) {
|
||||||
mScroller.abortAnimation();
|
abortScrollerAnimation();
|
||||||
// We need to clean up the next page here to avoid computeScrollHelper from
|
|
||||||
// updating current page on the pass.
|
|
||||||
mNextPage = INVALID_PAGE;
|
|
||||||
}
|
}
|
||||||
// don't introduce any checks like mCurrentPage == currentPage here-- if we change the
|
// don't introduce any checks like mCurrentPage == currentPage here-- if we change the
|
||||||
// the default
|
// the default
|
||||||
@@ -1366,7 +1372,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||||||
final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop);
|
final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop);
|
||||||
if (finishedScrolling) {
|
if (finishedScrolling) {
|
||||||
mTouchState = TOUCH_STATE_REST;
|
mTouchState = TOUCH_STATE_REST;
|
||||||
mScroller.abortAnimation();
|
abortScrollerAnimation();
|
||||||
} else {
|
} else {
|
||||||
if (isTouchPointInViewportWithBuffer((int) mDownMotionX, (int) mDownMotionY)) {
|
if (isTouchPointInViewportWithBuffer((int) mDownMotionX, (int) mDownMotionY)) {
|
||||||
mTouchState = TOUCH_STATE_SCROLLING;
|
mTouchState = TOUCH_STATE_SCROLLING;
|
||||||
@@ -1665,7 +1671,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||||||
* will be false if being flinged.
|
* will be false if being flinged.
|
||||||
*/
|
*/
|
||||||
if (!mScroller.isFinished()) {
|
if (!mScroller.isFinished()) {
|
||||||
mScroller.abortAnimation();
|
abortScrollerAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remember where the motion event started
|
// Remember where the motion event started
|
||||||
@@ -1863,7 +1869,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!mScroller.isFinished()) {
|
if (!mScroller.isFinished()) {
|
||||||
mScroller.abortAnimation();
|
abortScrollerAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
float scaleX = getScaleX();
|
float scaleX = getScaleX();
|
||||||
@@ -2327,8 +2333,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||||||
|
|
||||||
if (mContentIsRefreshable) {
|
if (mContentIsRefreshable) {
|
||||||
// Force all scrolling-related behavior to end
|
// Force all scrolling-related behavior to end
|
||||||
mScroller.forceFinished(true);
|
forceFinishScroller();
|
||||||
mNextPage = INVALID_PAGE;
|
|
||||||
|
|
||||||
// Update all the pages
|
// Update all the pages
|
||||||
syncPages();
|
syncPages();
|
||||||
|
|||||||
Reference in New Issue
Block a user