summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-04-03 01:13:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-03 01:13:52 -0700
commite49eafc2294765672ed56c2b05818c532d571bb0 (patch)
treec07d5d7c30d8a220f2742af368e8ac0ac03bebc5
parent66b506113e7fced226d4da588e7f53b6f1246b6d (diff)
parent4ff7d79ddcee0a95fe6e7458731decd694b91d03 (diff)
downloadandroid_packages_apps_Trebuchet-e49eafc2294765672ed56c2b05818c532d571bb0.tar.gz
android_packages_apps_Trebuchet-e49eafc2294765672ed56c2b05818c532d571bb0.tar.bz2
android_packages_apps_Trebuchet-e49eafc2294765672ed56c2b05818c532d571bb0.zip
Merge "Show side pages when exiting spring-loaded mode"
-rw-r--r--src/com/android/launcher2/PagedView.java5
-rw-r--r--src/com/android/launcher2/Workspace.java6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 5434704ea..8a2a5a0ac 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -721,20 +721,21 @@ public abstract class PagedView extends ViewGroup {
protected void getVisiblePages(int[] range) {
final int pageCount = getChildCount();
+
if (pageCount > 0) {
final int screenWidth = getMeasuredWidth();
int leftScreen = 0;
int rightScreen = 0;
View currPage = getPageAt(leftScreen);
while (leftScreen < pageCount - 1 &&
- currPage.getRight() - currPage.getPaddingRight() < mScrollX) {
+ currPage.getX() + currPage.getWidth() - currPage.getPaddingRight() < mScrollX) {
leftScreen++;
currPage = getPageAt(leftScreen);
}
rightScreen = leftScreen;
currPage = getPageAt(rightScreen + 1);
while (rightScreen < pageCount - 1 &&
- currPage.getLeft() + currPage.getPaddingLeft() < mScrollX + screenWidth) {
+ currPage.getX() - currPage.getPaddingLeft() < mScrollX + screenWidth) {
rightScreen++;
currPage = getPageAt(rightScreen + 1);
}
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 91f1d3ec6..ba8b56f20 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -1568,6 +1568,7 @@ public class Workspace extends SmoothPagedView
final State oldState = mState;
final boolean oldStateIsNormal = (oldState == State.NORMAL);
+ final boolean oldStateIsSpringLoaded = (oldState == State.SPRING_LOADED);
final boolean oldStateIsSmall = (oldState == State.SMALL);
mState = state;
final boolean stateIsNormal = (state == State.NORMAL);
@@ -1608,8 +1609,9 @@ public class Workspace extends SmoothPagedView
if ((oldStateIsSmall && stateIsNormal) ||
(oldStateIsNormal && stateIsSmall)) {
// To/from workspace - only show the current page unless the transition is not
- // animated and the animation end callback below doesn't run
- if (i == mCurrentPage || !animated) {
+ // animated and the animation end callback below doesn't run;
+ // or, if we're in spring-loaded mode
+ if (i == mCurrentPage || !animated || oldStateIsSpringLoaded) {
finalAlpha = 1f;
finalAlphaMultiplierValue = 0f;
} else {