summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-07-26 10:39:49 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-26 10:39:49 -0700
commitbf361decc703800d7db41ac87d1e3c87011b2c32 (patch)
treec78d7d8080936ce993982ab4d3a2ad660e0d123c /src
parentdccef8ca10b6e431b5c0ebaa2e11d9a53653ee3a (diff)
parentbb6f6a52b6d176be253b1514af459a7aa4e998f8 (diff)
downloadandroid_packages_apps_Trebuchet-bf361decc703800d7db41ac87d1e3c87011b2c32.tar.gz
android_packages_apps_Trebuchet-bf361decc703800d7db41ac87d1e3c87011b2c32.tar.bz2
android_packages_apps_Trebuchet-bf361decc703800d7db41ac87d1e3c87011b2c32.zip
Merge "Fixing regression in divider visibility during spring loaded mode. (5076848)"
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/Launcher.java9
-rw-r--r--src/com/android/launcher2/PagedView.java53
2 files changed, 61 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 795d5ccb9..5839d40ec 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2113,6 +2113,7 @@ public final class Launcher extends Activity
if (!springLoaded && !LauncherApplication.isScreenLarge()) {
// Hide the workspace scrollbar
mWorkspace.hideScrollingIndicator(true);
+ mWorkspace.hideDockDivider(true);
}
}
});
@@ -2138,6 +2139,7 @@ public final class Launcher extends Activity
if (!springLoaded && !LauncherApplication.isScreenLarge()) {
// Hide the workspace scrollbar
mWorkspace.hideScrollingIndicator(true);
+ mWorkspace.hideDockDivider(true);
}
}
}
@@ -2192,6 +2194,12 @@ public final class Launcher extends Activity
}
alphaAnim.addListener(new AnimatorListenerAdapter() {
@Override
+ public void onAnimationStart(android.animation.Animator animation) {
+ if (!springLoaded) {
+ mWorkspace.showDockDivider(false);
+ }
+ }
+ @Override
public void onAnimationEnd(Animator animation) {
fromView.setVisibility(View.GONE);
if (fromView instanceof LauncherTransitionable) {
@@ -2211,6 +2219,7 @@ public final class Launcher extends Activity
if (!springLoaded && !LauncherApplication.isScreenLarge()) {
// Flash the workspace scrollbar
+ mWorkspace.showDockDivider(true);
mWorkspace.flashScrollingIndicator();
}
}
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 26f0e57a3..596ef50bb 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -20,6 +20,7 @@ import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@@ -161,7 +162,8 @@ public abstract class PagedView extends ViewGroup {
protected boolean mIsDataReady = false;
// Scrolling indicator
- private android.animation.ValueAnimator mScrollIndicatorAnimator;
+ private ValueAnimator mScrollIndicatorAnimator;
+ private android.animation.ValueAnimator mDockDividerAnimator;
private ImageView mScrollIndicator;
private int mScrollIndicatorPaddingLeft;
private int mScrollIndicatorPaddingRight;
@@ -1738,6 +1740,55 @@ public abstract class PagedView extends ViewGroup {
}
}
+ void showDockDivider(boolean immediately) {
+ final ViewGroup parent = (ViewGroup) getParent();
+ final View divider = (ImageView) (parent.findViewById(R.id.dock_divider));
+ if (divider != null) {
+ divider.setVisibility(View.VISIBLE);
+ if (mDockDividerAnimator != null) {
+ mDockDividerAnimator.cancel();
+ }
+ if (immediately) {
+ divider.setAlpha(1f);
+ } else {
+ mDockDividerAnimator = ObjectAnimator.ofFloat(divider, "alpha", 1f);
+ mDockDividerAnimator.setDuration(sScrollIndicatorFadeInDuration);
+ mDockDividerAnimator.start();
+ }
+ }
+ }
+
+ void hideDockDivider(boolean immediately) {
+ final ViewGroup parent = (ViewGroup) getParent();
+ final View divider = (ImageView) (parent.findViewById(R.id.dock_divider));
+ if (divider != null) {
+ if (mDockDividerAnimator != null) {
+ mDockDividerAnimator.cancel();
+ }
+ if (immediately) {
+ divider.setVisibility(View.GONE);
+ divider.setAlpha(0f);
+ } else {
+ mDockDividerAnimator = ObjectAnimator.ofFloat(divider, "alpha", 0f);
+ mDockDividerAnimator.setDuration(sScrollIndicatorFadeOutDuration);
+ mDockDividerAnimator.addListener(new AnimatorListenerAdapter() {
+ private boolean cancelled = false;
+ @Override
+ public void onAnimationCancel(android.animation.Animator animation) {
+ cancelled = true;
+ }
+ @Override
+ public void onAnimationEnd(android.animation.Animator animation) {
+ if (!cancelled) {
+ divider.setVisibility(View.GONE);
+ }
+ }
+ });
+ mDockDividerAnimator.start();
+ }
+ }
+ }
+
/**
* To be overridden by subclasses to determine whether the scroll indicator should stretch to
* fill its space on the track or not.