Code example for HorizontalScrollView

Methods: getWidthsmoothScrollTo

0
	/** 
	 * does the effect "back a page" 
	 */ 
	public void previous() { 
		mPageActive = (mPageActive > 0) ? mPageActive - 1 : 0;
		mScroll.smoothScrollTo(mPageActive * mScroll.getWidth(), 0);
	} 
 
	/** 
	 * does the effect "forward a page" 
	 */ 
	public void next() { 
		int pageWidth = mScroll.getWidth();
		int nextPage = (mPageActive + 1) * pageWidth;
		if (nextPage - mScroll.getScrollX() <= pageWidth) {
			mScroll.smoothScrollTo(nextPage, 0);
			mPageActive++;
		} else { 
			mScroll.smoothScrollTo(mScroll.getScrollX(), 0);
		} 
Contextual code suggestions in your IDE  Get Codota for Java