blipinsk / FlippableStackView

An Android library introducing a stack of Views with the first item being flippable.
Apache License 2.0
809 stars 150 forks source link

Display the elements in normal order #11

Closed adrielcafe closed 8 years ago

adrielcafe commented 8 years ago

Hi @blipinsk! The current implementation display the elements in reverse order. It`s possible to display in normal order?

I`m having problem when trying to paging an List<> used in adapter. I'm trying to add new elements on start of the list so they can show on bottom. But what happens is strange: when I reach the end of first page, the new elements are inserted on top of stack, not on the bottom.

I tried to implement normal order on FlippableStackView but was not successful. You know how I can do this?

Thanks!

blipinsk commented 8 years ago

Hi @adrielcafe!

Take a look at the FlippableStackView.java. At the setAdapter method to be exact. That's where the "reverse order" is being applied.

You can copy the whole code of the FlippableStackView and just skip the overriding of the setAdapter method.

adrielcafe commented 8 years ago

Wow, that was a fast response :)

I'v tried this. The first element appears on bottom and I've need to back (swipe up gesture) to see other elements.

I wanted it to be like the original version: the first element appears at the top of the list and to see the other elements I use the swipe down gesture.

blipinsk commented 8 years ago

Then I think it's just a matter of setting the right order of things in your adapter (adding items in the end or at the beginning of your data) and setting current item on the adapter.

adrielcafe commented 8 years ago

Ok, thanks again!