** in a nutshell: i want the scroll animation as shown in the gif, when the user swipes down/up it goes directly to the item, and its like a fling animation.
For the Date fragments, i guess its a horizontal
Recyclerview
.
What am looking as an answer is, a code example of the scroll animation, and a way to do the date thing, where i can auto populate the fragments based on the dates.
I've asked before about this and wmy question was not that clear. this app includes a swipe down/up style.
When u swipe down or up, the app doesnt let you swipe like a normal Scrollview, instead from the first touch (up for example) it navigates you to the next post.
Important note is the post/item in full size (item layout match_parent
?).
Also, every post has a date, and the app includes a calendar, when you swipe left or right, you navigates to dates and based on dates you get the posts.
What i want, hints or ways to do something like this. i'd love to provide a code but i've tried to draw the way up in my mind but couldn't think in of a logical way.
For fragments, i guess they're taking the now
date, and the oldest date in the post, and based on that they're making (looping) fragments, each fragment has to load a posts based on the date (query to the API which gives date as param?).
Anyway, here's a GIF of the app which explains what im talking about. Im going to setup a bounty for this question, as im eager to achieve such a feature like this in my app.
https://gfycat.com/JadedMenacingAmericanalligator
I have not tried this by myself but I would like to help may be this will do the work First use this library for the vertical scrolling one at a time https://github.com/lsjwzh/RecyclerViewPager or may be this one https://github.com/castorflex/VerticalViewPager
or may be use the pagersnaphelper of v7 support library like this
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
SnapHelper snapHelper = new PagerSnapHelper();
snapHelper.attachToRecyclerView(recyclerView);
and for the horizontal scrolling you can use these libraries may be if you apply little bit of logic you will achieve it.
https://medium.com/@ali.muzaffar/looping-infinite-viewpager-with-page-indicator-in-android-ce741f25702a
https://github.com/antonyt/InfiniteViewPager
Changing ViewPager to enable infinite page scrolling
let me know if it works.
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