Just to clarify, if I change
view.clock.startAnimation(AnimationUtils.loadAnimation(
MainActivity.this,
R.anim.rotate));
to:
view.startAnimation(AnimationUtils.loadAnimation(
MainActivity.this,
R.anim.rotate));
Then the animation plays, but for the whole view, which isn't what I
want
On Dec 29, 7:24 pm, Seb <[email protected]> wrote:
> Hi, I tried it but it doesn't seem to work :( Here's my code in the
> view that triggers the thread code in the activity:
>
> case MotionEvent.ACTION_DOWN:
> currentTouchIndex = checkForSquareTouch(X, Y);
>
> if (currentTouchIndex >= 0)
> {
> ((MainActivity) this.getContext())
>
> .playSquareAnimation(currentTouchIndex);
>
> Activity code:
>
> public void playSquareAnimation(int currentTouchIndex)
> {
> ranim = AnimationUtils.loadAnimation(this, R.anim.rotate);
> // view.squares[currentTouchIndex].startAnimation(ranim);
>
> runOnUiThread(new Runnable()
> {
>
> public void run()
> {
>
>
> view.clock.startAnimation(AnimationUtils.loadAnimation(
> MainActivity.this,
> R.anim.rotate));
> }
> });
> }
>
> Any ideas?
>
> Do you think my view's onDraw() method is messing around with theanimation?
>
> On Dec 28, 5:14 am, AlexBonel <[email protected]> wrote:
>
>
>
>
>
>
>
> > On 28 дек, 00:56, Seb <[email protected]> wrote:
>
> > > Hmm I kind of understand... are you able to provide any code or psuedo
> > > code though to show how it would fit together?
> > > On Dec 25, 5:08 pm, AlexBonel <[email protected]> wrote:
>
> > For example:
>
> > public class MyActivity extends Activity {
>
> > private GameView mGameView;
>
> > @Override
> > protected void onCreate(Bundle savedInstanceState) {
> > super.onCreate(savedInstanceState);
> > ......
> > // Deffinition of your Activity
> > ......
> > // somewhere (for example in some View.OnXXXListener
> > implementation)
> > runOnUiThread(
> > new Runnable() {
>
> > @Override
> > public void run() {
>
> > mGameView.startAnimation(AnimationUtils.loadAnimation(MyActivity.this,
> > R.anim.my_animation));
> > }
> > }
> > );
> > }
>
> > }
>
> > Is it clear?
--
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