1

I'm creating an app that uses a disk to browse files and such, like this: http://dl.dropbox.com/u/8051037/disk_ab1.png

I want to make it be able to spin as the user turns it, and I know I need to use a RotateAnimation, but I can't figure out how to make it follow the finger.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
c0dege3k
  • 67
  • 1
  • 10

1 Answers1

1

I think you should use a custom view, see this examle which rotates a ball: How can I use the animation framework inside the canvas?

then you can use motion event to control the angle of rotation: Android firing onTouch event for multiple ImageViews

Custom view can be transparent so you can combine it with other veiws in your layout.

Community
  • 1
  • 1
Lumis
  • 21,517
  • 8
  • 63
  • 67
  • Ok, i get the motion event thing, but I don't fully understand what I'm supposed to get out of the custom view sample. – c0dege3k Mar 21 '11 at 17:52
  • Here is another example with a custom view, where a circle is drawn. All you need is to draw your own wheel and then animate it when finger touches the screen: http://about-android.blogspot.com/2010/07/2d-graphics-with-effects_11.html Of course there are always different solutions, and you may come with your own, but it is good to understand how these examples work. – Lumis Mar 21 '11 at 22:09