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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java

Issue 2785163003: [TTS] Skip expanded state when swiping down v2. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java » ('j') | 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/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
index 49cb6d2279f9b15612cb36e1f5b40fb624d42f23..161d8c11d7a6442f8872bf506080010fbd3c6838 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
@@ -74,11 +74,6 @@ public class ContextualSearchPanel extends OverlayPanel {
*/
private ContextualSearchSceneLayer mSceneLayer;
- /**
- * The velocity of the swipe gesture being handled.
- */
- private float mCurrentSwipeVelocity;
-
// ============================================================================================
// Constructor
// ============================================================================================
@@ -224,19 +219,10 @@ public class ContextualSearchPanel extends OverlayPanel {
@Override
protected boolean isSupportedState(PanelState state) {
- if (mCurrentSwipeVelocity > 0 && state == PanelState.EXPANDED) return false;
-
return canDisplayContentInPanel() || state != PanelState.MAXIMIZED;
}
@Override
- protected float getThresholdToNextState() {
- if (mCurrentSwipeVelocity > 0) return 0.30f;
-
- return super.getThresholdToNextState();
- }
-
- @Override
protected float getExpandedHeight() {
if (canDisplayContentInPanel()) {
return super.getExpandedHeight();
@@ -247,7 +233,6 @@ public class ContextualSearchPanel extends OverlayPanel {
@Override
protected PanelState getProjectedState(float velocity) {
- mCurrentSwipeVelocity = velocity;
PanelState projectedState = super.getProjectedState(velocity);
// Prevent the fling gesture from moving the Panel from PEEKED to MAXIMIZED. This is to
@@ -259,6 +244,12 @@ public class ContextualSearchPanel extends OverlayPanel {
projectedState = PanelState.EXPANDED;
}
+ // If we're swiping the panel down from MAXIMIZED skip the EXPANDED state and go all the
+ // way to PEEKED.
+ if (getPanelState() == PanelState.MAXIMIZED && projectedState == PanelState.EXPANDED) {
+ projectedState = PanelState.PEEKED;
+ }
+
return projectedState;
}
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698