how to move marquee text from right to left and left and right by clicking one button, how can i do this can any one help me?
Try this;
Animation animationToLeft = new TranslateAnimation(400, -400, 0, 0);
animationToLeft.setDuration(12000);
animationToLeft.setRepeatMode(Animation.RESTART);
animationToLeft.setRepeatCount(Animation.INFINITE);
Animation animationToRight = new TranslateAnimation(-400,400, 0, 0);
animationToRight.setDuration(12000);
animationToRight.setRepeatMode(Animation.RESTART);
animationToRight.setRepeatCount(Animation.INFINITE);
TextView textViewMarqToLeft = (TextView) findViewById(R.id.textViewMarqToLeft);
TextView textViewMarqToRight = (TextView) findViewById(R.id.textViewMarqToRight);
textViewMarqToLeft.setAnimation(animationToLeft);
textViewMarqToRight.setAnimation(animationToRight);
String textLeft = "Left marquue"
String textRight = "Right marquue"
textViewMarqToLeft.setText(textLeft);
textViewMarqToRight.setText(textRight);