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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ExpandableGridView.java

Issue 2902503002: [Payment] should show all accepted card icon in payment editor. (Closed)
Patch Set: add comment Created 3 years, 6 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 unified diff | Download patch
OLDNEW
(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.payments.ui;
6
7 import android.content.Context;
8 import android.util.AttributeSet;
9 import android.widget.GridView;
10
11 /**
12 * This class is a customized GridView which draws items in multiple lines autom atically.
13 */
14 public class ExpandableGridView extends GridView {
15 /** Constructor for when the gridview is inflated from XML. */
16 public ExpandableGridView(Context context, AttributeSet attrs) {
17 super(context, attrs);
18 }
19
20 @Override
21 public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
22 // Heights of GridView is not working well in ScrollView even though has wrap_content
23 // attributes. by setting MeasureSpec.AT_MOST, GridView can work well fo rcely.
gone 2017/06/05 17:21:01 // GridView does not work well in a ScrollView whe
Hwanseung Lee 2017/06/06 12:48:30 Done.
24 final int heightSize = MeasureSpec.getSize(heightMeasureSpec);
25 int heightSpec;
26 if (getLayoutParams().height == LayoutParams.WRAP_CONTENT) {
27 heightSpec = MeasureSpec.makeMeasureSpec(heightSize, MeasureSpec.AT_ MOST);
28 } else {
29 heightSpec = heightMeasureSpec;
30 }
31
32 super.onMeasure(widthMeasureSpec, heightSpec);
33 }
34 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698