17

Does the Android 5.0 framework have Material-styled tabs? I know in the dev preview, they were still Holo-styled. I was wondering if 5.0 has been updated with material-style tabs; I currently use PagerSlidingTabStrip for my tabs, but that has not been updated with Material design yet.

More specifically, does the support library include an implementation of material tabs? The Play Store running on 4.x has those tabs, but I'm not sure if that's a custom implementation by Google or not.

Nathan Walters
  • 4,116
  • 4
  • 23
  • 37
  • I don't believe this is a duplicate. The other question was about functionality; this one is about appearance. I'm aware that the navigation modes have been deprecated. – Nathan Walters Oct 25 '14 at 13:38
  • possible duplicate of [android 5.0 material design tabs](http://stackoverflow.com/questions/26486100/android-5-0-material-design-tabs) – Karim May 23 '15 at 14:01

2 Answers2

24

Updated (10/19/2015):

This is now provided by the Android Design Support Library:

compile "com.android.support:design:23.1.0"

Chris Banes example:

https://github.com/chrisbanes/cheesesquare

Android Developer Blog:

http://android-developers.blogspot.com/2015/05/android-design-support-library.html

Android Docs:

http://developer.android.com/reference/android/support/design/widget/TabLayout.html?utm_campaign=io15&utm_source=dac&utm_medium=blog

Support Library:

https://developer.android.com/tools/support-library/features.html#design

Original Answer:

Look at the latest version of Google Play(down below).

They are using the SlidingTabsColors(not SlidingTabsBasic) but with colors. You need to look at those two files: SlidingTabLayout.java and SlidingTabStrip.java and simply change the color to match your ActionBar/TooBar color.

Also, you will notice when you swipe left/right, the Tab title text color will become "white" and the unselected titles are an "gray" color.

For example(how to change the indicator color):

class SlidingTabStrip extends LinearLayout {
    // change the strip color
    private static final int DEFAULT_SELECTED_INDICATOR_COLOR = 0xFF33B5E5;
   ...
}

Please see the example here: https://developer.android.com/samples/SlidingTabsColors/index.html

Google Play Store

Please read these as well:

Android - Google Play like tabs

Action bar navigation modes are deprecated in Android L

Community
  • 1
  • 1
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
  • I'm talking more about the tabs that, for instance, appear in the "Apps" section on the play store. I was wondering if those style tabs were part of the support library. Though, in retrospect, I probably should have just slapped together a sample app to check for myself. I just thought someone might already know the answer. – Nathan Walters Oct 25 '14 at 13:53
  • No they are not. They are apart of the official samples. I currently use this in my applications as well. – Jared Burrows Oct 25 '14 at 13:54
  • So, long story short, there is no public implementation of Material-style tabs yet? – Nathan Walters Oct 25 '14 at 13:55
  • No, there does not need to be. It is not an API but but 2 views that your are looking for. You simply need to edit the colors: the tabs themselves and the tab "strip". In Google play, the tabs match the ToolBar and the "strip" is white. – Jared Burrows Oct 25 '14 at 13:56
  • Do you understand which style of tabs I'm referring to? – Nathan Walters Oct 25 '14 at 13:58
  • Yes. I have read your question. There are few "tabs" available in the Android SDK. These are the ones they want you to use. – Jared Burrows Oct 25 '14 at 14:00
  • OK. That seems like something the framework would provide. As long as that class you linked to will provide the proper styling (i.e. not the one from the screenshot you posted) I'll give it a shot. – Nathan Walters Oct 25 '14 at 14:08
  • @NathanWalters It's literally 2 lines of code to change. – Jared Burrows Oct 25 '14 at 14:10
21

You are looking for this material design tabs Right?

Have a look at this..

enter image description here

FYI material design tabs can found in this repo jpardogo's PagerSlidingTabStrip

Update: Mr.Jpardogo him self answered in SO post click here

Credits: Mr.Javier Pardo de Santayana Gómez

Community
  • 1
  • 1
LOG_TAG
  • 19,894
  • 12
  • 72
  • 105