diff options
author | Danesh M <daneshm90@gmail.com> | 2015-11-09 11:23:00 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2015-11-09 12:51:28 -0800 |
commit | 3a2fd0ced6a66001b6f4378722b29293f60faf85 (patch) | |
tree | 7bb04303d69985165d2592310e1bf5a2071e2373 | |
parent | 8a67b7362026fb823d3d8745310241a78c887332 (diff) | |
download | frameworks_base-3a2fd0ced6a66001b6f4378722b29293f60faf85.zip frameworks_base-3a2fd0ced6a66001b6f4378722b29293f60faf85.tar.gz frameworks_base-3a2fd0ced6a66001b6f4378722b29293f60faf85.tar.bz2 |
SystemUI : Fix now on tap home button long press
Change-Id: Ibd4d8e62d82c43c53bb61fc5ee92053d0f50bc38
3 files changed, 10 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index d952a25..1262f26 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -119,6 +119,7 @@ public class NavigationBarView extends LinearLayout { private OnTouchListener mRecentsPreloadListener; private OnTouchListener mHomeSearchActionListener; private OnLongClickListener mRecentsBackListener; + private OnLongClickListener mLongPressHomeListener; private SettingsObserver mSettingsObserver; private boolean mShowDpadArrowKeys; @@ -774,11 +775,13 @@ public class NavigationBarView extends LinearLayout { } void setListeners(OnClickListener recentsClickListener, OnTouchListener recentsPreloadListener, - OnLongClickListener recentsBackListener, OnTouchListener homeSearchActionListener) { + OnLongClickListener recentsBackListener, OnTouchListener homeSearchActionListener, + OnLongClickListener longPressHomeListener) { mRecentsClickListener = recentsClickListener; mRecentsPreloadListener = recentsPreloadListener; mHomeSearchActionListener = homeSearchActionListener; mRecentsBackListener = recentsBackListener; + mLongPressHomeListener = longPressHomeListener; updateButtonListeners(); } @@ -790,6 +793,8 @@ public class NavigationBarView extends LinearLayout { if (button instanceof KeyButtonView) { button.setOnClickListener(null); button.setOnTouchListener(null); + button.setLongClickable(false); + button.setOnLongClickListener(null); } } } @@ -810,6 +815,8 @@ public class NavigationBarView extends LinearLayout { View homeView = mCurrentView.findViewWithTag(NavbarEditor.NAVBAR_HOME); if (homeView != null) { homeView.setOnTouchListener(mHomeSearchActionListener); + homeView.setLongClickable(true); + homeView.setOnLongClickListener(mLongPressHomeListener); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 73d5f01..72b5828 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1353,7 +1353,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNavigationBarView.reorient(); mNavigationBarView.setListeners(mRecentsClickListener, mRecentsPreloadOnTouchListener, - mLongPressBackRecentsListener, mHomeActionListener); + mLongPressBackRecentsListener, mHomeActionListener, mLongPressHomeListener); mAssistManager.onConfigurationChanged(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java index 6f9ac22..ad0a3cc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java @@ -211,7 +211,7 @@ public class KeyButtonView extends ImageView { } private boolean supportsLongPress() { - return mSupportsLongpress && getTag() != NavbarEditor.NAVBAR_HOME; + return mSupportsLongpress; } public boolean onTouchEvent(MotionEvent ev) { |