How to align horizontal RecyclerView to bottom? For example, I have a horizontal RecyclerView with a LinearLayoutManager that looks like this:
But I want all the RecyclerView items to be aligned to the bottom line, like so:
Is there any way to make this?
UPD This is my item layout:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<ImageView
android:id="@+id/columnImageView"
android:layout_width="@dimen/column_width"
android:layout_height="match_parent"
android:layout_marginHorizontal="@dimen/spacing_xs"
android:src="@drawable/graph_rectangle_white_b"
android:contentDescription="@null"
tools:layout_height="@dimen/spacing_3xl"
tools:visibility="visible"
tools:src="@drawable/graph_rectangle_blue_a" />
</layout>
And that's layout with my RecyclerView:
<?xml version="1.0" encoding="utf-8"?>
<layout>
<merge 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="wrap_content"
android:background="@color/grey_200">
...
<View
android:id="@+id/line5"
android:layout_width="0dp"
android:layout_height="1dp"
android:background="@color/grey_400"
app:layout_constraintBottom_toBottomOf="@id/main"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/chartRecyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:overScrollMode="never"
android:layout_marginHorizontal="@dimen/spacing_xs"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintBottom_toBottomOf="@id/line5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_alignBottom="@id/line5"
tools:layout_height="wrap_content"
tools:itemCount="5"
tools:listitem="@layout/chart_column_item"
tools:spanCount="5" />
</merge>
</layout>