summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/FocusHelper.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/FocusHelper.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/FocusHelper.java')
-rw-r--r--src/com/android/launcher3/FocusHelper.java21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java
index df5e0fc33..34e752b85 100644
--- a/src/com/android/launcher3/FocusHelper.java
+++ b/src/com/android/launcher3/FocusHelper.java
@@ -22,8 +22,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.ScrollView;
-import android.widget.TabHost;
-import android.widget.TabWidget;
import java.util.ArrayList;
import java.util.Collections;
@@ -89,7 +87,6 @@ public class FocusHelper {
final PagedViewGridLayout parent = (PagedViewGridLayout) w.getParent();
final PagedView container = (PagedView) parent.getParent();
- final AppsCustomizeTabHost tabHost = findTabHostParent(container);
final int widgetIndex = parent.indexOfChild(w);
final int widgetCount = parent.getChildCount();
final int pageIndex = ((PagedView) container).indexToPage(container.indexOfChild(parent));
@@ -228,6 +225,13 @@ public class FocusHelper {
* Handles key events in a PageViewCellLayout containing PagedViewIcons.
*/
static boolean handleAppsCustomizeKeyEvent(View v, int keyCode, KeyEvent e) {
+ final int action = e.getAction();
+ if (((action == KeyEvent.ACTION_DOWN) && v.onKeyDown(keyCode, e))
+ || ((action == KeyEvent.ACTION_UP) && v.onKeyUp(keyCode, e))) {
+ // Let the view handle the confirmation key.
+ return true;
+ }
+
ViewGroup parentLayout;
ViewGroup itemContainer;
int countX;
@@ -246,7 +250,6 @@ public class FocusHelper {
// Note we have an extra parent because of the
// PagedViewCellLayout/PagedViewCellLayoutChildren relationship
final PagedView container = (PagedView) parentLayout.getParent();
- final AppsCustomizeTabHost tabHost = findTabHostParent(container);
final int iconIndex = itemContainer.indexOfChild(v);
final int itemCount = itemContainer.getChildCount();
final int pageIndex = ((PagedView) container).indexToPage(container.indexOfChild(parentLayout));
@@ -255,7 +258,6 @@ public class FocusHelper {
final int x = iconIndex % countX;
final int y = iconIndex / countX;
- final int action = e.getAction();
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
ViewGroup newParent = null;
// Side pages do not always load synchronously, so check before focusing child siblings
@@ -319,15 +321,6 @@ public class FocusHelper {
}
wasHandled = true;
break;
- case KeyEvent.KEYCODE_ENTER:
- case KeyEvent.KEYCODE_DPAD_CENTER:
- if (handleKeyEvent) {
- // Simulate a click on the icon
- View.OnClickListener clickListener = (View.OnClickListener) container;
- clickListener.onClick(v);
- }
- wasHandled = true;
- break;
case KeyEvent.KEYCODE_PAGE_UP:
if (handleKeyEvent) {
// Select the first icon on the previous page, or the first icon on this page