Loading quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +11 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import android.content.res.Resources; import android.graphics.Color; import android.graphics.Point; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; import android.graphics.Region.Op; import android.graphics.drawable.Drawable; Loading @@ -75,6 +76,7 @@ import android.inputmethodservice.InputMethodService; import android.os.Handler; import android.util.Property; import android.view.Gravity; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; Loading Loading @@ -862,15 +864,21 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private void setBackButtonTouchListener(View buttonView, TaskbarNavButtonController navButtonController) { final RectF rect = new RectF(); buttonView.setOnTouchListener((v, event) -> { if (event.getAction() == MotionEvent.ACTION_MOVE) return false; if (event.getAction() == MotionEvent.ACTION_DOWN) { rect.set(0, 0, v.getWidth(), v.getHeight()); } boolean isCancelled = event.getAction() == MotionEvent.ACTION_CANCEL || !rect.contains(event.getX(), event.getY()); if (event.getAction() == MotionEvent.ACTION_MOVE && !isCancelled) return false; int motionEventAction = event.getAction(); int keyEventAction = motionEventAction == MotionEvent.ACTION_DOWN ? KeyEvent.ACTION_DOWN : ACTION_UP; boolean isCancelled = event.getAction() == MotionEvent.ACTION_CANCEL; navButtonController.sendBackKeyEvent(keyEventAction, isCancelled); if (motionEventAction == MotionEvent.ACTION_UP) { if (motionEventAction == MotionEvent.ACTION_UP && !isCancelled) { buttonView.performClick(); buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); } return false; }); Loading Loading
quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +11 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import android.content.res.Resources; import android.graphics.Color; import android.graphics.Point; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; import android.graphics.Region.Op; import android.graphics.drawable.Drawable; Loading @@ -75,6 +76,7 @@ import android.inputmethodservice.InputMethodService; import android.os.Handler; import android.util.Property; import android.view.Gravity; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; Loading Loading @@ -862,15 +864,21 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private void setBackButtonTouchListener(View buttonView, TaskbarNavButtonController navButtonController) { final RectF rect = new RectF(); buttonView.setOnTouchListener((v, event) -> { if (event.getAction() == MotionEvent.ACTION_MOVE) return false; if (event.getAction() == MotionEvent.ACTION_DOWN) { rect.set(0, 0, v.getWidth(), v.getHeight()); } boolean isCancelled = event.getAction() == MotionEvent.ACTION_CANCEL || !rect.contains(event.getX(), event.getY()); if (event.getAction() == MotionEvent.ACTION_MOVE && !isCancelled) return false; int motionEventAction = event.getAction(); int keyEventAction = motionEventAction == MotionEvent.ACTION_DOWN ? KeyEvent.ACTION_DOWN : ACTION_UP; boolean isCancelled = event.getAction() == MotionEvent.ACTION_CANCEL; navButtonController.sendBackKeyEvent(keyEventAction, isCancelled); if (motionEventAction == MotionEvent.ACTION_UP) { if (motionEventAction == MotionEvent.ACTION_UP && !isCancelled) { buttonView.performClick(); buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); } return false; }); Loading