Sliding views in the same activity

glbproject

New member
Sep 11, 2015
1
0
0
Hi everybody!
First of all I want to excuse me if I ask something that seems easy to you, but I'm a beginner developer.

I'm developing an app and I would like to slide beetween views in the same activity:

Code:
<LinearLayout ... orientation:horizontal>
      <LinearLayout L1>
      </LinearLayout>
      <LinearLayout L2>
      </LinearLayout>
      <LinearLayout L3>
      </LinearLayout>
      <LinearLayout L4>
      </LinearLayout>
</LinearLayout>

In the activity I'll want to show L1 in the center and sliding left I will show L2 (that is out of screen, then, when in the center, L1 disappear to left) .. and so on sliding left or right

Anyone could suggest me a way to do this ? (hope it's clear :( )
Thanks
 
There is a widget called ViewPager having exactly your use case. You can refer to the documentation, it's not so hard to implement.
 

Latest posts

Trending Posts

Forum statistics

Threads
957,079
Messages
6,971,378
Members
3,163,708
Latest member
Ariwenni15