Created
September 13, 2019 10:50
-
-
Save danaimset/da40360f0d5fee88c1bcf7fc6aea0268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout 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"> | |
<androidx.core.widget.NestedScrollView | |
android:id="@+id/nestedScrollView" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fillViewport="true" | |
android:scrollbarStyle="outsideOverlay" | |
android:scrollbars="vertical"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<com.google.android.material.card.MaterialCardView | |
android:id="@+id/header" | |
android:layout_width="0dp" | |
android:layout_height="?android:listPreferredItemHeightLarge" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent"> | |
<!-- ... --> | |
</com.google.android.material.card.MaterialCardView> | |
<TextView | |
android:id="@+id/subtitle1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="@dimen/marginCompact" | |
android:layout_marginTop="@dimen/marginLarge" | |
android:text="Subtitle1" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toBottomOf="@id/header" /> | |
<androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/horizontalRecycler" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toBottomOf="@id/subtitle1" /> | |
<TextView | |
android:id="@+id/subtitle2" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Subtitle2" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toBottomOf="@id/horizontalRecycler" /> | |
<androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/verticalRecycler" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toBottomOf="@id/subtitle2" /> | |
</androidx.constraintlayout.widget.ConstraintLayout> | |
</androidx.core.widget.NestedScrollView> | |
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
In the sample above the first recycler view has horizontal scroll (android:id="@+id/horizontalRecycler")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nestedScrollingEnabled = true for Recyclers