Merge "stop using hardware layers when workspace stops moving" into honeycomb
This commit is contained in:
committed by
Android (Google) Code Review
commit
7cbb7c6041
@@ -273,12 +273,12 @@ public abstract class PagedView extends ViewGroup {
|
||||
}
|
||||
}
|
||||
|
||||
private void pageBeginMoving() {
|
||||
protected void pageBeginMoving() {
|
||||
mIsPageMoving = true;
|
||||
onPageBeginMoving();
|
||||
}
|
||||
|
||||
private void pageEndMoving() {
|
||||
protected void pageEndMoving() {
|
||||
onPageEndMoving();
|
||||
mIsPageMoving = false;
|
||||
}
|
||||
|
||||
@@ -306,9 +306,14 @@ public class Workspace extends SmoothPagedView
|
||||
}
|
||||
mWallpaperOffset.setOverrideHorizontalCatchupConstant(false);
|
||||
mAnimator = null;
|
||||
enableChildrenLayers(false);
|
||||
}
|
||||
};
|
||||
mShrinkAnimationListener = new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
enableChildrenLayers(true);
|
||||
}
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mWallpaperOffset.setOverrideHorizontalCatchupConstant(false);
|
||||
@@ -1253,6 +1258,25 @@ public class Workspace extends SmoothPagedView
|
||||
return super.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
protected void enableChildrenLayers(boolean enable) {
|
||||
for (int i = 0; i < getPageCount(); i++) {
|
||||
setChildrenLayersEnabled(enable);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void pageBeginMoving() {
|
||||
enableChildrenLayers(true);
|
||||
super.pageBeginMoving();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void pageEndMoving() {
|
||||
if (!mIsSmall && !mIsInUnshrinkAnimation) {
|
||||
enableChildrenLayers(false);
|
||||
}
|
||||
super.pageEndMoving();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onWallpaperTap(MotionEvent ev) {
|
||||
final int[] position = mTempCell;
|
||||
|
||||
Reference in New Issue
Block a user