Hello,

I'm working on some text animation with 2 left and right buttons,
iterating through an array, and scrolling the text off of the screen
(so left button scrolls the text off the screen to the left, and vice-
versa).

The problem I'm finding, is that I want to keep the current text until
the animation has been completed, and _then_ change the text (next
item in the array), but the text seems to change first, and then
scroll.

Here's my XML for animation (R.anim.anim_left):
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android";
android:shareInterpolator="true" android:interpolator="@android:anim/
accelerate_interpolator">

    <translate android:fromXDelta="0"
               android:toXDelta="250"
               android:duration="400"
               android:fillAfter="false"/>
</set>

And the code for the button:
if (v == btnLeft) {
TextView animWindow = (TextView)findViewById(R.id.txtScroll);
Animation anim = AnimationUtils.loadAnimation(Main.this,
R.anim.anim_down);
animWindow.startAnimation(anim);

final ArrayAdapter<String> namesArray = new ArrayAdapter<String>
(Main.this, R.array.myArray, getResources().getStringArray
(R.array.myArray));
setListAdapter(Names);
Names -= 1;
txtNames.setText(namesArray.getItem(Names));
 }

Has anyone else experienced something similar to this, or have any
ideas?

Thanks much in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to