diff options
author | Raj Yengisetty <rajesh@cyngn.com> | 2014-07-07 14:44:16 -0700 |
---|---|---|
committer | Rajesh Yengisetty <rajesh@cyngn.com> | 2014-07-08 01:01:39 +0000 |
commit | 37bab8f1d631ffbe491f1d8858b159d65f3a9afc (patch) | |
tree | a619bc46de53b0f6973beccda3fce7437552b40c /src/com/android/launcher3/Launcher.java | |
parent | 92921aa2f933c25f0d7bfee5f1bf506bd3a436ab (diff) | |
download | android_packages_apps_Trebuchet-37bab8f1d631ffbe491f1d8858b159d65f3a9afc.tar.gz android_packages_apps_Trebuchet-37bab8f1d631ffbe491f1d8858b159d65f3a9afc.tar.bz2 android_packages_apps_Trebuchet-37bab8f1d631ffbe491f1d8858b159d65f3a9afc.zip |
Minimize greedy UI updating for Live Settings
Change-Id: Ib475af4bea7d45e36ca87be6b66a60d15018aa5b
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index ab3f1daa0..997e28fef 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -287,7 +287,7 @@ public class Launcher extends Activity private View mAllAppsButton; - private SearchDropTargetBar mSearchDropTargetBar; + protected SearchDropTargetBar mSearchDropTargetBar; private AppsCustomizeLayout mAppsCustomizeLayout; private AppsCustomizePagedView mAppsCustomizeContent; private boolean mAutoAdvanceRunning = false; @@ -306,6 +306,8 @@ public class Launcher extends Activity private boolean mWorkspaceLoading = true; + private boolean mDynamicGridUpdateRequired = false; + private boolean mPaused = true; private boolean mRestoring; private boolean mWaitingForResult; @@ -427,8 +429,6 @@ public class Launcher extends Activity public void onReceive(Context context, Intent intent) { // Update the workspace updateDynamicGrid(); - mWorkspace.hideOutlines(); - mSearchDropTargetBar.showSearchBar(false); } }; @@ -1060,6 +1060,9 @@ public class Launcher extends Activity } super.onResume(); + + updateGridIfNeeded(); + if(isGelIntegrationEnabled() && isGelIntegrationSupported()) { GelIntegrationHelper.getInstance().handleGelResume(); } @@ -1194,9 +1197,6 @@ public class Launcher extends Activity if (mWorkspace.getCustomContentCallbacks() != null) { mWorkspace.getCustomContentCallbacks().onHide(); } - - //Reset the OverviewPanel position - ((SlidingUpPanelLayout) mOverviewPanel).collapsePane(); } QSBScroller mQsbScroller = new QSBScroller() { @@ -2116,6 +2116,8 @@ public class Launcher extends Activity } super.onNewIntent(intent); + updateGridIfNeeded(); + // Close the menu if (Intent.ACTION_MAIN.equals(intent.getAction())) { // also will cancel mWaitingForResult. @@ -4924,17 +4926,30 @@ public class Launcher extends Activity } public void updateDynamicGrid() { - mSearchDropTargetBar.setupQSB(this); - mSearchDropTargetBar.hideSearchBar(false); + mSearchDropTargetBar.setupQSB(Launcher.this); initializeDynamicGrid(); - mGrid.layout(this); - mWorkspace.showOutlines(); + mGrid.layout(Launcher.this); // Synchronized reload mModel.startLoader(true, mWorkspace.getCurrentPage()); mWorkspace.updateCustomContentVisibility(); + + } + + public void setUpdateDynamicGrid() { + mDynamicGridUpdateRequired = true; + } + + public boolean updateGridIfNeeded() { + if (mDynamicGridUpdateRequired) { + updateDynamicGrid(); + mDynamicGridUpdateRequired = false; + return true; + } + + return false; } public boolean isSearchBarEnabled() { |