Search code examples
androidandroid-layoutyoutubeandroid-tabhostandroid-style-tabhost

Android 4.0 - Youtubestyled Tabhost - How is that possible?


What I try to do


Hello Guys, I'm creating an app, and I want that it looks nice and simple to control. In my app I got a Tabhost with 3 Tabs. Every Tab is a fragment with diffrent content. Now its the problem, when I switch the tab. I have to do this over a click on the tabhost.

But if you take a look at the Youtube-App on Android 4.0 its possible to switch the tab over a swipe gesture. And exactly here I stuck, how is that possible.

I searched the web, took a look into the Android Documentation, but I didn't really find anything about this topic. So how is that possible to create something like that?

Question


What do I need to do, that I can switch in my tabhost like its done in the Youtube-App. If you have some great tutorials, code snippets or any other tipps, please post them.

Thx for your help in advance.

safari

Pictures


Here you find some pictures to explain better what I'd like to create. They are ordered chronologically.

Number 1 Number 2 Number 3


Solution

  • They are using a ViewPager for that.