java - Bottom sheet not working as intended -
i'm using custom gridview + navigation drawer
working of app, when tried add bottom sheet in coordinatorlayout
, seems using 40% of page without being expanded or collapsed when triggered using longpress event on griditem. note doesn't expand or collapse sliding behaviour well.
the main xml (followed child xmls) activity_gyapak.xml:
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout 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:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:opendrawer="start"> <include layout="@layout/app_bar_gyapak" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.navigationview android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:fitssystemwindows="true" app:headerlayout="@layout/nav_header_gyapak" app:menu="@menu/activity_gyapak_drawer" /> </android.support.v4.widget.drawerlayout>
the app_bar_gyapak.xml bottom sheet added:
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout 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" android:fitssystemwindows="true" tools:context="edu.ahduni.seas.gyapak.gyapakactivity"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/apptheme.appbaroverlay"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" app:popuptheme="@style/apptheme.popupoverlay" /> </android.support.design.widget.appbarlayout> <include layout="@layout/content_gyapak" /> <android.support.design.widget.floatingactionbutton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" app:srccompat="@drawable/ic_cloud_download_white_24dp" /> <android.support.v4.widget.nestedscrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/bottom_sheet1" android:layout_width="match_parent" android:layout_height="250dp" android:cliptopadding="true" android:background="@android:color/holo_blue_bright" app:layout_behavior="android.support.design.widget.bottomsheetbehavior"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <textview android:layout_width="match_parent" android:layout_height="match_parent" android:text="@string/sheet_p1" android:textsize="16sp" android:textallcaps="true" android:padding="16dp"/> <textview android:layout_width="match_parent" android:layout_height="match_parent" android:text="@string/long_latin" android:padding="16dp" android:textsize="16sp"/> </linearlayout> </android.support.v4.widget.nestedscrollview> </android.support.design.widget.coordinatorlayout>
the content_gyapak.xml custom gridview
each grid contains vertical linearlayout
of imageview
+ textview
:
<?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:id="@+id/content_gyapak" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="5dp" android:paddingleft="5dp" android:paddingright="5dp" android:paddingtop="0dp" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context="edu.ahduni.seas.gyapak.gyapakactivity" tools:showin="@layout/app_bar_gyapak"> <gridview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/grid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:columnwidth="90dp" android:numcolumns="auto_fit" android:verticalspacing="10dp" android:horizontalspacing="10dp" android:stretchmode="columnwidth" android:gravity="center" android:paddingleft="10dp" android:paddingright="10dp" android:paddingtop="10dp" android:paddingbottom="80dp" android:cliptopadding="false" android:scrollbars="vertical"/> </relativelayout>
Comments
Post a Comment