summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-08-14 10:53:27 -0700
committerSunny Goyal <sunnygoyal@google.com>2014-08-19 18:03:06 -0700
commit508da15509224b46fcccabbe78f3e92fe69a67d8 (patch)
tree6c1601c69868b28d6e9abd2f1d4d916fe67686b1 /src/com/android/launcher3/Launcher.java
parentf8177d383a86bf0e5230f70c1635fa044ed4b0be (diff)
downloadandroid_packages_apps_Trebuchet-508da15509224b46fcccabbe78f3e92fe69a67d8.tar.gz
android_packages_apps_Trebuchet-508da15509224b46fcccabbe78f3e92fe69a67d8.tar.bz2
android_packages_apps_Trebuchet-508da15509224b46fcccabbe78f3e92fe69a67d8.zip
Updating the icon click feedback
> Using BubbleTextView everywhere, removed PagedIconView > There is a brightness feedback on touch and shadow feedback on click, until app launches issue: 16878374 Change-Id: I3dc1149a123c8a75feca6210948398bf2187f1f2
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java53
1 files changed, 24 insertions, 29 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 88a60d08c..b8571008b 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -82,7 +82,6 @@ import android.view.Surface;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
-import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
@@ -1026,10 +1025,6 @@ public class Launcher extends Activity
// Resets the previous workspace icon press state
mWaitingForResume.setStayPressed(false);
}
- if (mAppsCustomizeContent != null) {
- // Resets the previous all apps icon press state
- mAppsCustomizeContent.resetDrawableState();
- }
// It is possible that widgets can receive updates while launcher is not in the foreground.
// Consequently, the widgets will be inflated in the orientation of the foreground activity
@@ -2451,6 +2446,8 @@ public class Launcher extends Activity
}
} else if (v == mAllAppsButton) {
onClickAllAppsButton(v);
+ } else if (tag instanceof AppInfo) {
+ startAppShortcutOrInfoActivity(v);
} else if (tag instanceof LauncherAppWidgetInfo) {
if (v instanceof PendingAppWidgetHostView) {
onClickPendingWidget((PendingAppWidgetHostView) v);
@@ -2458,6 +2455,10 @@ public class Launcher extends Activity
}
}
+ public void onClickPagedViewIcon(View v) {
+ startAppShortcutOrInfoActivity(v);
+ }
+
public boolean onTouch(View v, MotionEvent event) {
return false;
}
@@ -2539,17 +2540,6 @@ public class Launcher extends Activity
}
/**
- * Event handler for a paged view icon click.
- * @param v The view that was clicked.
- * @param appInfo The {link AppInfo} of the view.
- */
- public void onClickPagedViewIcon(View v, AppInfo appInfo) {
- if (LOGD) Log.d(TAG, "onClickPagedViewIcon");
- startActivitySafely(v, appInfo.intent, appInfo);
- getStats().recordLaunch(appInfo.intent);
- }
-
- /**
* Event handler for an app shortcut click.
*
* @param v The view that was clicked. Must be a tagged with a {@link ShortcutInfo}.
@@ -2586,7 +2576,7 @@ public class Launcher extends Activity
builder.setPositiveButton(R.string.abandoned_search,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
- startAppShortcutActivity(v);
+ startAppShortcutOrInfoActivity(v);
}
}
);
@@ -2603,24 +2593,29 @@ public class Launcher extends Activity
}
// Start activities
- startAppShortcutActivity(v);
+ startAppShortcutOrInfoActivity(v);
}
- private void startAppShortcutActivity(View v) {
+ private void startAppShortcutOrInfoActivity(View v) {
Object tag = v.getTag();
- if (!(tag instanceof ShortcutInfo)) {
- throw new IllegalArgumentException("Input must be a Shortcut");
+ final ShortcutInfo shortcut;
+ final Intent intent;
+ if (tag instanceof ShortcutInfo) {
+ shortcut = (ShortcutInfo) tag;
+ intent = shortcut.intent;
+ int[] pos = new int[2];
+ v.getLocationOnScreen(pos);
+ intent.setSourceBounds(new Rect(pos[0], pos[1],
+ pos[0] + v.getWidth(), pos[1] + v.getHeight()));
+
+ } else if (tag instanceof AppInfo) {
+ shortcut = null;
+ intent = ((AppInfo) tag).intent;
+ } else {
+ throw new IllegalArgumentException("Input must be a Shortcut or AppInfo");
}
- final ShortcutInfo shortcut = (ShortcutInfo) tag;
- final Intent intent = shortcut.intent;
-
- int[] pos = new int[2];
- v.getLocationOnScreen(pos);
- intent.setSourceBounds(new Rect(pos[0], pos[1],
- pos[0] + v.getWidth(), pos[1] + v.getHeight()));
boolean success = startActivitySafely(v, intent, tag);
-
mStats.recordLaunch(intent, shortcut);
if (success && v instanceof BubbleTextView) {