sanevys
sanevys

Reputation: 559

RecycleView row max height?

I would like to know if there is a max height of RecycleView rows. I created a simple RecycleView.Adapter which row layout does not fit in. It gets chopped and new row starts. I do not use fixed height or width anywhere so it should expand as much as layout requires, unless there is a maximum of row height in RecycleView? I will be able to post some code later.

For the sake of argument, I left only this code to inflate (as you can see for testing purpose I set android:layout_height="100000dp"):

<RelativeLayout
    android:id="@+id/feed_photo_user_container"
    android:layout_width="match_parent"
    android:layout_height="100000dp"
    android:background="@color/WHITE">


    <com.github.siyamed.shapeimageview.CircularImageView
        android:id="@+id/feed_photo_user_image"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginBottom="15dp"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="15dp"
        android:src="@drawable/user_icon" />

    <TextView
        android:id="@+id/feed_photo_user_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@id/feed_photo_user_image"
        android:layout_alignTop="@id/feed_photo_user_image"
        android:layout_marginLeft="8dp"
        android:layout_toEndOf="@id/feed_photo_user_image"
        android:layout_toRightOf="@id/feed_photo_user_image"
        android:gravity="center"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:scaleType="fitXY"
        android:src="@drawable/seperator_line" />

</RelativeLayout>

And the result is the same, RecycleView somehow limits my row height. image As you can see it can expand till some maximum height

Upvotes: 1

Views: 1323

Answers (1)

sanevys
sanevys

Reputation: 559

They key point was to change layout height from MACH_PARENT to wrap_content. All good now.

Upvotes: 1

Related Questions