Fix bug 2646531 - regression in home screen bitmap caching
Looks like the code path for buildDrawingCache(false) has some bugs. This reverts to the old code path and tries to manage the creation of those caches a bit better. Change-Id: Ic468e9db396c51f723454dc3832e0cd1c0c82004
This commit is contained in:
@@ -584,7 +584,7 @@ public class CellLayout extends ViewGroup {
|
|||||||
final View view = getChildAt(i);
|
final View view = getChildAt(i);
|
||||||
view.setDrawingCacheEnabled(enabled);
|
view.setDrawingCacheEnabled(enabled);
|
||||||
// Update the drawing caches
|
// Update the drawing caches
|
||||||
view.buildDrawingCache(false);
|
view.buildDrawingCache(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
|||||||
// Scroll if the user moved far enough along the X axis
|
// Scroll if the user moved far enough along the X axis
|
||||||
mTouchState = TOUCH_STATE_SCROLLING;
|
mTouchState = TOUCH_STATE_SCROLLING;
|
||||||
mLastMotionX = x;
|
mLastMotionX = x;
|
||||||
enableChildrenCache(0, getChildCount());
|
enableChildrenCache(mCurrentScreen - 1, mCurrentScreen + 1);
|
||||||
}
|
}
|
||||||
// Either way, cancel any pending longpress
|
// Either way, cancel any pending longpress
|
||||||
if (mAllowLongPress) {
|
if (mAllowLongPress) {
|
||||||
@@ -868,6 +868,9 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
|||||||
// Remember where the motion event started
|
// Remember where the motion event started
|
||||||
mLastMotionX = ev.getX();
|
mLastMotionX = ev.getX();
|
||||||
mActivePointerId = ev.getPointerId(0);
|
mActivePointerId = ev.getPointerId(0);
|
||||||
|
if (mTouchState == TOUCH_STATE_SCROLLING) {
|
||||||
|
enableChildrenCache(mCurrentScreen - 1, mCurrentScreen + 1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
if (mTouchState == TOUCH_STATE_SCROLLING) {
|
if (mTouchState == TOUCH_STATE_SCROLLING) {
|
||||||
|
|||||||
Reference in New Issue
Block a user