Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(876)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java

Issue 2381473002: 📰 Block touch interaction when a context menu is shown (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
index d9f4470a5eb28af3edd95a0305c919af43bca071..967a3b45664703a26e7b2a88c4b3d9e0321762b9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
@@ -52,7 +52,7 @@
/** View used to calculate the position of the cards' snap point. */
private View mAboveTheFoldView;
- /** Whether the RecyclerView should react to touch events. */
+ /** Whether the RecyclerView and its children should react to touch events. */
private boolean mTouchEnabled = true;
/** Whether the above-the-fold left space for a peeking card to be displayed. */
@@ -89,6 +89,7 @@ public boolean isFirstItemVisible() {
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
mGestureDetector.onTouchEvent(ev);
+ if (!mTouchEnabled) return true;
return super.onInterceptTouchEvent(ev);
}
@@ -411,7 +412,7 @@ public boolean gatherTransparentRegion(Region region) {
* Animates the card being swiped to the right as if the user had dismissed it. Any changes to
* the animation here should be reflected also in
* {@link #updateViewStateForDismiss(float, ViewHolder)} and reset in
- * {@link CardViewHolder#onBindViewHolder(NewTabPageItem)}.
+ * {@link CardViewHolder#onBindViewHolder()}.
* @param suggestion The item to be dismissed.
*/
public void dismissItemWithAnimation(SnippetArticle suggestion) {
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698