mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Perform haptic feedback on nav button key press
Fixes: 203614307 Test: manual Change-Id: Icaea3f5e436522f23202c20fcc7f7c5dbe309372
This commit is contained in:
@@ -33,6 +33,8 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_S
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -113,7 +115,9 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
mHandler = handler;
|
||||
}
|
||||
|
||||
public void onButtonClick(@TaskbarButton int buttonType) {
|
||||
public void onButtonClick(@TaskbarButton int buttonType, View view) {
|
||||
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||
switch (buttonType) {
|
||||
case BUTTON_BACK:
|
||||
logEvent(LAUNCHER_TASKBAR_BACK_BUTTON_TAP);
|
||||
@@ -144,7 +148,9 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onButtonLongClick(@TaskbarButton int buttonType) {
|
||||
public boolean onButtonLongClick(@TaskbarButton int buttonType, View view) {
|
||||
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||
switch (buttonType) {
|
||||
case BUTTON_HOME:
|
||||
logEvent(LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS);
|
||||
|
||||
Reference in New Issue
Block a user