Im trying to learn about how to set up sliding tabs on my app's custom 'Toolbar' using material design. As I understand it, I'll need a 'ViewPage', does that mean i need to create a 'ViewPager', and set its 'Adapter'? Which I suppose will populate my fragment views with the relevant data. Can someone help explain how to go about doing this?
I'm only planning to use two tabs.
So far i have my xml which I got from https://www.youtube.com/watch?v=tRg_eDfQ8fk , it looks like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activity_main"
tools:context=".MainActivity">
<include layout="@layout/tool_bar"/>
<com.example.android.common.view.slidingTabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<android.support.v4.view.ViewPager
android:id="@+id/viewpages"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="@android:color/holo_blue_light"/>
Any help is appreciated.