android - Collapsing/expanding Google Maps fragment -


i have layout google maps fragment on top , scrollview @ bottom. need collapse fragment on scrolling bottom view, on example (scrolling technique 4): http://code.tutsplus.com/articles/scrolling-techniques-for-material-design--cms-24435.

here layout. how implement this?

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     xmlns:app="http://schemas.android.com/apk/res-auto"     android:orientation="vertical">      <android.support.design.widget.appbarlayout         android:id="@+id/my_appbar_container"         android:layout_width="match_parent"         android:layout_height="192dp"         android:theme="@style/themeoverlay.appcompat.dark.actionbar"         android:background="@color/colorprimary">      <android.support.design.widget.collapsingtoolbarlayout         android:id="@+id/collapsing_container"         android:layout_width="match_parent"         android:layout_height="match_parent"         app:layout_scrollflags="scroll|exituntilcollapsed"         android:background="@color/colorprimary"         app:title="address"         app:expandedtitlemarginstart="48dp"         app:expandedtitlemarginend="64dp">      <fragment         android:id="@+id/map"         android:name="com.google.android.gms.maps.supportmapfragment"         android:layout_width="match_parent"         android:layout_height="200dp">              <framelayout                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 android:background="@drawable/abc_popup_background_mtrl_mult">                  <fragment                     android:id="@+id/autocomplete_fragment"                     android:name="com.google.android.gms.location.places.ui.placeautocompletefragment"                     android:layout_width="match_parent"                     android:layout_height="wrap_content" />              </framelayout>      </fragment>      </android.support.design.widget.collapsingtoolbarlayout>      </android.support.design.widget.appbarlayout>       <scrollview         android:layout_width="match_parent"         android:layout_height="wrap_content">          <linearlayout             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:orientation="vertical"             android:padding="@dimen/activity_horizontal_margin">              <relativelayout                 android:layout_width="match_parent"                 android:layout_height="wrap_content">                  <textview                     android:id="@+id/name_label"                     android:layout_width="@dimen/textview_with"                     android:layout_height="wrap_content"                     android:layout_centervertical="true"                     android:text="@string/textview_name"                     android:textcolor="#000"                     android:textsize="@dimen/textview_size" />                  <edittext                     android:id="@+id/name"                     android:hint="@string/edittext_hint_name"                     android:layout_width="match_parent"                     android:layout_height="wrap_content"                     android:layout_toendof="@+id/name_label"                     android:layout_torightof="@+id/name_label"                     android:singleline="true" />               </relativelayout>              ...              <relativelayout                 android:layout_width="match_parent"                 android:layout_height="wrap_content">              ...              </relativelayout>         </linearlayout>     </scrollview>  </linearlayout> 

solved mapsview instead fragment: https://www.bignerdranch.com/blog/embedding-custom-views-with-mapview-v2/

it's easy implement in coordinatorlayout.


Comments