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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java

Issue 2676663004: 🏠 onExitPeekState no longer only swipe triggered (Closed)
Patch Set: rebase correctly Created 3 years, 10 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 | 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/widget/BottomSheet.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
index ccbbd5af5b08c6aa40d45faddd9454114350e300..15bd2a53b73b472d758a12e27a0caaee23f2b299 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
@@ -180,7 +180,6 @@ public class BottomSheet extends FrameLayout implements FadingBackgroundView.Fad
// Cancel the settling animation if it is running so it doesn't conflict with where the
// user wants to move the sheet.
- boolean wasSettleAnimatorRunning = isRunningSettleAnimation();
cancelAnimation();
mVelocityTracker.addMovement(e2);
@@ -213,12 +212,6 @@ public class BottomSheet extends FrameLayout implements FadingBackgroundView.Fad
return false;
}
- // Send a notification that the sheet is exiting the peeking state into something that
- // will show content.
- if (!mIsScrolling && mCurrentState == SHEET_STATE_PEEK && !wasSettleAnimatorRunning) {
- onExitPeekState();
- }
-
float newOffset = getSheetOffsetFromBottom() + distanceY;
setSheetOffsetFromBottom(MathUtils.clamp(newOffset, getMinOffset(), getMaxOffset()));
@@ -553,6 +546,11 @@ public class BottomSheet extends FrameLayout implements FadingBackgroundView.Fad
* @param offset The offset that the sheet should be.
*/
private void setSheetOffsetFromBottom(float offset) {
+ if (MathUtils.areFloatsEqual(getSheetOffsetFromBottom(), getMinOffset())
+ && offset > getMinOffset()) {
+ onExitPeekState();
+ }
+
setTranslationY(mContainerHeight - offset);
sendUpdatePeekToHalfEvent();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698