question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RecyclerView in RecyclerView with FlexboxLayoutManager only show one line

See original GitHub issue

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*

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
IDevelopescommented, Mar 27, 2020

Its 2020 and this issue is still present 😕

9reactions
Ratul-Bin-Tazulcommented, Aug 20, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to show on the screen only one row(not a grid) of ...
If it is possible to define RecycleView with FlexboxLayoutManager to show on the screen only one line(row) instead of grid(two dimensions ...
Read more >
Flexbox for Android – Creating a CenterFlowAdapter
First, we need a RecyclerView. Note the button that's calling a method in the viewModel to add numbers. ... For displaying our contents...
Read more >
Using the RecyclerView | CodePath Android Cliffnotes
Using a RecyclerView has the following key steps: Define a model class to use as the data source; Add a RecyclerView to your...
Read more >
google / flexbox-layout Download - JitPack
findViewById(R.id.recyclerview); FlexboxLayoutManager layoutManager = new ... This attribute controls whether the flex container is single-line or ...
Read more >
FlexboxLayoutManager Not Centered In ViewPager with Multi ...
I have a ViewPager whose items are a GridLayout with 3 columns. The center column (`android:layout_column="1"`) contains a RecyclerView that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found