flexbox-layout icon indicating copy to clipboard operation
flexbox-layout copied to clipboard

RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen)

Open wkp91 opened this issue 1 year ago • 4 comments

Problem and steps to reproduce

RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen)。

But when FlexboxLayoutManager is set to FlexDirection.COLUMN. Vertical display can all be displayed, and LinearLayoutManager or GridLayoutManager can also be used to display all

Only when FlexboxLayoutManager is set to FlexDirection.ROW is not fully displayed

Version of the flexbox library 3.0.0 and earlier

wkp91 avatar Oct 25 '22 08:10 wkp91

I have the same problem,Is there a solution?

xinnuo avatar Mar 29 '23 03:03 xinnuo

Same problem here, when the layout manager is changed, all items are visible again

crayon-monster avatar Apr 13 '23 16:04 crayon-monster

Find FlexBoxHelper.java

if (sumCrossSize > needsCalcAmount && reachedToIndex) {
    // Stop the calculation if the sum of cross size calculated reached to the point
    // beyond the needsCalcAmount value to avoid unneeded calculation in a
    // RecyclerView.
    // To be precise, the decoration length may be added to the sumCrossSize,
    // but we omit adding the decoration length because even without the decorator
    // length, it's guaranteed that calculation is done at least beyond the
    // needsCalcAmount
    break;
}

Then comment out the If branch code above

if (sumCrossSize > needsCalcAmount && reachedToIndex) {
    // Stop the calculation if the sum of cross size calculated reached to the point
    // beyond the needsCalcAmount value to avoid unneeded calculation in a
    // RecyclerView.
    // To be precise, the decoration length may be added to the sumCrossSize,
    // but we omit adding the decoration length because even without the decorator
    // length, it's guaranteed that calculation is done at least beyond the
    // needsCalcAmount
    // break;
}

luojt avatar Jun 19 '23 07:06 luojt

Having same problem , Is there any solution?

GowsalyaSubramanian0297 avatar Jul 27 '23 10:07 GowsalyaSubramanian0297