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

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

Issue 2652883002: Omnibox results show correctly for Chrome Home (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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.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/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 0d9f110a070a5f8e668e176cd2af4035eaca78c0..2e13e44ec100c828dcc522edffb64ea460608e91 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
@@ -21,7 +21,6 @@ import android.view.ViewGroup;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
-import android.widget.LinearLayout;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.NativePage;
@@ -42,7 +41,7 @@ import java.lang.annotation.RetentionPolicy;
* All the computation in this file is based off of the bottom of the screen instead of the top
* for simplicity. This means that the bottom of the screen is 0 on the Y axis.
*/
-public class BottomSheet extends LinearLayout {
+public class BottomSheet extends FrameLayout {
/** The different states that the bottom sheet can have. */
@IntDef({SHEET_STATE_PEEK, SHEET_STATE_HALF, SHEET_STATE_FULL})
@Retention(RetentionPolicy.SOURCE)
@@ -211,7 +210,6 @@ public class BottomSheet extends LinearLayout {
public BottomSheet(Context context, AttributeSet atts) {
super(context, atts);
- setOrientation(LinearLayout.VERTICAL);
mVelocityTracker = VelocityTracker.obtain();
mGestureDetector = new GestureDetector(context, new BottomSheetSwipeDetector());
@@ -385,8 +383,16 @@ public class BottomSheet extends LinearLayout {
// Compute the height that the content section of the bottom sheet.
float contentHeight =
(mContainerHeight * mStateRatios[mStateRatios.length - 1]) - mToolbarHeight;
- mBottomSheetContent.setLayoutParams(
- new LinearLayout.LayoutParams((int) mContainerWidth, (int) contentHeight));
+
+ MarginLayoutParams sheetContentParams =
+ (MarginLayoutParams) mBottomSheetContent.getLayoutParams();
+ sheetContentParams.width = (int) mContainerWidth;
+ sheetContentParams.height = (int) contentHeight;
+ sheetContentParams.topMargin = (int) mToolbarHeight;
+
+ MarginLayoutParams toolbarShadowParams =
+ (MarginLayoutParams) findViewById(R.id.toolbar_shadow).getLayoutParams();
+ toolbarShadowParams.topMargin = (int) mToolbarHeight;
}
/**
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698