0

I am beginner to android. I want to learn how to implement the following. Check this image:

enter image description here

Here is what i want to implement:

As shown in figure, i need to swipe listview from left - to - right and viceversa. I have to display some data according to date. When this activity starts, the list items are shown according to current date. If i swipe the listview from right to left then tommorrows date should be displayed in the date tab and the data set of the listview should now contain the items of tommorrows date.

Similarly, when swiping from left to right, previous date should be shown and the data related to previous date is to be listed in the listview.

My applicaion has minimum sdk of android 2.2

Please help me implement this. Thanks in advance.

ASP
  • 3,645
  • 1
  • 31
  • 45
Chintan Soni
  • 24,761
  • 25
  • 106
  • 174

2 Answers2

1

Use ViewPager depending on your needs.....check out..

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

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

https://github.com/JakeWharton/Android-ViewPagerIndicator

there are lot of tutorials......

ASP
  • 3,645
  • 1
  • 31
  • 45
  • I had a glance over your references you suggested, it seems that it will take much time to learn this. But i'll do it. Anyhow... :) Thanks once again. It is of worth implementing this. – Chintan Soni May 21 '13 at 04:22
  • You are welcome....:)...it seems tough but its really easy to implement...thanks to the developers and contributors. also try actionbarsherlock to get a beautiful combination... – ASP May 21 '13 at 04:28
1

all you need is a GestureDetector http://developer.android.com/reference/android/view/GestureDetector.html

pskink
  • 23,874
  • 6
  • 66
  • 77
  • Is this the only thing i need to implement, as i googled and i found that most of them used ViewPager. Can u give me sample code ? – Chintan Soni May 21 '13 at 04:24