I have a TabHost control (not in actionbar), and I want to make the tabs to change when the user swipes the context on each tab (something like whatsapp emoji tabs).
How can I do this?
EDIT
The feel is also important. I want that the contexts should have scroll animations (No matter if the user swipe or if the tab is clicked).
Go through this link http://thepseudocoder.wordpress.com/2011/10/13/android-tabs-viewpager-swipe-able-tabs-ftw/
You can use a gesture detector.
GestureDetector
Detects various gestures and events using the supplied MotionEvents. The GestureDetector.OnGestureListener callback will notify users when a particular motion event has occurred. This class should only be used with MotionEvents reported via touch (don't use for trackball events). To use this class:
1 Create an instance of the GestureDetector for your View In the nTouchEvent(MotionEvent) method ensure you call
2 onTouchEvent(MotionEvent). The methods defined in your callback will be executed when the events occur
This page shows how to recognize a swipe-gesture using the GestureDetector:
http://smartandroidians.blogspot.in/2010/04/swipe-action-and-viewflipper-in-android.html