[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-18 Thread Mark Murphy
skink wrote: >> Of course, it now dawns on me that the padding probably gets rotated >> too, so I'm leaning more toward using shims or something to set my position. > > well, padding is imho shim here, so if you don't use > android:background in your ImageView, padding is 'transparent' and it > j

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-18 Thread skink
> Of course, it now dawns on me that the padding probably gets rotated > too, so I'm leaning more toward using shims or something to set my position. well, padding is imho shim here, so if you don't use android:background in your ImageView, padding is 'transparent' and it just works fine - you w

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-18 Thread Mark Murphy
Romain Guy wrote: > There is absolutely no need to do all these fancy computations > yourself. Instead you can use the following constructor (or better > yet, define the animation in XML): > > RotateAnimation(float fromDegrees, float toDegrees, int pivotXType, > float pivotXValue, int pivotYType,

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-18 Thread Mark Murphy
skink wrote: > ok, i found it. > > animation stuff works OK: it rotates tho whole view (not image > bounds), run hierarchyviewer and > you'll see that pivot is ok. > > if you try to rotate image itself, try this > > ImageView iv = (ImageView) findViewById(R.id.iv); > Matrix matrix = iv.getImage

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-18 Thread Romain Guy
Hi, There is absolutely no need to do all these fancy computations yourself. Instead you can use the following constructor (or better yet, define the animation in XML): RotateAnimation(float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) Here

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-18 Thread skink
Mark Murphy wrote: > Rotate with unknown pivot. If you're seeing a rotation around the center > point of the View with the parameters I gave you, then obviously there's > something a wee bit off with my View. > > Hmmm...I have paddingRight and paddingTop values in the layout for this > ImageView

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-17 Thread Mark Murphy
skink wrote: > i tested RotateAnimation with params you provided and it works > perfectly (i rotated LinearLayout). What is bad behaviour at your > side? does it rotate at all? or rotates but with unknown pivot? Rotate with unknown pivot. If you're seeing a rotation around the center point of the

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-17 Thread skink
also what is your after calling ctor looks like? somethig like this? View v = obtain_view_of_interest(); Animation animation = animation.setDuration(1000); v.startAnimation(animation); --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[android-developers] Re: RotateAnimation, pivoting about the center

2009-01-17 Thread skink
Mark Murphy napisaƂ(a): > I have a 21x21 pixel image that I would like to animate about the center > of the image. > > I would think that this would be correct: > > new RotateAnimation(0f, 360f, > Animation.RELATIVE_TO_SELF, 0.5f, > Animation.RELATIVE_