1

Im using RecyclerView with PagedListAdpter If i set recyclerView's height&width with MATCH_PARENT, adapter.submitList(someList) works fine, But If i set height&width to 0dp(for constraintLayout) it doesnt work, Methods inside Adapter and ViewHolder not called.

Is there any mistake inside Constraint Layout?

XML Code Below:

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/search_result_root"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:id="@+id/search_input_layout"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.appcompat.widget.AppCompatEditText
                android:id="@+id/search_input"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <Button
                android:id="@+id/search_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:text="tasdf"
                app:layout_constraintBottom_toBottomOf="@id/search_input"
                app:layout_constraintRight_toRightOf="@id/search_input"
                app:layout_constraintTop_toTopOf="@id/search_input" />

        </RelativeLayout>

        <Spinner
            android:id="@+id/search_options"
            android:layout_width="60dp"
            android:layout_height="30dp"
            android:background="@color/color_transparent"
            android:spinnerMode="dropdown"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@id/search_input_layout" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/search_recyclerview"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:clipToPadding="false"
            android:paddingLeft="10dp"
            android:paddingTop="20dp"
            android:paddingRight="10dp"
            android:paddingBottom="20dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/search_options" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>

Link For Layout Image

sssrigo
  • 11
  • 1

0 Answers0