Fix stutter when swiping workspace first time

Bug # 5366313

Change-Id: If4212d0cd626d0829e3e4487da52f455b0b89983
This commit is contained in:
Michael Jurka
2011-09-30 19:32:27 -07:00
committed by Adam Powell
parent 3a02e82cff
commit c1f5d26675
2 changed files with 21 additions and 0 deletions
+11
View File
@@ -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
+10
View File
@@ -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();