Code example for ViewPager

Methods: getChildAt, getChildCount, getMeasuredWidth, onMeasure, setMeasuredDimension

0
	} 
	 
	@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());
	} 
	 
} 
Experience pair programming with AI  Get Codota for Java