AnimationSet is an Animation, just call startAnimation(set)... On Sun, Mar 15, 2009 at 9:02 PM, Nithin <[email protected]> wrote: > > Hi Romain, > > Now i am trying with AnimationSet, but still i cant move further, > > the code i am trying is, > > private void createAnim(Canvas canvas) { > AnimationSet set = new AnimationSet(true); > set.setInterpolator(new AccelerateDecelerateInterpolator()); > > anim = new RotateAnimation(0, 360, canvas.getWidth() / 2, canvas > .getHeight() / 2); > anim.setDuration(5000); > set.addAnimation(anim); > > anim2 = new TranslateAnimation( > Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, > Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f); > anim2.setDuration(5000); > set.addAnimation(anim2); > > set.setRepeatMode(AnimationSet.REVERSE); > set.setRepeatCount(AnimationSet.INFINITE); > > startAnimation(anim); > // startAnimation(anim2); > } > > If there is any method like startAnimation(AnimationSet), then it will > be easy... > > please guide me... > > Thanks > Nithin > > On Mar 13, 8:40 pm, Romain Guy <[email protected]> wrote: >> Hi, >> >> Use an AnimationSet :) >> >> >> >> On Fri, Mar 13, 2009 at 12:33 AM, Nithin <[email protected]> wrote: >> >> > Hi, >> >> > I am trying to create a arc movement(means both RotateAnimation and >> > TranslateAnimation required) for a bitmap. I can do either rotate or >> > translate movement, but i cant integrate both. >> >> > the code which i am trying for this is, >> >> > private void createAnim(Canvas canvas) { >> > anim = new RotateAnimation(0, 180, canvas.getWidth() / 2, >> > canvas >> > .getHeight() / 2); >> > anim2 = new TranslateAnimation( >> > Animation.RELATIVE_TO_SELF, 0.0f, >> > Animation.RELATIVE_TO_SELF, >> > 0.0f, >> > Animation.RELATIVE_TO_SELF, -1.0f, >> > Animation.RELATIVE_TO_SELF, 0.0f >> > ); >> > anim.setRepeatMode(Animation.REVERSE); >> > anim.setRepeatCount(Animation.INFINITE); >> > anim.setDuration(2500); >> > anim.setInterpolator(new >> > AccelerateDecelerateInterpolator()); >> >> > startAnimation(anim); >> > // startAnimation(anim2); >> > } >> >> > Please guide me in this.. >> >> > Thanks >> > Nithin >> >> -- >> Romain Guy >> Android framework engineer >> [email protected] >> >> Note: please don't send private questions to me, as I don't have time >> to provide private support. All such questions should be posted on >> public forums, where I and others can see and answer them > > >
-- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

