Make sure touch only goes to the nearest button when it makes sense
- In NearestTouchFrame, we can't use view bounds alone since the buttons do not have the same root (3 buttons are in the main container, while the contextual buttons are in the contextual button container). This currently caused the issue that contextual button region, when the contextual buttons are invisible, triggers overview - Need to add an empty space in the left / top area of the button nav to prevent view clicks from going into back (that's how it works in navigationbar/) Bug: 25768138 Test: left and right of 3 buttons don't trigger back or overview Change-Id: Idc26c0c8ac0ecc000300a6db2e3e6251f678dada
This commit is contained in:
1 parent
ea9522eee5
commit
419140aede
14 files changed
+101
-29
No files matched your search
@@ -102,6 +102,7 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
static final int BUTTON_A11Y = BUTTON_IME_SWITCH << 1;
|
||||
static final int BUTTON_QUICK_SETTINGS = BUTTON_A11Y << 1;
|
||||
static final int BUTTON_NOTIFICATIONS = BUTTON_QUICK_SETTINGS << 1;
|
||||
static final int BUTTON_SPACE = BUTTON_NOTIFICATIONS << 1;
|
||||
|
||||
private static final int SCREEN_UNPIN_COMBO = BUTTON_BACK | BUTTON_RECENTS;
|
||||
private int mLongPressedButtons = 0;
|
||||
@@ -123,6 +124,9 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
}
|
||||
|
||||
public void onButtonClick(@TaskbarButton int buttonType, View view) {
|
||||
if (buttonType == BUTTON_SPACE) {
|
||||
return;
|
||||
}
|
||||
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||
switch (buttonType) {
|
||||
@@ -156,6 +160,9 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
}
|
||||
|
||||
public boolean onButtonLongClick(@TaskbarButton int buttonType, View view) {
|
||||
if (buttonType == BUTTON_SPACE) {
|
||||
return false;
|
||||
}
|
||||
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||
switch (buttonType) {
|
||||
|
||||
Reference in new issue
Block a user