Fix stutter when swiping workspace first time
Bug # 5366313 Change-Id: If4212d0cd626d0829e3e4487da52f455b0b89983
This commit is contained in:
committed by
Adam Powell
parent
3a02e82cff
commit
c1f5d26675
@@ -244,6 +244,12 @@ public final class Launcher extends Activity
|
||||
|
||||
private BubbleTextView mWaitingForResume;
|
||||
|
||||
private Runnable mBuildLayersRunnable = new Runnable() {
|
||||
public void run() {
|
||||
mWorkspace.buildPageHardwareLayers();
|
||||
}
|
||||
};
|
||||
|
||||
private static ArrayList<PendingAddArguments> sPendingAddList
|
||||
= new ArrayList<PendingAddArguments>();
|
||||
|
||||
@@ -550,6 +556,9 @@ public final class Launcher extends Activity
|
||||
// When we resume Launcher, a different Activity might be responsible for the app
|
||||
// market intent, so refresh the icon
|
||||
updateAppMarketIcon();
|
||||
if (!mWorkspaceLoading) {
|
||||
mWorkspace.post(mBuildLayersRunnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2964,6 +2973,8 @@ public final class Launcher extends Activity
|
||||
// Update the market app icon as necessary (the other icons will be managed in response to
|
||||
// package changes in bindSearchablesChanged()
|
||||
updateAppMarketIcon();
|
||||
|
||||
mWorkspace.post(mBuildLayersRunnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -313,6 +313,16 @@ public class Workspace extends SmoothPagedView
|
||||
setMotionEventSplittingEnabled(true);
|
||||
}
|
||||
|
||||
public void buildPageHardwareLayers() {
|
||||
if (getWindowToken() != null) {
|
||||
final int childCount = getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
CellLayout cl = (CellLayout) getChildAt(i);
|
||||
cl.buildChildrenLayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onDragStart(DragSource source, Object info, int dragAction) {
|
||||
mIsDragOccuring = true;
|
||||
updateChildrenLayersEnabled();
|
||||
|
||||
Reference in New Issue
Block a user