Using ViewPager with native snippets

It seems that a solution to this problem cannot be found. I am creating an Android application that uses fragments. So far I have been using native and not support libraries, because I am targeting the application on Nexus 7. However, I have no problem using the support library if it does not matter for development (did I read something about no ActionBar? )

My problem is that I want to have a snippet that fills half the screen and displays a type area with a tattoo. I want the user to be able to scroll left and right and show different fragments for each "page" (nested fragments that I know, but I read that they are now supported). Basically I want it to look like a Play Store when you browse Top Paid, Top Free, etc., Except that you occupy half the screen (which I achieve with the fragment), the other half of the screen is still one piece that I have already written. Another thing is that in each "page" (for example, Top Free, etc.) I want to have 2 ListViews.

Crude drawing of what I'm trying to achieve

However, it seems that the ViewPager component is only part of the support libraries, which, I think, means that I should change all of my fragments to supported ones. Is this the only way to achieve this layout? There should be an easier way; I saw something called a workspace in a Google I / O video before I suggested that it was a very common user interface design pattern.

thanks

+7
source share
2 answers

You want the ViewPager, and switching your snippets to library support, a very simple conversion.

And you probably want this for more customization :) http://viewpagerindicator.com/

-2
source

You can use ViewPager with your own fragments, there are adapters for it in the android.support.v13.app package. You will need a v13 support gang to use them.

But in any case, there may be advantages with using support fragments: A fragment or fragment of support?

+5
source

All Articles