android - Position toolbar on layout using material design -
i have 3 doubts related layout , styles: need position toolbar in specific position, need add shadows on text, , need add more action buttons.
the image describe problem:
i have 2 "toolbar"s in layout, 1 on top, , 1 need stay before picture. did try lot of things, dont work!
this layout:
<android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="@dimen/detail_backdrop_height" android:theme="@style/themeoverlay.appcompat.dark.actionbar" android:fitssystemwindows="true"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollflags="scroll|exituntilcollapsed" android:fitssystemwindows="true" app:contentscrim="?attr/colorprimary" app:expandedtitlemarginstart="48dp" app:expandedtitlemarginend="84dp"> <imageview android:id="@+id/backdrop" android:layout_width="match_parent" android:layout_height="match_parent" android:scaletype="centercrop" android:fitssystemwindows="true" app:layout_collapsemode="parallax" /> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="@drawable/gallery_toolbar_shape" app:popuptheme="@style/themeoverlay.appcompat.light" app:layout_collapsemode="pin" /> <progressbar android:id="@+id/gallery_progressbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_margintop="-7.5dp" style="?android:attr/progressbarstylehorizontal"/> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <app:android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/personaltoolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:layout_alignbottom="@+id/appbar" android:layout_alignparentbottom="true" android:background="@color/personal_tb" app:popuptheme="@style/themeoverlay.appcompat.light" > <imageview android:id="@+id/testimg" android:src="@drawable/ic_done" android:layout_width="24dp" android:layout_height="24dp"/> </app:android.support.v7.widget.toolbar> <android.support.v4.widget.nestedscrollview android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingtop="24dp"> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/card_margin"> <linearlayout style="@style/widget.cardcontent" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:text="info" android:textappearance="@style/textappearance.appcompat.title" /> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/cheese_ipsum" /> </linearlayout> </android.support.v7.widget.cardview> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginbottom="@dimen/card_margin" android:layout_marginleft="@dimen/card_margin" android:layout_marginright="@dimen/card_margin"> <linearlayout style="@style/widget.cardcontent" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:text="friends" android:textappearance="@style/textappearance.appcompat.title" /> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/cheese_ipsum" /> </linearlayout> </android.support.v7.widget.cardview> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginbottom="@dimen/card_margin" android:layout_marginleft="@dimen/card_margin" android:layout_marginright="@dimen/card_margin"> <linearlayout style="@style/widget.cardcontent" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:text="related" android:textappearance="@style/textappearance.appcompat.title" /> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/cheese_ipsum" /> </linearlayout> </android.support.v7.widget.cardview> </linearlayout> </android.support.v4.widget.nestedscrollview> <android.support.design.widget.floatingactionbutton android:layout_height="wrap_content" android:layout_width="wrap_content" app:layout_anchor="@id/appbar" app:layout_anchorgravity="bottom|right|end" android:src="@drawable/ic_discuss" android:layout_margin="@dimen/fab_margin" android:clickable="true" app:borderwidth="0dp"/>
anyone can point me problem, used:
android:layout_alignbottom="@+id/appbar"
"appbar" : appbarlayout
thanks
am wondering why need use multiple toolbar. instead if need place toolbar per shared image, place toolbar inside appbar layout. like:
<android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="@dimen/detail_backdrop_height" android:theme="@style/themeoverlay.appcompat.dark.actionbar" android:fitssystemwindows="true"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollflags="scroll|exituntilcollapsed" android:fitssystemwindows="true" app:contentscrim="?attr/colorprimary" app:expandedtitlemarginstart="48dp" app:expandedtitlemarginend="84dp"> <imageview android:id="@+id/backdrop" android:layout_width="match_parent" android:layout_height="match_parent" android:scaletype="centercrop" android:fitssystemwindows="true" app:layout_collapsemode="parallax" /> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="@drawable/gallery_toolbar_shape" app:popuptheme="@style/themeoverlay.appcompat.light" app:layout_collapsemode="pin" /> <progressbar android:id="@+id/gallery_progressbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_margintop="-7.5dp" style="?android:attr/progressbarstylehorizontal"/> </android.support.design.widget.collapsingtoolbarlayout> <android.support.v7.widget.toolbar android:id="@+id/personaltoolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:layout_alignbottom="@+id/appbar" android:layout_alignparentbottom="true" android:background="@color/personal_tb" app:popuptheme="@style/themeoverlay.appcompat.light" /> </android.support.design.widget.appbarlayout>
Comments
Post a Comment