0

I'm finding a lot of conflicting information as to the best approach for adding tabs below an ActionBar in ActionBarActivity (sub class of FragmentActivity, from the support libs). I'd like them to look visually similar to the tabs in the Play Store app (ie, position them just below the action bar).

Can you tell me what is the best approach to implementing this, ensuring compatibility with the support libs? Looks like as of Lollipop. some of the approaches have been deprecated.

Thanks!

Wise Shepherd
  • 2,228
  • 4
  • 31
  • 43

1 Answers1

1

You should take a look at the Android official sample of the SlidingTabBasic. It basically implements what Google Play store had. The design is a bit outdated compare to the latest Material Design, but it's easy enough to make modification to update the look and feel.

This is the post Android Developer had on Google+: https://plus.google.com/+AndroidDevelopers/posts/X8fg63wK6S8

Sam C
  • 121
  • 3
  • As the links might disappear, could you summarize the content of that post in the answer (probably with code examples)? – Gábor Bakos Jan 08 '15 at 19:18
  • Here's the link to the official Android example in case Google+'s link is gone. http://developer.android.com/samples/SlidingTabsBasic/index.html It is an example project that includes a fully functional SlidingTabLayout, which implements the sliding tab that we see from Google Play store. It works with ViewPager, which is what Google recommended for swipe views with tabs. – Sam C Jan 08 '15 at 21:13