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

LayoutManager: clipToPadding=false is buggy

Open saket opened this issue 7 years ago • 12 comments

Is it a known issue that items that aren't fully visible don't show up when they're within the padding area and clipToPadding is set to false with a certain padding amount?

saket avatar Apr 16 '17 15:04 saket

No it's not a known issue. Do you have a code that can reproduce the issue? Thanks in advance.

thagikura avatar Apr 17 '17 06:04 thagikura

Sure, I will try sending a sample project to help you reproduce this.

saket avatar Apr 18 '17 08:04 saket

I have the same problem

To reproduce use a RecyclerView. The important part is that you turn off clipToPadding and set a padding at bottom.

    <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_az_content"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginRight="8dp"
            app:layout_constraintRight_toRightOf="parent"
            android:layout_marginLeft="8dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            android:layout_marginTop="8dp"
            app:layout_constraintTop_toBottomOf="@+id/recycler_az"
            app:layout_constraintBottom_toBottomOf="parent"
            android:clipToPadding="false"
            android:paddingBottom="64dp"
            android:layout_marginBottom="0dp"/>

Here I set clipToPadding = false and botomPadding of 64dp

The I use

        FlexboxLayoutManager flexLayoutManager = new FlexboxLayoutManager(context);
        flexLayoutManager.setFlexDirection(FlexDirection.ROW);
        recyclerAZcontent.setLayoutManager(flexLayoutManager);

Normally the Recycler should draw its items also in the padding area. The FlexBoxLayoutManager is drawing when the item moves out of padding area. So the effect is that items suddenly appear.

matecode avatar Oct 04 '17 15:10 matecode

For better understanding i recorded a little video. If you look at the bottom recyclerview, you can see item appearing suddenly when i scroll down, but they keep drawn when recycler is moved up again ezgif-4-d38b7b0ba1

matecode avatar Oct 04 '17 15:10 matecode

Thanks for the video. Looks like this is because FlexboxLayoutManager doesn't support predictive item animations yet (example).

I tried to implement it, but haven't completed it. Let me keep this open for until we implement it.

thagikura avatar Oct 04 '17 22:10 thagikura

Any news on this topic?

matecode avatar Nov 09 '17 10:11 matecode

Any news? Having the same problem.

gregkorossy avatar Dec 30 '17 16:12 gregkorossy

I have the same problem.

Samuel-Unknown avatar Feb 13 '18 12:02 Samuel-Unknown

I get a similar problem though at the top when using this in conjunction with a coordinator layout. I have padding atop the RecyclerView, scrolling down is fine but when I return to the top the recycler doesn't redraw any of the top items while they'd be within the padding.

@thagikura I'm not sure I quite understand why this is related to predictive item animations? It would appear it simply isn't actively loading items that would exist within the padding area.

GeoffGodwin avatar Oct 07 '18 13:10 GeoffGodwin

Any news? Having the same problem.

RadiationX avatar Nov 01 '18 12:11 RadiationX

after 2 years, any news ?

1240 avatar Feb 01 '21 14:02 1240

I have the same problem, RecyclerView + FlexLayoutManager inside ConstraintLayout and clipToPadding not work at first show. I changed layout_height from 0dp to wrap_content then it works

trinhcu18 avatar May 13 '21 02:05 trinhcu18

I have the same problem.

Qhash avatar Jul 04 '23 19:07 Qhash