Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecyclerView in RecyclerView with FlexboxLayoutManager only show one line #290

Closed
PPTing opened this issue Jun 3, 2017 · 9 comments
Closed
Labels
Milestone

Comments

@PPTing
Copy link

PPTing commented Jun 3, 2017

I use a recyclerview(just call it the ARecyclerView with LinearLayoutManager ) and make another recyclerview(just call it the BRecyclerView with FlexboxLayoutManager) as the item of ARecyclerView**.

But after I call notifyDataSetChanged() ,the BRecyclerView only show one line whenever the data change. What I want is it should show more than one line because the BRecyclerView don't show all data.
The BRecyclerView layout is

<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/training_term_and_lesson_item_list"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:listitem="@layout/training_item_venue_filter" />

and the item of BRecyclerView is

<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/training_item_venue_filter_venue_name"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginEnd="20dp"
    android:layout_marginRight="20dp"
    android:layout_marginTop="15dp"
    android:background="@drawable/commonsdk_bg_checkbox_corner_5"
    android:button="@null"
    android:gravity="center"
    android:minWidth="80dp"
    android:paddingBottom="7dp"
    android:paddingEnd="13dp"
    android:paddingLeft="13dp"
    android:paddingRight="13dp"
    android:paddingStart="13dp"
    android:paddingTop="7dp"
    android:textColor="@drawable/commonsdk_checkbox_text_color_normal_white"
    android:textSize="@dimen/commonsdk_super_small_text"
    tools:text="Hello World" />

Expected behavior

What I want it show is

Version of the flexbox library

0.3.0-alpha3*

@thagikura
Copy link
Contributor

Hi @PPTing,

What parameters do you pass to the FlexboxLayoutManager? (e.g. FlexWrap, FlexDirection)
For example, if you pass FlexDirection.ROW and FlexWrap.NOWRAP, having a single line is expected.

@PPTing
Copy link
Author

PPTing commented Jun 6, 2017

Hello @thagikura ,I new a FlexboxLayoutManager and not pass any parameters to the it, so the default value is FlexDirection.ROW, FlexWrap.WRAP
So how can I make the child RecyclerView( BRecyclerView) show all the view ?
When I use GridLayoutManager, it can show all the view in child RecyclerView( BRecyclerView).
But when I use FlexboxLayoutManager , the child RecyclerView only show the height like only one line but I think it should show all the data and scroll it

@AlexTysel
Copy link

@thagikura I have the same issue as @PPTing . I pass FlexDirection.ROW, FlexWrap.WRAP to the FlexboxLayoutManager

@thagikura
Copy link
Contributor

Sorry for the delayed comment. Confirmed the issue on my end.

Let me mark this as a bug.

@thagikura thagikura added the bug label Jun 14, 2017
thagikura added a commit that referenced this issue Jun 14, 2017
…lerViews

where the inner RecycerView's adapter is FlexboxLayoutManager with FlexWrap is
set to wrap.

This was caused because height 0 was passed from the parent RecyclerView
if the layout_height is specified as wrap_content, thus
FlexboxLayoutManager didn't calculate the entire items.

This fixes #290
@thagikura
Copy link
Contributor

Should be fixed by #301

thagikura added a commit that referenced this issue Jun 15, 2017
…lerViews

Fixes the issue that only single line was displayed with nested RecyclerViews
where the inner RecycerView's adapter is FlexboxLayoutManager with FlexWrap is
set to wrap.

This was caused because height 0 was passed from the parent RecyclerView
if the layout_height is specified as wrap_content, thus
FlexboxLayoutManager didn't calculate the entire items.

This fixes #290
@thagikura thagikura added this to the 0.3.0-alpha4 milestone Jun 15, 2017
thagikura added a commit that referenced this issue Jun 15, 2017
…lerViews

Fixes the issue that only single line was displayed with nested RecyclerViews
where the inner RecycerView's adapter is FlexboxLayoutManager with FlexWrap is
set to wrap.

This was caused because height 0 was passed from the parent RecyclerView
if the layout_height is specified as wrap_content, thus
FlexboxLayoutManager didn't calculate the entire items.

This fixes #290
thagikura added a commit that referenced this issue Jun 16, 2017
…lerViews

Fixes the issue that only single line was displayed with nested RecyclerViews
where the inner RecycerView's adapter is FlexboxLayoutManager with FlexWrap is
set to wrap.

This was caused because height 0 was passed from the parent RecyclerView
if the layout_height is specified as wrap_content, thus
FlexboxLayoutManager didn't calculate the entire items.

This fixes #290
thagikura added a commit that referenced this issue Jun 28, 2017
…lerViews

Fixes the issue that only single line was displayed with nested RecyclerViews
where the inner RecycerView's adapter is FlexboxLayoutManager with FlexWrap is
set to wrap.

This was caused because height 0 was passed from the parent RecyclerView
if the layout_height is specified as wrap_content, thus
FlexboxLayoutManager didn't calculate the entire items.

This fixes #290
@Ratul-Bin-Tazul
Copy link

The issue is still present.
Using
layoutManager.setFlexDirection(FlexDirection.ROW);
layoutManager.setFlexWrap(FlexWrap.WRAP);

@IDevelopes
Copy link

Its 2020 and this issue is still present 😕

@akankshapaul048
Copy link

The issue still exist. Time to check out other solution.

@cw-sanjeev
Copy link

@thagikura The issue still exists, is there any other fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants