i have main activity drawer layout , multiple fragments replace on menu item click. in 1 of fragment i'm using bottom sheet display info. bottom sheet behavior working fine : can switch between different states no problem. problem in expanded state bottom sheet stays below activity toolbar though set it's height match_parent. here xml (i implement collapsing toolbar don't know how override current one).
<android.support.design.widget.coordinatorlayout android:id="@+id/coordinator" android:layout_height="match_parent" android:layout_width="match_parent" android:theme="@style/theme.appcompat.noactionbar" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <relativelayout android:id="@+id/search_relativelayout" android:layout_width="match_parent" android:layout_height="match_parent" android:theme="@style/theme.appcompat.noactionbar"> <com.google.android.gms.maps.mapview android:id="@+id/mapview" android:layout_width="match_parent" android:layout_height="match_parent" /> </relativelayout> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/theme.appcompat.noactionbar"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:contentscrim="?attr/colorprimary" app:expandedtitlemarginend="64dp" app:expandedtitlemarginstart="48dp" app:layout_scrollflags="scroll|exituntilcollapsed|snap"> <android.support.v7.widget.toolbar android:id="@+id/toolbar_bottomsheet" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" app:layout_collapsemode="pin" app:popuptheme="@style/themeoverlay.appcompat.light" /> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <android.support.v4.widget.nestedscrollview android:id="@+id/bottom_sheet" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" android:elevation="20dp" app:behavior_hideable="true" app:behavior_peekheight="0dp" app:layout_behavior="@string/bottom_sheet_behavior"> <relativelayout android:id="@+id/bottom_sheet_relative_layout" android:layout_width="match_parent" android:layout_height="100dp" android:orientation="vertical"> <de.hdodenhof.circleimageview.circleimageview android:id="@+id/circle_picture" android:src="@mipmap/login_background" android:layout_margin="10dp" android:layout_width="50dp" android:layout_height="50dp" /> <textview android:id="@+id/name_bottom_sheet" android:layout_toendof="@id/circle_picture" android:text="title" android:textcolor="@color/buttonlogincolor" android:layout_margin="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:id="@+id/address_bottom_sheet" android:layout_below="@id/name_bottom_sheet" android:layout_toendof="@id/circle_picture" android:layout_marginstart="10dp" android:textcolor="@color/btn_create" android:text="" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <linearlayout android:layout_below="@id/circle_picture" android:layout_width="wrap_content" android:layout_height="wrap_content"> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" android:foreground="?android:attr/selectableitembackground" android:layout_margin="5dp" app:cardcornerradius="2dp"> </android.support.v7.widget.cardview> </linearlayout> </relativelayout> </android.support.v4.widget.nestedscrollview> <android.support.design.widget.floatingactionbutton android:id="@+id/fab2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="invisible" android:layout_margin="15dp" app:layout_anchor="@id/bottom_sheet" app:layout_anchorgravity="top|end"/> <android.support.design.widget.floatingactionbutton android:id="@+id/floatingbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="15dp" android:layout_marginbottom="50dp" android:layout_marginend="15dp" app:backgroundtint="@color/buttonlogincolor" app:borderwidth="0dp" app:elevation="6dp" app:layout_anchor="@id/fab2" app:layout_anchorgravity="top"/>
do have clue on how set bottom sheet's height matches full screen ?
Comments
Post a Comment