Thursday, November 25, 2010

Android wheel update: animation

The wheel widget has been updated. There has been added the main feature - animation.
Now it is possible to scroll the wheel automatically by using the finger fling.
In the same way there is the ability to scroll the wheel programmatically by using next methods:
  • void setCurrentItem(int index, boolean animated) - scrolls to specified items if animated is true
  • void scroll(int itemsToScroll, int time) - scrolls up/down by itemsToScroll items
The main feature that is not implemented at this moment is custom views for wheel items. It will be implemented soon.


  1. This is really cool! I had a peek at your code and must congratulate you on your implementation! Very nice!

    Do you think it would be difficult to use something more complex than just text as item contents? I'd be willing to help develop a solution that uses images with different content styling and positioning. Any pointers on how to do this?

    Thanks for putting this up on google code!

  2. Hi Anonymous,

    It is planned to use custom views for wheel items, like in ListView control. I'm going to implement new wheel adapter for that.

  3. I have found this blog this morning and i'm still surprissed. I would like to implement this whell using an image instead of text.

    I have seen that you are implementing this feature. I would like to know if there is an estimate release date for this.

    If you need help do not estitate mail me, but i think that here... you are the master so i will be unhelpful.


  4. Hi Kenzilab,
    It's going to be done till Christmas holidays (22-24 Dec).

    Actually, it was a simple wheel with text items, just a draft. So, I didn't planned at that time to do some hard work for custom View supporting.
    But time to to time I update this widget and see that it should support some additional functionality. And I try to make it as good and useful as possible :)

  5. You are doing a great great job! Well done!

  6. Hi Kankan, thanx for a great component!

    The question is how do implement animation in tearms of frame rate? In other words, How many cycles is performed per second or how do you specify the delay between draws?

  7. Actually I dont specify the delay between draws. There is used a Handler that performs motion routines and initiates the drawing if the wheel is rotated.
    So, the rate depends on the system. I'm not sure it is a great idea to repaint the view so often, but at this moment I dont have any performance issues.