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; | |
gone
2017/06/01 00:08:28
Confine this to payments/ui. The stackoverflow po
Hwanseung Lee
2017/06/01 14:36:38
i moved it to payments/ui
| |
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 a customized GridView which draws items in multiple lines autom atically | |
gone
2017/06/01 00:08:27
End this comment with a period.
Hwanseung Lee
2017/06/01 14:36:38
Done.
| |
14 */ | |
15 public class ExpandableGridView extends GridView { | |
16 /** Constructor for when the gridview is inflated from XML. */ | |
17 public ExpandableGridView(Context context, AttributeSet attrs) { | |
18 super(context, attrs); | |
19 } | |
20 | |
21 @Override | |
22 public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
23 int heightSpec; | |
24 if (getLayoutParams().height == LayoutParams.WRAP_CONTENT) { | |
25 heightSpec = MeasureSpec.makeMeasureSpec(View.MEASURED_SIZE_MASK, Me asureSpec.AT_MOST); | |
gone
2017/05/31 17:29:42
This is a mask; you're supposed to use it to mask
Hwanseung Lee
2017/06/01 14:36:38
i think it is not necessary.
i checked how to make
gone
2017/06/01 17:32:19
Parent's height makes more sense, but I don't unde
| |
26 } else { | |
27 heightSpec = heightMeasureSpec; | |
28 } | |
29 | |
30 super.onMeasure(widthMeasureSpec, heightSpec); | |
31 } | |
32 } | |
OLD | NEW |