Back to project page utexas-utilities.
The source code is released under:
Apache License
If you think the Android project utexas-utilities listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nasageek.utexasutilities; /*from w w w.j ava 2s .c o m*/ import android.content.Context; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.ViewGroup; public class WrappedViewPager extends ViewPager { public WrappedViewPager(Context context) { super(context); } public WrappedViewPager(Context context, AttributeSet aSet) { super(context, aSet); } @Override public void onMeasure(int heightMeasureSpec, int widthMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); if (getChildCount() != 0 && getChildAt(0) instanceof ViewGroup) { setMeasuredDimension(getMeasuredWidth(), ((ViewGroup) getChildAt(0)).getChildAt(0) .getMeasuredHeight()); } } }