summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-01-30 15:11:08 -0800
committerWinson Chung <winsonc@google.com>2012-01-30 15:11:50 -0800
commit3b187b88baf80e520f6bd32d60abe6460d28a040 (patch)
treead9a5abf63cb373b5139e0d9ec6348231f0faa55 /src
parent63f541d52c7e5abc6a076213f62e806480f2026b (diff)
downloadandroid_packages_apps_Trebuchet-3b187b88baf80e520f6bd32d60abe6460d28a040.tar.gz
android_packages_apps_Trebuchet-3b187b88baf80e520f6bd32d60abe6460d28a040.tar.bz2
android_packages_apps_Trebuchet-3b187b88baf80e520f6bd32d60abe6460d28a040.zip
Fixing issue where AllApps icon would stay dimmed after pressing it (but not launching or long pressing).
Change-Id: If60fd76cd1fbef0b235c0a3d0870fd2da4c1b833
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java5
-rw-r--r--src/com/android/launcher2/PagedViewIcon.java11
2 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index eac3c47b4..7cfe3be2f 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -495,6 +495,11 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// Animate some feedback to the click
final ApplicationInfo appInfo = (ApplicationInfo) v.getTag();
mLauncher.startActivitySafely(appInfo.intent, appInfo);
+
+ // Lock the drawable state to pressed until we return to Launcher
+ if (mPressedIcon != null) {
+ mPressedIcon.lockDrawableState();
+ }
} else if (v instanceof PagedViewWidget) {
// Let the user know that they have to long press to add a widget
Toast.makeText(getContext(), R.string.long_press_widget_to_add,
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 00f9321c6..4149ab618 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -35,7 +35,7 @@ public class PagedViewIcon extends TextView {
private static final float PRESS_ALPHA = 0.4f;
private PagedViewIcon.PressedCallback mPressedCallback;
- private boolean mResetDrawableState = false;
+ private boolean mLockDrawableState = false;
private Bitmap mIcon;
@@ -60,8 +60,12 @@ public class PagedViewIcon extends TextView {
setTag(info);
}
+ public void lockDrawableState() {
+ mLockDrawableState = true;
+ }
+
public void resetDrawableState() {
- mResetDrawableState = true;
+ mLockDrawableState = false;
post(new Runnable() {
@Override
public void run() {
@@ -80,9 +84,8 @@ public class PagedViewIcon extends TextView {
if (mPressedCallback != null) {
mPressedCallback.iconPressed(this);
}
- } else if (mResetDrawableState) {
+ } else if (!mLockDrawableState) {
setAlpha(1f);
- mResetDrawableState = false;
}
}
}