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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestBottomBar.java

Issue 2698703003: [Payments] Add UI elements to secure branding for payments (Closed)
Patch Set: address comments and fit small device dynamically 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
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestBottomBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestBottomBar.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestBottomBar.java
new file mode 100644
index 0000000000000000000000000000000000000000..84601f8d830ff43470117ef06599938118fc628b
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestBottomBar.java
@@ -0,0 +1,34 @@
+// 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.payments.ui;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.View.MeasureSpec;
+import android.widget.LinearLayout;
+
+import org.chromium.chrome.R;
+
+/** This class represents a bar to display at the bottom of the payment request UI. */
+public class PaymentRequestBottomBar extends LinearLayout {
+ public PaymentRequestBottomBar(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ // Views layout_width must be set to match_parent.
+ assert MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
+
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+
+ // Display the logo without product name if there is not enough space.
+ if (findViewById(R.id.space).getMeasuredWidth() == 0) {
+ findViewById(R.id.logo_name).setVisibility(View.GONE);
+ findViewById(R.id.logo).setVisibility(View.VISIBLE);
gone 2017/02/17 01:53:54 This will end up causing another measure pass. Ca
gogerald1 2017/02/17 17:28:28 Do not completely get your idea of setMeasuredDime
gone 2017/02/17 19:02:55 Simple doesn't always mean correct or efficient.
gogerald1 2017/02/17 22:05:38 Might strange, but that's what I observed, it migh
gogerald1 2017/02/17 22:05:38 Done.
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698