Android - How to make this animation with parallax effect (see animation)

0

I have a big question, how can I do this animation (see below) on Android?

  

WhathaveItried?

<?xmlversion="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"
        tools:context=".MainActivity">

    <!--ESSA TOOLBAR PRECISA SER FIXADA NO TOPO-->
    <!--NÃAO PODE SER SCROLLADA-->
    <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar_fixed_top"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"/>

    <android.support.design.widget.AppBarLayout
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/toolbar_layout"
                android:fitsSystemWindows="true"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:toolbarId="@+id/toolbar"
                app:layout_scrollFlags="scroll|exitUntilCollapsed"
                app:contentScrim="?attr/colorPrimary">

            <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"/>


            <!--CONTEUDO DO HEADER ABAIXO DA TOOLBAR-->
            <android.support.constraint.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Contacts"/>
                <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="12"/>
                <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Amount"/>
                <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="675.353,45"/>
                <!--CONTENT OF WHITE VIEW HERE-->

            </android.support.constraint.ConstraintLayout>
        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.widget.NestedScrollView
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        <android.support.constraint.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            <!--CONTEUDO DA VIEW COM FUNDO BRANCO AQUI-->

        </android.support.constraint.ConstraintLayout>
    </android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>

But the layout breaks, because the second Toolbar appears with a large text and stands above my Header at the time it is rolled, and even then when I I make the scrolling effect on the page, it looks like it was placed in a ScrollView and not with an effect and delay as it appears in the image above. NOTE: The scroll does not have the effect of "locking" the button as it is in a displayed image time, I have re-created the animation to show and I'm not that good, so scroll < strong> happens naturally , but with a delay in this piece that "hangs"

    
asked by anonymous 30.11.2018 / 09:21

0 answers