Commit e2dfd8ad authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Android: Add haptic feedback on back/forward navigations

This CL adds haptic feedback to basic back/forward gesture navigation
UI when edge swipe is made to the point where the action will be
triggered.

Bug: 992997
Change-Id: I5af8ac7513091afc5ea667727d376214fd39fb22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772780Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690997}
parent 1e7ef9e7
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.gesturenav; package org.chromium.chrome.browser.gesturenav;
import android.content.Context; import android.content.Context;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -299,7 +300,10 @@ public class SideSlideLayout extends ViewGroup { ...@@ -299,7 +300,10 @@ public class SideSlideLayout extends ViewGroup {
// Tint the arrow blue when swiped enough to initiate navigation if released. // Tint the arrow blue when swiped enough to initiate navigation if released.
boolean navigating = willNavigate(); boolean navigating = willNavigate();
if (navigating != mWillNavigate) mArrowView.setImageTint(navigating); if (navigating != mWillNavigate) {
mArrowView.setImageTint(navigating);
if (navigating) performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP);
}
mWillNavigate = navigating; mWillNavigate = navigating;
if (mCloseIndicatorEnabled) { if (mCloseIndicatorEnabled) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment