java - How to achieve an "animated CollapsingToolbar?" -


basically, wondering how when using recyclerview, how 1 can achieve sort of "animated collapsingtoolbar." note it's in quotes, because i'm not attached solution being collapsingtoolbar, that's closest thing can find far want. basically, want make toolbar has title of app, , subtitle string followed int (as string type). scroll up, want string fade off, have int remain , move same level app title.

enter image description here (excuse crude drawing)

i've looked @ this solution, it's dependent on listview. i've looked @ this solution, can't see how able customize animation how i'd like. this repo looks work, has bunch of errors , can't compile.

so basically, sum up, i'm looking how it's possible animate toolbar in way i've described above, with means think best, not necesserily collapsingtoolbar.

checkout coordinatorlayout

<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:fitssystemwindows="true">      <android.support.design.widget.appbarlayout         android:id="@+id/app_bar"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:paddingtop="5dp"         android:paddingbottom="30dp"         android:theme="@style/apptheme.appbaroverlay"         >          <abysmel.com.collapsibletoolbarhelper.widgets.collapsibletoolbarhelper             android:id="@+id/toolbar_layout"             android:layout_width="match_parent"             android:layout_height="match_parent"             app:layout_scrollflags="scroll|exituntilcollapsed"             android:gravity="center_vertical"             android:layout_margintop="10dp"             android:background="@android:color/transparent"             >              <!--note position has set respect collapsed toolbar. so,                 aligning in center (centerinparent="true") not work remain                 @ position after toolbar collapses. note set                 alpha of view 0 , not visibility gone, view have never                 been drawn throw calculations haywire show_on_collapse. wish there                 better way this-->             <imageview                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:id="@+id/hello.img"                 android:src="@mipmap/hello"                 android:layout_marginleft="10dp"                 android:alpha="0"                 app:layout_margintoppercent = "3%"                 app:collapsemode="show_on_collapse"/>              <!-- title -->             <abysmel.com.collapsibletoolbarhelper.widgets.collapsibletextlayout                 android:id="@+id/hello.text"                 android:layout_height="wrap_content"                 android:layout_width="wrap_content"                 app:layout_widthpercent="59%"                 android:layout_alignparentleft="true"                 app:layout_margintoppercent = "1%"                 app:layout_marginbottompercent = "1%"                 app:layout_marginleftpercent="5%"                 android:textcolor="@android:color/white"                 app:collapsemode="pin_on_scroll"                 app:texttoshow = "hello world"                 app:expandedtextcolor = "@android:color/white"                 app:collapsedtextcolor = "@android:color/white"                 app:typefacefamilyprimary = "sans-serif-light"                 app:typefacefamilysecondary = "sans-serif-medium"                 app:ismultifaceted="true"                 app:typefacesplitposition="5"                 app:expandedtextsize = "62dp"                 app:collapsedtextsize = "32dp"                 app:maxexpandedtextsize = "62dp"                 />              <!-- hello number edit button -->             <imageview                 android:id="@+id/hello.edit"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_alignparentright="true"                 app:layout_margintoppercent = "3%"                 app:layout_marginbottompercent = "1%"                 app:layout_marginrightpercent = "4%"                 android:layout_marginleft="10dp"                 android:src="@mipmap/pencil"                 app:collapsemode="hide_on_collapse"/>              <!-- hello number -->             <textview                 android:id="@+id/hello.number"                 android:layout_height="wrap_content"                 android:layout_width="wrap_content"                 app:layout_widthpercent="40%"                 app:layout_margintoppercent = "1%"                 app:layout_marginbottompercent = "1%"                 app:layout_marginrightpercent = "1%"                 android:layout_toleftof="@id/hello.edit"                 android:layout_torightof="@id/hello.text"                 android:gravity="end"                 android:text="@string/hello_no_sign"                 android:textcolor="@android:color/white"                 android:textsize="@dimen/hello_no_size"                 app:collapsemode="pin_on_scroll"/>                <!-- version -->             <textview                 android:id="@+id/version"                 app:layout_widthpercent="40%"                 android:layout_height="wrap_content"                 android:layout_width="wrap_content"                 android:layout_below="@id/hello.text"                 android:layout_margintop="5dp"                 android:layout_alignparentleft="true"                 app:layout_marginleftpercent="5%"                 android:text="@string/version"                 android:textcolor="@android:color/white"                 android:textsize="@dimen/version_no_size"                 app:collapsemode="parallax_on_scroll"                  />              <!-- e-mail address -->             <textview                 android:id="@+id/hello.address"                 app:layout_widthpercent="40%"                 android:layout_height="wrap_content"                 android:layout_width="wrap_content"                 android:layout_below="@id/hello.number"                 android:layout_alignparentright="true"                 android:gravity="end"                 app:layout_marginrightpercent="5%"                 android:text="@string/emailaddress"                 android:textcolor="@android:color/white"                 android:textsize="@dimen/mail_address_size"                 app:collapsemode="parallax_on_scroll"                  />         </abysmel.com.collapsibletoolbarhelper.widgets.collapsibletoolbarhelper>     </android.support.design.widget.appbarlayout> </android.support.design.widget.coordinatorlayout> 

https://github.com/opacapp/multiline-collapsingtoolbar


Comments