OSDN Git Service

Add onClickPagedViewIcon to the Launcher.
authorMohammadinamul Sheik <inamul@google.com>
Tue, 18 Mar 2014 18:28:19 +0000 (11:28 -0700)
committerMohammadinamul Sheik <inamul@google.com>
Tue, 18 Mar 2014 18:28:19 +0000 (11:28 -0700)
Change-Id: I34505ee5c9a6fe6ddd1a9f3134829fe0481e8bc0

src/com/android/launcher3/AppsCustomizePagedView.java
src/com/android/launcher3/Launcher.java

index 251ae21..e5e1580 100644 (file)
@@ -511,8 +511,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
             if (mPressedIcon != null) {
                 mPressedIcon.lockDrawableState();
             }
-            mLauncher.startActivitySafely(v, appInfo.intent, appInfo);
-            mLauncher.getStats().recordLaunch(appInfo.intent);
+            mLauncher.onClickPagedViewIcon(v, appInfo);
         } else if (v instanceof PagedViewWidget) {
             // Let the user know that they have to long press to add a widget
             if (mWidgetInstructionToast != null) {
index f1ce235..19dbe6a 100644 (file)
@@ -2444,6 +2444,17 @@ 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}.