diff options
author | Winson Chung <winsonc@google.com> | 2011-03-30 15:37:10 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-30 15:37:10 -0700 |
commit | 3f272c6665090a006859892f441b058deb3d6fab (patch) | |
tree | e464556ec7426b186df24c478199a2a829d3d225 | |
parent | b9e2749d3d3379622dbbe38bd6c60f88f7fa827b (diff) | |
parent | 337cd9d3f6b2abfe7e70a8e20f0017d67e9535ff (diff) | |
download | packages_apps_trebuchet-3f272c6665090a006859892f441b058deb3d6fab.zip packages_apps_trebuchet-3f272c6665090a006859892f441b058deb3d6fab.tar.gz packages_apps_trebuchet-3f272c6665090a006859892f441b058deb3d6fab.tar.bz2 |
Merge "Resetting AllApps to first page when turning screen off/hitting home."
-rw-r--r-- | src/com/android/launcher2/AllApps2D.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/AllApps3D.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/AllAppsPagedView.java | 5 | ||||
-rw-r--r-- | src/com/android/launcher2/AllAppsTabbed.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/AllAppsView.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 10 |
6 files changed, 30 insertions, 0 deletions
diff --git a/src/com/android/launcher2/AllApps2D.java b/src/com/android/launcher2/AllApps2D.java index 329109f..854c1ee 100644 --- a/src/com/android/launcher2/AllApps2D.java +++ b/src/com/android/launcher2/AllApps2D.java @@ -341,6 +341,10 @@ public class AllApps2D public void surrender() { } + + public void reset() { + // Do nothing + } } diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java index d42481b..a8aea18 100644 --- a/src/com/android/launcher2/AllApps3D.java +++ b/src/com/android/launcher2/AllApps3D.java @@ -1470,4 +1470,8 @@ public class AllApps3D extends RSSurfaceView sRS.contextDump(); } } + + public void reset() { + // Do nothing + } } diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java index 87d255e..3924c57 100644 --- a/src/com/android/launcher2/AllAppsPagedView.java +++ b/src/com/android/launcher2/AllAppsPagedView.java @@ -450,6 +450,11 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All // do nothing? } + public void reset() { + setCurrentPage(0); + invalidatePageData(); + } + private void setupPage(PagedViewCellLayout layout) { layout.setCellCount(mCellCountX, mCellCountY); layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop, mPageLayoutPaddingRight, diff --git a/src/com/android/launcher2/AllAppsTabbed.java b/src/com/android/launcher2/AllAppsTabbed.java index ee7bfc0..059d0ae 100644 --- a/src/com/android/launcher2/AllAppsTabbed.java +++ b/src/com/android/launcher2/AllAppsTabbed.java @@ -248,6 +248,10 @@ public class AllAppsTabbed extends TabHost implements AllAppsView, LauncherTrans mAllApps.surrender(); } + public void reset() { + mAllApps.reset(); + } + @Override public boolean onTouchEvent(MotionEvent ev) { if (ev.getY() > mAllApps.getBottom()) { diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java index 007ecf8..3a74c71 100644 --- a/src/com/android/launcher2/AllAppsView.java +++ b/src/com/android/launcher2/AllAppsView.java @@ -41,6 +41,9 @@ public interface AllAppsView { public void updateApps(ArrayList<ApplicationInfo> list); + // Resets the AllApps page to the front + public void reset(); + public void dumpState(); public void surrender(); diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index fc17643..a68bd9b 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1253,6 +1253,11 @@ public final class Launcher extends Activity if (Intent.ACTION_SCREEN_OFF.equals(action)) { mUserPresent = false; updateRunning(); + + // Reset AllApps to it's initial state + if (mAllAppsGrid != null) { + mAllAppsGrid.reset(); + } } else if (Intent.ACTION_USER_PRESENT.equals(action)) { mUserPresent = true; updateRunning(); @@ -1424,6 +1429,11 @@ public final class Launcher extends Activity INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(v.getWindowToken(), 0); } + + // Reset AllApps to it's initial state + if (mAllAppsGrid != null) { + mAllAppsGrid.reset(); + } } } |