android - Collapsing toolbar with tablayout -
what want achieve :
this ui design belongs to audio beats
and here have
. problem tablayout going behind recyclerview when collapsing toolbar expanded. , i'm not able remove title "musico" or set top sticky.
my xml
<android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="200dp" android:fitssystemwindows="true" android:theme="@style/apptheme.appbaroverlay"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" app:contentscrim="?attr/colorprimary" app:layout_scrollflags="scroll|exituntilcollapsed" > <imageview android:id="@+id/backdrop" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:scaletype="centercrop" android:src="@drawable/hp" app:layout_collapsemode="parallax" /> <android.support.v7.widget.toolbar android:id="@+id/toolbar" app:layout_scrollflags="scroll|enteralways" app:layout_collapsemode="pin" android:layout_width="match_parent" android:layout_height="90dp" app:popuptheme="@style/apptheme.popupoverlay" > </android.support.v7.widget.toolbar> <android.support.design.widget.tablayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="40dp" app:tabgravity="center" android:layout_gravity="bottom" app:tabmode="scrollable" /> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <include layout="@layout/content_main"/> </android.support.design.widget.coordinatorlayout>
and content_main.xml
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:showin="@layout/activity_main" app:behavior_overlaptop="30dp" > <android.support.v4.view.viewpager android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/view_pager" android:layout_marginleft="10dp" android:layout_marginright="10dp"></android.support.v4.view.viewpager> </relativelayout>
please help.
move textview (musico) inside toolbar , provide custom layout toolbar (it remain on top)
layout not correct refer: collaspinglayoutwithviewpager
Comments
Post a Comment