implementing swipe between tab using tab-host in Android
Asked Answered
R

3

5

In Android can I implement swipe between tabs functionality using tab-host. Is it possible to use this functionality without fragments. When we are targeting older android versions how can we implement this feature. Can someone help me. Thank You!

Rounders answered 9/12, 2013 at 6:20 Comment(4)
May i know why you are going without fragments? Support library will support for all the version of android devicesLogician
you can use fragment in older android version after add support library, in this article can help you androidhive.info/2013/10/…Welldone
No I'm working on an old project and it hasn't used fragments. Just need to implement the functionality. If I'm gonna use fragments, I have had to do a big work. So just wanna know weather I could implement just the functionality. Thank You!Rounders
@kumar_android, probably because Fragments are broken and are overly complex for a simple interface arrangement.Guernica
L
3

If you are going to use Fragments, go by @vipulmittal answer Or else you want to implement touch listener like SimpleGestureListener based on your requirements. Good example is here

Logician answered 9/12, 2013 at 6:32 Comment(0)
I
5

The following link should get you started:

http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/

It uses view pager and adds views of each tab int it. On tab change listener it changes the view in view pager.

Ivanna answered 9/12, 2013 at 6:29 Comment(0)
L
3

If you are going to use Fragments, go by @vipulmittal answer Or else you want to implement touch listener like SimpleGestureListener based on your requirements. Good example is here

Logician answered 9/12, 2013 at 6:32 Comment(0)
O
1

Yes it is . Just implement a touch listener on the frame layout and get the x,y and the motion event. if and implement the functionality accordingly.

Octachord answered 9/12, 2013 at 6:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.