Auto collapse toolbar

This commit is contained in:
Benoit Marty 2019-06-10 15:24:25 +02:00
parent ad8baf8091
commit 933e06a7ef
1 changed files with 19 additions and 17 deletions

View File

@ -4,23 +4,34 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/publicRoomsCoordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?riotx_header_panel_background">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.airbnb.epoxy.EpoxyRecyclerView
android:id="@+id/publicRoomsList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?riotx_header_panel_background"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:listitem="@layout/item_public_room" />
<com.google.android.material.appbar.AppBarLayout
style="@style/VectorAppBarLayoutStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp">
<androidx.appcompat.widget.Toolbar
android:id="@+id/publicRoomsToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
android:minHeight="0dp"
app:contentInsetStartWithNavigation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap|enterAlways">
<!-- Note: Background is modified in the code for other themes -->
<EditText
@ -52,6 +63,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:minHeight="@dimen/layout_touch_size"
android:text="@string/create_new_room"
@ -61,16 +73,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/publicRoomsToolbar" />
<com.airbnb.epoxy.EpoxyRecyclerView
android:id="@+id/publicRoomsList"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/publicRoomsCreateNewRoom"
tools:listitem="@layout/item_public_room" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>