lucasr / twoway-view

[DEPRECATED] RecyclerView made simple
5.23k stars 1.02k forks source link

Padding problem #140

Open quentin23soleil opened 9 years ago

quentin23soleil commented 9 years ago

Hey,

I use a TwoWayView withing a viewpager and when I apply a padding top and I swipe up to get to the top of the list it adds a padding again and again.

lucasr commented 9 years ago

@dommerq You mean scrolling down then back to the top? What layout manager are you using?

quentin23soleil commented 9 years ago

When my two-way view is at the top, and I scroll up, it adds padding

I'm using ListLayoutManager

lucasr commented 9 years ago

Do you mean you wanted something like the clipToPadding="false" behaviour that you get from ListView? This will be covered in #93.

quentin23soleil commented 9 years ago

No, what I'm describing is a bug, not a missing feature :) It adds padding when I'm scrolling up

codelabr commented 9 years ago

I have the same issue. Scrolling down then back up, padding keeps added to the view and when the padding exceeds the screen size, the view disappears.

lucasr commented 9 years ago

@dommerq Got it, I'll look into it Thanks for the report.

quentin23soleil commented 9 years ago

Cheers,

if you need any help, ping me ;)

ChristopheVersieux commented 9 years ago

I can confirm and send code to reproduce. For me, the bug only appeared (or is worst) when I started using app compat 21.

codelabr commented 9 years ago

@lucasr could you help fix this soon? would greatly appreciate.

ened commented 9 years ago

Similar issue here, when using TwoWayView configured like this:

<TwoWayView
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="444dp"
            android:clipToPadding="false"
            android:layout_marginTop="32dp"
            android:paddingStart="20dp"
            android:paddingEnd="20dp"
            android:overScrollMode="never"
            android:orientation="horizontal"
            app:twowayview_layoutManager="SpannableGridLayoutManager"
            app:twowayview_numRows="2"
            />

Whenever data is being added to the adapter (content provider changes), the padding seems to be added to the "start" side.

AppCompat v21.

Denvar commented 9 years ago

I have the same issue but am not setting padding:

    <org.lucasr.twowayview.widget.TwoWayView
        android:id="@+id/gallery_grid_layout"
        android:layout_below="@+id/etoolbar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#ffffff"
        android:layout_marginRight="2dp"
        android:layout_marginLeft="2dp"
        app:twowayview_layoutManager="GridLayoutManager"
        app:twowayview_numColumns="3" />

Also using AppCompat v21

Video of the issue: https://vid.me/ntVs

When I trigger this issue I notice that it happens when scrolling, where newly added items causes the grid to "snap" so that the first row of items on the screen are fully visible. This "movement" seems to be tied to the extra spacing when scrolled back to the top of the grid.

Actually this could be a separate issue

0legg commented 9 years ago

As far as I've discovered, this behavior can be reproduced when using items that call repaint during scroll.

Example: I have a list of pictures that are downloaded from internet. I scroll to the screen which have no "cached" pictures on it, so they're starting to download. If first visible view on screen needs to be repainted and it's not fully shown now, it'll scroll all the content down/right, so it'll be in the screen, at the very beginning of TwoWayView. This leads us to list flicking, also it affects top padding.

Maybe, it's also the source of https://github.com/lucasr/twoway-view/issues/156 problem

You can try fix proposed in https://github.com/lucasr/twoway-view/pull/167, at least it have fixed issue for me

aqeel-hashim commented 7 years ago

I am facing this same issues. I am using picasso to load the images from the internet and its causing the padding issue. Will there be fix of this in future.