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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsRecyclerView.java

Issue 2810713002: 🏡 Disable BottomSheet touches while context menu is open. (Closed)
Patch Set: Add some comments. Created 3 years, 8 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
Index: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsRecyclerView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsRecyclerView.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsRecyclerView.java
index 1d3c35f78fdb40c505c75b2421438cab0dcf37b6..2f521566cd1f4efc53b3098e89a5f0ce7c1380de 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsRecyclerView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsRecyclerView.java
@@ -31,7 +31,6 @@ import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.Callback;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ntp.ContextMenuManager;
-import org.chromium.chrome.browser.ntp.ContextMenuManager.TouchDisableableView;
import org.chromium.chrome.browser.ntp.cards.CardViewHolder;
import org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter;
import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder;
@@ -48,7 +47,7 @@ import java.util.Set;
* Simple wrapper on top of a RecyclerView that will acquire focus when tapped. Ensures the
* New Tab page receives focus when clicked.
*/
-public class SuggestionsRecyclerView extends RecyclerView implements TouchDisableableView {
+public class SuggestionsRecyclerView extends RecyclerView {
private static final Interpolator DISMISS_INTERPOLATOR = new FastOutLinearInInterpolator();
private static final int DISMISS_ANIMATION_TIME_MS = 300;
/**
@@ -74,7 +73,9 @@ public class SuggestionsRecyclerView extends RecyclerView implements TouchDisabl
*/
private final Map<ViewHolder, Integer> mCompensationHeightMap = new HashMap<>();
- /** Whether the RecyclerView and its children should react to touch events. */
+ /**
+ * Whether the {@link SuggestionsRecyclerView} and its children should react to touch events.
+ */
private boolean mTouchEnabled = true;
/** The ui config for this view. */
@@ -119,6 +120,14 @@ public class SuggestionsRecyclerView extends RecyclerView implements TouchDisabl
return mLayoutManager.findFirstVisibleItemPosition() == 0;
}
+ /**
+ * Sets whether the {@link SuggestionsRecyclerView} and its children should react to touch
+ * events.
+ */
+ public void setTouchEnabled(boolean enabled) {
+ mTouchEnabled = enabled;
+ }
+
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
mGestureDetector.onTouchEvent(ev);
@@ -127,11 +136,6 @@ public class SuggestionsRecyclerView extends RecyclerView implements TouchDisabl
}
@Override
- public void setTouchEnabled(boolean enabled) {
- mTouchEnabled = enabled;
- }
-
- @Override
public boolean onTouchEvent(MotionEvent ev) {
if (!mTouchEnabled) return false;

Powered by Google App Engine
This is Rietveld 408576698