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

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

Issue 2902503002: [Payment] should show all accepted card icon in payment editor. (Closed)
Patch Set: adjust icon size 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/DynamicHeightGridView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/DynamicHeightGridView.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/DynamicHeightGridView.java
new file mode 100644
index 0000000000000000000000000000000000000000..d850909e4bab1dfc217d833caa5c560000bdb128
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/DynamicHeightGridView.java
@@ -0,0 +1,32 @@
+// 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;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.GridView;
+
+/**
+ * This class is customized GridView.
gogerald1 2017/05/24 14:25:23 it may be clear and simpler to say "This class is
Hwanseung Lee 2017/05/26 15:42:40 Done.
+ * if can't draw items in one line, it will make more than two lines automatically.
+ */
+public class DynamicHeightGridView extends GridView {
+ public DynamicHeightGridView(Context context, AttributeSet attrs) {
gogerald1 2017/05/24 14:25:23 looks only this constructor is needed, comment it
Hwanseung Lee 2017/05/26 15:42:40 Done.
+ super(context, attrs);
+ }
+ public DynamicHeightGridView(Context context) {
+ super(context);
+ }
+ public DynamicHeightGridView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+ @Override
gogerald1 2017/05/24 14:25:23 space line above,
Hwanseung Lee 2017/05/26 15:42:40 Done.
+ public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int expandSpec =
gogerald1 2017/05/24 14:25:24 do we really need this customization since we alre
Hwanseung Lee 2017/05/26 15:42:40 it is not working in scrollview, so this class nee
+ View.MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, View.MeasureSpec.AT_MOST);
+ super.onMeasure(widthMeasureSpec, expandSpec);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698