android - Collapsing card view when Recycler View scroll down -


how can put card below toolbar , collapse until disappear when scroll down , re open when scroll up

i using xamarin.android design libary

here axml code:

    <?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"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:id="@+id/coordinatorlayoutmainlayoutpublicationslayout"     android:fitssystemwindows="true">    <android.support.design.widget.appbarlayout          android:id="@+id/main.appbar"          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:fitssystemwindows="true">      <android.support.design.widget.collapsingtoolbarlayout           android:id="@+id/collapsing_toolbar"           android:layout_width="match_parent"           android:layout_height="wrap_content"           android:fitssystemwindows="true"           app:layout_scrollflags="scroll|enteralways|enteralwayscollapsed">        <android.support.v7.widget.cardview              xmlns:card_view="http://schemas.android.com/apk/res-auto"              android:id="@+id/card_view"              android:layout_gravity="center"              android:layout_width="match_parent"              android:layout_height="wrap_content"              app:cardcornerradius="4dp"              app:cardelevation="4dp"              app:cardusecompatpadding="true">          <button          android:layout_width="match_parent"          android:layout_height="150dp"          android:text="bobobobobobob"          app:layout_scrollflags="scroll|enteralways"/>        </android.support.v7.widget.cardview>      </android.support.design.widget.collapsingtoolbarlayout>    </android.support.design.widget.appbarlayout>      <android.support.v4.widget.swiperefreshlayout     android:id="@+id/swipecontainerpublicationslayout"     android:layout_width="match_parent"     android:layout_height="match_parent"     app:layout_behavior="@string/appbar_scrolling_view_behavior">      <android.support.v7.widget.recyclerview       android:id="@+id/recyclerviewpublicationslayout"       android:scrollbars="vertical"       android:layout_width="match_parent"       android:layout_height="match_parent" />    </android.support.v4.widget.swiperefreshlayout>    <android.support.v7.widget.toolbar         android:id="@+id/toolbarpublicationslayout"         android:layout_width="match_parent"         android:layout_height="?attr/actionbarsize"         android:background="?attr/colorprimary" />    <android.support.design.widget.floatingactionbutton     android:id="@+id/fabpublicationslayout"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_gravity="bottom|end"     android:src="@drawable/icon_add_fab"     android:layout_margin="15dp" />  </android.support.design.widget.coordinatorlayout> 

the output view this:

screenshot of view

after many hours searching found solution, make recyclerview , cardview inside nestedscrollview

<?xml version="1.0" encoding="utf-8"?>    <linearlayout 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="wrap_content"       android:orientation="vertical"     android:id="@+id/linearlayoutmainlayout">      <android.support.v7.widget.toolbar           android:id="@+id/toolbar"           android:layout_width="match_parent"           android:layout_height="?attr/actionbarsize"           android:background="?attr/colorprimary" />     <android.support.design.widget.coordinatorlayout          android:layout_width="match_parent"         android:layout_height="match_parent"         android:id="@+id/coordinatorlayoutmainlayout">      <android.support.v4.widget.swiperefreshlayout       android:id="@+id/swipecontainer"       android:layout_width="match_parent"       android:layout_height="match_parent"  >      <android.support.v4.widget.nestedscrollview     android:layout_width="match_parent"     android:layout_height="wrap_content"     >      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="vertical"         >           <android.support.v7.widget.cardview     android:id="@+id/card_view"    android:layout_width="match_parent"    android:layout_height="wrap_content"    app:cardcornerradius="4dp"    app:cardelevation="4dp"    app:cardusecompatpadding="true">       <linearlayout       android:layout_width="match_parent"       android:layout_height="wrap_content"       android:orientation="vertical"       android:padding="8dp">        <textview         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:textappearance="?android:attr/textappearancemedium"         android:textstyle="bold"         android:id="@+id/textview1" />       <textview         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:id="@+id/textview2" />       <textview         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:id="@+id/textview3" />       <textview         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:id="@+id/textview4" />       <button         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:id="@+id/button" />      </linearlayout>    </android.support.v7.widget.cardview>           <android.support.v7.widget.recyclerview           android:id="@+id/recyclerview"           android:scrollbars="vertical"           android:layout_width="match_parent"           android:layout_height="wrap_content"           android:nestedscrollingenabled="false"/>      </linearlayout>  </android.support.v4.widget.nestedscrollview>         </android.support.v4.widget.swiperefreshlayout>  <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:src="@drawable/icon_add_fab"     android:layout_margin="15dp"/>  </android.support.design.widget.coordinatorlayout>  </linearlayout> 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -