Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a swipe-gesture between Fragments?

I would like to implement in my android app that I'm developing with the Android studio ide. The swipe between the different tabs (fragment). I tried searching online and on StackOverflow but I could not quite understand. My action bar is the classic one that works with Android above 3.0 If you can give me some advice or examples of aid etc. I shall be very grateful. With this I thank you.

like image 487
lillogoal Avatar asked Sep 03 '13 11:09

lillogoal


1 Answers

I suppose the Android ViewPager is what you are looking for:

http://developer.android.com/reference/android/support/v4/view/ViewPager.html

Here is a nice tutorial on how to implement it:

http://developer.android.com/training/animation/screen-slide.html

The basic idea is that you have multiple Fragments, each representing a different Screen. The ViewPager enables the user to swipe between the different Fragments and display different content.

Also take a look at this question:

How to implement a ViewPager with different Fragments / Layouts

And how to include the Support-Library: http://developer.android.com/tools/support-library/setup.html

like image 91
Philipp Jahoda Avatar answered Oct 06 '22 23:10

Philipp Jahoda