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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java

Issue 2630513003: Expand bottom sheet when URL bar is focused (Closed)
Patch Set: address comments Created 3 years, 11 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/toolbar/BottomToolbarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
index af5e6db1809dde3b681d3c632650180f7c22519a..c5cdcf895b1810e652b66a78edb6cd08ac49c830 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
@@ -8,11 +8,19 @@ import android.content.Context;
import android.util.AttributeSet;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.widget.BottomSheet;
/**
* Phone specific toolbar that exists at the bottom of the screen.
*/
public class BottomToolbarPhone extends ToolbarPhone {
+
+ /** A handle to the bottom sheet. */
+ private BottomSheet mBottomSheet;
+
+ /** The state of the bottom sheet before the URL bar was focused. */
+ private int mStateBeforeUrlFocus;
+
/**
* Constructs a BottomToolbarPhone object.
* @param context The Context in which this View object is created.
@@ -28,4 +36,20 @@ public class BottomToolbarPhone extends ToolbarPhone {
// be at the top of the toolbar.
return getContext().getResources().getDimensionPixelSize(R.dimen.toolbar_shadow_height);
}
+
+ @Override
+ protected void triggerUrlFocusAnimation(final boolean hasFocus) {
+ super.triggerUrlFocusAnimation(hasFocus);
+
+ if (mBottomSheet == null) return;
+
+ if (hasFocus) mStateBeforeUrlFocus = mBottomSheet.getSheetState();
+ mBottomSheet.setSheetState(
+ hasFocus ? BottomSheet.SHEET_STATE_FULL : mStateBeforeUrlFocus, true);
+ }
+
+ @Override
+ public void setBottomSheet(BottomSheet sheet) {
+ mBottomSheet = sheet;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698