Material Design Tabs for Android Android 5.0

What is the best and easiest way to implement material style tabs like in the latest Google NewsStand app? This is exactly what I'm looking for, but I don’t know where to start. Any help / referral received is appreciated. Thank.

+45
android android-5.0-lollipop android-tabs
Oct 21 '14 at 11:56 on
source share
3 answers

This post @ChrisBanes (Engine Engine developer for Android) explains the situation with the new toolbar.

So this sample can help.

Just like this video is DevBytes.

If you want to get the library, you can go to this one , but it has not been updated to the material design (I forked it, and if I have time, I will try to update it).

More information about the new API 21 can be found on the @ChrisBanes blog , as well as the official android blog.

EDIT: In this jpardogo / PagerSlidingTabStrip repo you can find material design tabs:

I basically made 4 changes to the source library so far (I will add a toolbar and fix some things tomorrow):

  • Change the default settings in the tab layout to look like more material.
  • The default indicator is centered while scrolling through tabs.
  • The alpha header value changes depending on the selected position.
  • The ability to transfer custom tabs that implement the CustomTabProvider interface in your adapter.

    • In case customTab looks like id @+id/tab_title , it will be used to place the title, and alpha will act as usual.
    • If this interface is not implemented, then the default tab layout (TextView) will be used.

If you want, you can use the custom ripple tab using any of these libraries:

EDIT2: I changed the ActionBar for the new Tooolbar support library. I also dynamically applied colors to tabs, toolbars and statusBar. You can see an example of working in android 4.4.3 on the following gif.

I sent a PR with my changes. If the original owner of the project does not update the maven library and clicks it on maven, I push my library fork to the center of maven.

material_tabs

+85
Oct 21 '14 at 12:28
source share
β€” -

I personally like the jpardogo jpardogo / PagerSlidingTabStrip library .

One thing I found in it, but this is the ripple effect, as can be seen from: Material tabs with ripple effect

So, I decided to create my own library based on PagerSlidingTabStrip and with a custom ripple effect: pizza / MaterialTabs .

You can also find a sample on the Play Store , set up your tabs there, then generate your code and export it instantly! :)

+7
May 16 '15 at 12:14
source share

I use DrawerLayout, switched to the latest appcompat compiled with api 21 and got this material theme. Make sure you use the box from v7. Description: http://antonioleiva.com/material-design-everywhere/

+3
Oct 21 '14 at 12:02 on
source share



All Articles