1

I have an app that needs to display an agenda for the user. I have it set up so that your days are switched as you swipe left and right (via GestureSensor). The problem is it isn't animated like the Google calendar is. I have done some research into View switchers and such, but they all seem to require a finite number of views. The Google Calendar does it with unlimited switches of the dates so this must be possible.

Can anyone point me in the right direction as to how to create an animated change of views (and the ability to see the views move with your movements) for unlimited dates. I have some theories and would love some feedback.

2
  • I'm not into animations that much, but have you tried to search for any kind of view transitions (besides with ViewFlipper)? Aug 12, 2011 at 16:38
  • There are a couple of things I found, such as Gallery that may be able to be finessed into working. I just feel like there is/should be a cleaner way to do it, and am searching for that.
    – Ashterothi
    Aug 12, 2011 at 16:40

3 Answers 3

1

You can use the ViewAnimator class.

This works in a similar way to viewflipper but is more powerful.

* Update *

There's a new control called View Pager available as a compatibility pack. Check out the new article on Android Developer Blog

0

Take a look at this project on github - Greendroid , it is also having the apk in market. You can search in Android market and install it. Look at the pageview control.

1
  • This still only works with a limited number of views. One thing that I had thought about it create 3 views one active, one on each side and when a side one becomes the main view set it as the center and shift all three over one creating a new view as needed
    – Ashterothi
    Aug 12, 2011 at 17:07
0

You can use the ViewPager for that, but you have to increase the getCount() result +1 if you get to position getCount -1, then you are able to swipe to right indefinitely. to swipe to left, you coud start at position 1000 or something. i use that ViewPager, too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.