Android Material Design Tabs Collapsible Example

 

Output:

 

Download source code

 

Hi Guys Today I am going to show you how to design Android material design collapsible example tabs with action bar animation.

I am using Gradle.

Create new project with following dependencies

Create new xml file activity_main.xml as following

Then create new xml file content_main.xml file as following

Note: Animation behavior will work with RecyclerView can’t with ListView

Create new xml layout file recycle_view_common_items.xml as following

The above xml file will use for RecyclerView items

Create new Java file under package adapter CommonRecycleAdapter.java as following

above file will use for RecyclerView items

create new Java file under package adapter MainPagerAdapter.java as following

above file will use for ViewPager and Tabs

create new Java file under package fragments PostsFragment.java as following

above file use for fragment with ViewPager

finally create new Java file MainActivity.java as following