OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package org.chromium.chrome.browser.widget; | |
6 | |
7 import android.content.Context; | |
8 import android.util.AttributeSet; | |
9 import android.view.View; | |
10 import android.widget.GridView; | |
11 | |
12 /** | |
13 * 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.
| |
14 * if can't draw items in one line, it will make more than two lines automatical ly. | |
15 */ | |
16 public class DynamicHeightGridView extends GridView { | |
17 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.
| |
18 super(context, attrs); | |
19 } | |
20 public DynamicHeightGridView(Context context) { | |
21 super(context); | |
22 } | |
23 public DynamicHeightGridView(Context context, AttributeSet attrs, int defSty le) { | |
24 super(context, attrs, defStyle); | |
25 } | |
26 @Override | |
gogerald1
2017/05/24 14:25:23
space line above,
Hwanseung Lee
2017/05/26 15:42:40
Done.
| |
27 public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
28 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
| |
29 View.MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, View.Me asureSpec.AT_MOST); | |
30 super.onMeasure(widthMeasureSpec, expandSpec); | |
31 } | |
32 } | |
OLD | NEW |