Issues in hide toolbar with ObservableScrollView of Android -


hello friends want hide toolbar observablescrollview when user scroll on screen.

related screen layout appears below

enter image description here

and layout file below

main.xml

<android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:background="@color/header_bg" android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools">   <linearlayout     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">      <linearlayout         android:id="@+id/container_toolbar"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="vertical">         <include             android:id="@+id/toolbar"             layout="@layout/toolbar" />         <view             android:layout_width="match_parent"             android:layout_height="4dp"             android:background="@drawable/shadow" />         <customedittext.regularedittext             android:id="@+id/edt_search"             style="@style/edittext"             android:background="@drawable/search_rect"             android:drawableright="@drawable/search"             android:hint="search product"             android:padding="@dimen/margin_10dp"             android:text=""             android:textsize="@dimen/text_12" />      </linearlayout>      <framelayout         android:id="@+id/content_frame"         android:layout_width="fill_parent"          android:layout_height="match_parent"           >          <com.github.ksoichiro.android.observablescrollview.observablescrollview             android:id="@+id/scroll"             android:layout_width="match_parent"             android:fitssystemwindows="true"             android:layout_height="match_parent"             android:fillviewport="true">              <linearlayout                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                   android:orientation="vertical">                  <relativelayout                     android:id="@+id/scl_rels"                     android:layout_width="match_parent"                     android:layout_height="wrap_content">                      <relativelayout                         android:id="@+id/rel_pager"                         android:layout_width="match_parent"                         android:layout_height="100dp"                           >                          <android.support.v4.view.viewpager                             android:id="@+id/pager_introduction"                             android:layout_width="match_parent"                             android:layout_height="100dp"                             android:fitssystemwindows="true"                             tools:listitem="@layout/pager_item" />                          <linearlayout                             android:id="@+id/viewpagercountdots"                             android:layout_width="match_parent"                             android:layout_height="match_parent"                             android:layout_centerhorizontal="true"                             android:layout_marginbottom="@dimen/margin_10dp"                             android:gravity="center|bottom"                             android:orientation="horizontal" />                     </relativelayout>                      <linearlayout                         android:id="@+id/scl_ll"                         android:layout_width="match_parent"                         android:layout_height="match_parent"                         android:layout_below="@+id/rel_pager"                         android:orientation="vertical">                          <linearlayout                             android:id="@+id/ll_1"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:layout_margintop="@dimen/margin_10dp"                             android:layout_marginleft="@dimen/margin_10dp"                             android:layout_marginright="@dimen/margin_10dp"                             android:layout_marginbottom="@dimen/margin_5dp"                              android:orientation="horizontal">                              <customtext.boldtext                                 android:id="@+id/txt_title1"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:gravity="left"                                 android:textsize="@dimen/text_14"                                 android:text="deal of day"                                 android:textcolor="#333333"                                  />                              <customtext.regulartext                                 android:id="@+id/txt_1"                                 android:layout_width="match_parent"                                 android:layout_height="wrap_content"                                 android:layout_gravity="right"                                 android:gravity="right"                                 android:text="view all"                                 android:textsize="@dimen/text_10"                                 android:textcolor="@color/blue_common"                                  />                         </linearlayout>                           <horizontalscrollview                             android:id="@+id/hor"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:background="@drawable/search_rect"                             android:scrollbars="none">                              <linearlayout                                 android:id="@+id/ll_child"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:orientation="horizontal"></linearlayout>                         </horizontalscrollview>                          <linearlayout                             android:id="@+id/ll_2"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:layout_margintop="@dimen/margin_10dp"                             android:layout_marginleft="@dimen/margin_10dp"                             android:layout_marginright="@dimen/margin_10dp"                             android:layout_marginbottom="@dimen/margin_5dp"                              android:orientation="horizontal">                              <customtext.boldtext                                 android:id="@+id/txt_title2"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:gravity="left"                                 android:textsize="@dimen/text_14"                                  android:text="food , nutrition"                                 android:textcolor="#333333"                                 />                              <customtext.regulartext                                 android:id="@+id/txt_2"                                 android:layout_width="match_parent"                                 android:layout_height="wrap_content"                                 android:layout_gravity="right"                                 android:gravity="right"                                 android:text="view all"                                 android:textsize="@dimen/text_10"                                 android:textcolor="@color/blue_common"                                  />                         </linearlayout>                          <horizontalscrollview                             android:id="@+id/hor1"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:background="@drawable/search_rect"                              android:scrollbars="none">                              <linearlayout                                 android:id="@+id/ll_child1"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:orientation="horizontal"></linearlayout>                         </horizontalscrollview>                          <linearlayout                             android:id="@+id/ll_3"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:layout_margintop="@dimen/margin_10dp"                             android:layout_marginleft="@dimen/margin_10dp"                             android:layout_marginright="@dimen/margin_10dp"                             android:layout_marginbottom="@dimen/margin_5dp"                              android:orientation="horizontal">                              <customtext.boldtext                                 android:id="@+id/txt_title3"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:gravity="left"                                 android:textsize="@dimen/text_14"                                  android:text="home , furniture"                                 android:textcolor="#333333"                                  />                              <customtext.regulartext                                 android:id="@+id/txt_3"                                 android:layout_width="match_parent"                                 android:layout_height="wrap_content"                                 android:layout_gravity="right"                                 android:gravity="right"                                 android:text="view all"                                 android:textcolor="@color/blue_common"                                 android:textsize="@dimen/text_10" />                         </linearlayout>                          <horizontalscrollview                             android:id="@+id/hor2"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:background="@drawable/search_rect"                              android:scrollbars="none">                              <linearlayout                                 android:id="@+id/ll_child3"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:orientation="horizontal"></linearlayout>                         </horizontalscrollview>                          <linearlayout                             android:id="@+id/ll_4"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:layout_margintop="@dimen/margin_10dp"                             android:layout_marginleft="@dimen/margin_10dp"                             android:layout_marginright="@dimen/margin_10dp"                             android:layout_marginbottom="@dimen/margin_5dp"                              android:orientation="horizontal">                              <customtext.boldtext                                 android:id="@+id/txt_title4"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:gravity="left"                                 android:textsize="@dimen/text_14"                                  android:text="addtobuy fashion sale"                                 android:textcolor="#333333"                                   />                              <customtext.regulartext                                 android:id="@+id/txt_4"                                 android:layout_width="match_parent"                                 android:layout_height="wrap_content"                                 android:layout_gravity="right"                                 android:gravity="right"                                 android:text="view all"                                 android:textcolor="@color/blue_common"                                 android:textsize="@dimen/text_10"/>                         </linearlayout>                          <horizontalscrollview                             android:id="@+id/hor3"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                              android:background="@drawable/search_rect"                             android:scrollbars="none">                              <linearlayout                                 android:id="@+id/ll_child4"                                 android:layout_width="wrap_content"                                 android:layout_height="wrap_content"                                 android:orientation="horizontal"></linearlayout>                         </horizontalscrollview>                     </linearlayout>                 </relativelayout>             </linearlayout>          </com.github.ksoichiro.android.observablescrollview.observablescrollview>      </framelayout>  </linearlayout> <!--<include     android:id="@+id/toolbar"     layout="@layout/toolbar" /> <framelayout     android:id="@+id/content_frame"     android:layout_width="match_parent"     android:layout_height="match_parent" />-->  <!-- navigation drawer --> <listview     android:id="@+id/navdrawer"     android:layout_width="240dp"     android:layout_height="match_parent"     android:layout_gravity="start"     android:background="@android:color/white"     android:choicemode="singlechoice"     android:divider="@android:color/transparent"      android:layertype="software"     android:dividerheight="1dp"     android:drawselectorontop="false"> </listview>  <!--<expandablelistview     android:id="@+id/left_drawer"     android:layout_width="240dp"     android:layout_height="match_parent"     android:layout_gravity="start"      android:background="@android:color/white"     android:cachecolorhint="#00000000"      android:divider="@android:color/transparent"     android:dividerheight="0dp" />--> 

when run above code hide toolbar remain space @ bottom below :

enter image description here

any idea how can solve this?


Comments