Back to project page CommonClasses.
The source code is released under:
GNU General Public License
If you think the Android project CommonClasses listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * This source is part of the CommonClasses repository. *//w ww.j a v a 2 s. com * Copyright 2014 Kevin Liu (airk908@gmail.com) * * CommonClasses is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * CommonClasses is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with CommonClasses. If not, see <http://www.gnu.org/licenses/>. */ package com.github.commonclasses.widget; import android.content.Context; import android.util.AttributeSet; import android.widget.ListView; /** * ListView for ScrollView * <p/> * This ListView can expand to all item's total height in a ScrollView */ public class ListViewForScrollView extends ListView { public ListViewForScrollView(Context context) { super(context); } public ListViewForScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public ListViewForScrollView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); } }