0

I want to create an app that uses a tab layout with sliding views (something like this):

Screenshot

Here's the issue: I searched all over the web for a guide that could explain how to do this kind of thing but all I tried didn't work for me. I read somewhere that tabs layout is deprecated with Lollipop, so I tried to find an alternative way to do what I wanted to do, but nothing. Every tab layout app I try to create ends up with a crash while testing and I think it's due to something about the ActionBar, always because of the ActionBar Tabs are deprecated in Lollipop. I'm not going to post any code because I created so many projects that I lost their count, and also because they are quite the same. So, anyone could please link me a guide or explain a working method that allows to do what I explained?

All I can say is that the app has to be used on Lollipop, so I'd like to know the compile settings to put in the gradle files. Another important thing is that i use Android Studio, even if most of the tutorials i find on web are about Eclipse.

I hope to have explained in detail my problem and what i want to do and i thank you all in advance.

Miki Tebeka
  • 13,428
  • 4
  • 37
  • 49
Federico Belotti
  • 103
  • 1
  • 2
  • 11
  • look at https://github.com/jpardogo/PagerSlidingTabStrip with Toolbar and ViewPager – Hugo Gresse Feb 24 '15 at 17:50
  • Possible duplicate of [How to Create Android Tabbed style with Page Swipe View](http://stackoverflow.com/questions/22265796/how-to-create-android-tabbed-style-with-page-swipe-view) – Ali Bdeir Aug 31 '16 at 20:19

1 Answers1

0

Here is a detailled description of how to use the SlidingTabLayout like Google uses it in the Store: https://github.com/codepath/android_guides/wiki/Google-Play-Style-Tabs-using-SlidingTabLayout

Like Hugo already mentioned: it works with viewpager

Matthias
  • 158
  • 1
  • 11
  • I'm looking at the link you gave me and i cannot understand one thing. When i have to work with imports like `Fragments`, which one have i to use between `android.app.Fragment` and `android.support.v4.Fragment`? I often had this problem due to deprecated types/methods. Thanks! – Federico Belotti Feb 24 '15 at 20:20
  • There is a question about fragments in the support library vs the app Fragments here: http://stackoverflow.com/questions/17553374/android-app-fragments-vs-android-support-v4-app-using-viewpager – Matthias Feb 25 '15 at 09:09