Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling android CoordinatorLayout scrolling behaviour

When adding scrolling behaviour to a layout with coordinatorLayout like this:

<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:fitsSystemWindows="true">

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

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

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

    <FrameLayout
        android:id="@+id/mainContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">
    </FrameLayout>

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

the mainContent is the part that matters.

The real layout will be inflated inside this container.

Imagining my View consists of a RecyclerView, and a fixed layout at the bottom of the screen.

Does someone know a way to remove the scrolling behavior of the bottom fixed layout and keep the RecyclerView-Toolbar-hide behaviour?

like image 792
johnny_crq Avatar asked Nov 08 '22 19:11

johnny_crq


1 Answers

Inside a 'CoordinatorLayout' the views that scroll must be first and only later the non-scrollable views. I managed to solve the issue by placing my non-scrollable layout outside the 'mainContent', just below it

like image 134
johnny_crq Avatar answered Nov 14 '22 21:11

johnny_crq