I am using Twowayview in one of my projects. Which is an extension of androids Recyclerview library. (Having features like vertical horizontal staggered, spannable grid and listviews).Sometimes the items in the gridview disappears when scrolling (ie, It automatically adding padding each time it scrolls and atlast all items scroll to the side we scrolled). It was a random behavior not experiencing every time.
Watch this video, Recyclerview scroll issue
Please find additional reference about this issue on this link below,
Padding problem #140
This auto padding issue mostly occur when we add or remove the adapter with new items.
Please find the widget i have used below with the attributes
<org.lucasr.twowayview.TwoWayView
android:id="@+id/spannable_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animationCache="false"
android:scrollbarAlwaysDrawHorizontalTrack="false"
android:scrollbarSize="0px"
android:scrollbars="none"
android:scrollingCache="false"
app:layoutManager="SpannableGridLayoutManager"
app:numColumn="6"
app:numRow="6" />
I found some solutions like remove the padding from Twowayview, CliptoPadding , etc. But none of these working for me. I am using Recyclerview version 21.0.0. Anybody experiencing this issue ?. How to solve this issue ?
I'm reposting the answer by Ish
First of all keep you must use code of TwoWay-View library not jar.
if (anchorItemPosition > 0 && (refreshingLanes || !restoringLanes)) {
replace this line by this one
if (anchorItemPosition > 0 && refreshingLanes && !restoringLanes) { Above change in BaseLayoutManager class work for me as a solution to above mentioned issues.
Hope this will help you all TwoWay-View users.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With