What is the best and easy way to implement material design style tabs just like in the latest Google NewsStand app? That is exactly what I'm looking for but don't know where to start. Any help/direction provided is greatly appreciated. Thanks.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I am using the DrawerLayout, had switched to the latest appcompat, compiled with api 21 and got this material theme. Make sure you use drawer from v7. Description: http://antonioleiva.com/material-design-everywhere/
This post of @ChrisBanes (Developer Programs Engineer for Android) explain the situation with the new Toolbar.
So this sample can help.
As well as this DevBytes video.
If you want a library, you can go for this one but It is not updated to material design (I forked it, and If I have some time, I will try to update it).
You can find more information about the new API 21 in @ChrisBanes blog as well as the official android blog
EDIT: You can find material design tabs in this repo jpardogo/PagerSlidingTabStrip :
I basically did 4 changes to the original library, so far (I will add Toolbar and fix some stuff tomorrow):
Ability to pass customTabs implementing the interface ´CustomTabProvider` in your adapter.
@+id/tab_title
, it will be use to place the title and alpha will act as usual.If you want you can use a custom tab with ripples using any of this libraries:
EDIT2: I changed the ActionBar for the new support library Tooolbar. I have also applied colors dynamically to the tabs,toolbar and statusBar. You can see the example working in android 4.4.3 on the following gif.
I sent a PR with my changes. If the original project owner doesn't update the maven library, and push it to maven I will push my library fork to maven central.
I personally love jpardogo's library jpardogo/PagerSlidingTabStrip.
One thing that I found missing in it though is ripple effect as seen in:
So I decided to make my own library, based on PagerSlidingTabStrip, and with customizable ripple effect: pizza/MaterialTabs.
You can also find a sample on the Play Store, customize your tabs there, then generate your code and export it instantly! :)