Scroll down to the CoordinatorLayout element containing the NestedScrollView and AppBarLayout

Is there a way (programmatically or xml) to scroll to the bottom of the next CoordinatorLayout list (see below), so the last item in the NestedScrollView is displayed when the screen is displayed?

Attached is the actual screen and display screen. As you can note the comparison of both images, when scrolling down the image has a parallax effect.

I would like the button (only in the second image) at the bottom of the NestedScrollView to be visible when the screen loads ... it takes a bit of automatic scrolling!

Any suggestion would be appreciated.

The current initial screen appears:

The current home screen is displayed.

Desired start screen:

Desired Start Screen

xml layout:

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

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:adjustViewBounds="true"
                android:background="#000"
                android:paddingEnd="40dp"
                android:paddingStart="40dp"
                android:paddingTop="30dp"
                android:src="@drawable/image"
                app:layout_collapseMode="parallax"
                tools:ignore="ContentDescription"/>

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

    <android.support.v4.widget.NestedScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/black"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:focusableInTouchMode="true"
            android:orientation="vertical"
            android:paddingBottom="30dp"
            android:paddingTop="30dp">

            <TextView
                style="@style/register_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/register_text_1"/>

            <EditText
                android:id="@+id/param1"
                style="@style/register_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/param1"
                android:textColorHint="#fff"/>

            <EditText
                android:id="@+id/param2"
                style="@style/register_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/param2"
                android:textColorHint="#fff"/>

            <EditText
                android:id="@+id/param3"
                style="@style/register_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/param3"
                android:textColorHint="#fff"/>

            <EditText
                android:id="@+id/param4"
                style="@style/register_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/param4"
                android:textColorHint="#fff"/>

            <EditText
                android:id="@+id/param5"
                style="@style/register_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/param5"
                android:textColorHint="#fff"/>

            <EditText
                android:id="@+id/param6"
                style="@style/register_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/param6"
                android:textColorHint="#fff"/>

            <TextView
                android:id="@+id/accept"
                style="@style/button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="30dp"
                android:minWidth="100dp"
                android:text="@string/button_accept"/>

        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
+4

All Articles