twoway-view icon indicating copy to clipboard operation
twoway-view copied to clipboard

Padding problem

Open quentin23soleil opened this issue 10 years ago • 13 comments

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.

quentin23soleil avatar Oct 27 '14 08:10 quentin23soleil

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

lucasr avatar Oct 27 '14 10:10 lucasr

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

I'm using ListLayoutManager

quentin23soleil avatar Oct 27 '14 10:10 quentin23soleil

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

lucasr avatar Oct 27 '14 11:10 lucasr

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

quentin23soleil avatar Oct 27 '14 11:10 quentin23soleil

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.

codelabr avatar Oct 27 '14 16:10 codelabr

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

lucasr avatar Oct 28 '14 10:10 lucasr

Cheers,

if you need any help, ping me ;)

quentin23soleil avatar Oct 28 '14 10:10 quentin23soleil

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

ChristopheVersieux avatar Oct 29 '14 06:10 ChristopheVersieux

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

codelabr avatar Oct 29 '14 06:10 codelabr

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.

ened avatar Nov 03 '14 03:11 ened

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

Denvar avatar Nov 14 '14 15:11 Denvar

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

0legg avatar Nov 14 '14 20:11 0legg

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.

aqeel-hashim avatar Dec 15 '16 09:12 aqeel-hashim