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

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

Issue 2876093002: [Home] Placeholder sheet content for omnibox focus (Closed)
Patch Set: address comments Created 3 years, 7 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/widget/bottomsheet/PlaceholderSheetContent.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java
new file mode 100644
index 0000000000000000000000000000000000000000..551fab1bc678a801e7ea9e4638f584d97f0884eb
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/PlaceholderSheetContent.java
@@ -0,0 +1,59 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.widget.bottomsheet;
+
+import android.content.Context;
+import android.view.View;
+import android.widget.FrameLayout;
+
+import org.chromium.base.ApiCompatibilityUtils;
+import org.chromium.chrome.R;
+
+/**
+ * This class is used as a placeholder when there should otherwise be no content in the bottom
+ * sheet.
+ */
+class PlaceholderSheetContent implements BottomSheet.BottomSheetContent {
+ /** The view that represents this placeholder. */
+ private View mView;
+
+ public PlaceholderSheetContent(Context context) {
+ mView = new View(context);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
+ mView.setLayoutParams(params);
+ mView.setBackgroundColor(ApiCompatibilityUtils.getColor(
+ context.getResources(), R.color.default_primary_color));
+ }
+
+ @Override
+ public View getContentView() {
+ return mView;
+ }
+
+ @Override
+ public View getToolbarView() {
+ return null;
+ }
+
+ @Override
+ public boolean isUsingLightToolbarTheme() {
+ return false;
+ }
+
+ @Override
+ public int getVerticalScrollOffset() {
+ return 0;
+ }
+
+ @Override
+ public void destroy() {}
+
+ @Override
+ @BottomSheetContentController.ContentType
+ public int getType() {
+ return BottomSheetContentController.TYPE_PLACEHOLDER;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698