Chromium Code Reviews| 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); |
| + } |
| +} |