ChipsLayoutManager icon indicating copy to clipboard operation
ChipsLayoutManager copied to clipboard

Wrong items count

Open iq1 opened this issue 7 years ago • 2 comments

In my case it doesn't show all items from adapter. I tried different configurations of ChipsLayoutManager, but i can see all items only when setMaxViewsInRow(1) Items layout has fixed height and width. And when i have add 8 items then i see only 6 of them. When i changing ChipsLayoutManager to LinearLayoutManager then all items appears.

RecyclerView defined as:

<android.support.v7.widget.RecyclerView
        android:id="@+id/child_list"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        app:layout_constraintTop_toBottomOf="@id/locker_bw_icon"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintBottom_toTopOf="@id/copyright" />

Each element has layout like:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root"
    android:layout_width="100dp"
    android:layout_height="80dp"
    android:background="@drawable/lock_available">
    <Button
        android:id="@+id/reserve_button"
        android:text="@string/map_booking_reserve"
        android:textSize="8sp"
        android:textColor="@android:color/white"
        android:layout_width="82dp"
        android:layout_height="26dp"
        android:background="@drawable/button_gradient"
        android:layout_gravity="center" />
</FrameLayout>

ChipsLayoutManager config is basic(but i tried different cases):

ChipsLayoutManager layoutManager = ChipsLayoutManager.newBuilder(getContext())
                .build();

iq1 avatar Dec 30 '16 17:12 iq1

Do you have enough space to place all items inside fixed sized RecyclerView ?

BelooS avatar Jan 11 '17 14:01 BelooS

Hi, May i ask if you have any update to the issue? I encountered similar issue recently, the last 2 items of recycle view were disappeared with maxViewsInRow=4. However, issue was fixed with maxViewsInRow = 3. Could you help me to fix the problem. The following is my configuration for recycleview and layout manager.

ChipsLayoutManager chipsLayoutManager = ChipsLayoutManager.newBuilder(getActivity()).setMaxViewsInRow(3).setScrollingEnabled(true).build(); flowRecycleView.setLayoutManager(chipsLayoutManager);

<android.support.v7.widget.RecyclerView android:id="@+id/flow_recycle" android:layout_marginTop="37dp" android:layout_marginLeft="33dp" android:layout_marginRight="33dp" android:layout_width="match_parent" android:layout_height="match_parent"/>

YuChengFan avatar Sep 14 '18 05:09 YuChengFan