Code example for HorizontalScrollView

Methods: smoothScrollTo, getScrollX

0
						return true; 
					} 
					else if(event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL)
					{ 
						Log.i(TAG, "TabsAdapter-onTouch Case 2");
						int scrollX = mHorizontalScrollView.getScrollX();
						int featureWidth = v.getMeasuredWidth();
						mActiveFeature = ((scrollX + (featureWidth/2))/featureWidth);
						int scrollTo = mActiveFeature*featureWidth;
						mHorizontalScrollView.smoothScrollTo(scrollTo,0);
						return true; 
					} 
					else 
					{ 
						Log.i(TAG, "TabsAdapter-onTouch Case 3");
						return false; 
					} 
				}	 
				 
            }); 
            mGestureDetector = new GestureDetector(new MyGestureDetector());