How can I implement the header view + sliding pager on the tab + pager view, like a Fancy app?

I am wondering how Fancy ( https://play.google.com/store/apps/details?id=com.thefancy.app ) implements this view. The images below are displayed on the seller’s page of the Fancy app.

First, it looks like a header + a sliding tab + a viewing panel containing fragments. If the user scrolls the view, the title will disappear smoothly, and then, finally, the user can only see the title of the pager and view the pager.

I am trying to implement a similar function using PagerSlidingTabStrip( https://github.com/astuetz/PagerSlidingTabStrip ) and ViewPagerc FragmentStatePagerAdaptercontains several fragments using StaggeredGridViewEtsy. ( https://github.com/etsy/AndroidStaggeredGrid )

To implement this function, I assume that I need to use OnScrollListenerfor StaggeredGridView, but there are few problems.

The first is a way to deliver the scroll event to the main action. The process of transmitting a scroll event: StaggeredGridView→ FragmentStatePagerAdapter→ MainActivity. This is a long way to make it smooth scroll. Also, I'm not sure if the parameters from the scroll event are enough to implement this.

public void onScroll(final AbsListView view, final int firstVisibleItem, 
        final int visibleItemCount, final int totalItemCount) {

(onScroll , .)

, otto (https://github.com/square/otto), , .

, + listview (http://flavienlaurent.com/blog/2013/11/20/making-your-action-bar-not-boring/), , , Fancy.

, , ? , ? .

.

At the first time

Slide down

When sliding is finished

+4

Source: https://habr.com/ru/post/1545705/


All Articles