Code example for HorizontalScrollView

Methods: postDelayedgetMaxScrollAmountscrollTo

0
	private int bannerPos, maxBannerPos;
	private boolean right = true;
	 
	private void startBannerScroll() {		 
		if(maxBannerPos == 0)
			maxBannerPos = banner.getMaxScrollAmount();
		 
		banner.postDelayed(new Runnable() {
			 
			@Override 
			public void run() { 
				if(right)
					bannerPos++;
				else 
					bannerPos--;
				 
				banner.scrollTo(bannerPos, 0);
				 
				if(bannerPos == maxBannerPos || bannerPos == 0)
					right = !right;
				 
				startBannerScroll(); 
Contextual code suggestions in your IDE  Get Codota for Java