I have 3 fragments, but 2 of them are out of the screen's edge

243 views Asked by At

I'm developing something like a ViewPager, but I do not know the accurate count of the elements.
I know only one element, which I should load immediately. Simultaneously I should load data to right and left fragment (I'm loading left and right side from server based on visible fragment).
So the user can swipe either left or right (as with typical ViewPager) and I dynamically determine which data I should load.

It looks like https://i.stack.imgur.com/X2fti.png

In theory, I should create such pseudo methods:

void loadLeftFragment(MainFragmentData);
void loadRightFragment(MainFragmentData)
void loadMainFragment();

Moreover, I should listen for right and left swipe gestures and load the data into all the Fragments according to the swipe.
In addition, this process should have some animation.

So, can you give some idea on how to create this or where I can read/see any appropriate information?

0

There are 0 answers