Development Android studio [closed]

-7

What function do I use to get a credit animation, where the letters will flow in front of the screen, in the case of the bottom up?

    
asked by anonymous 05.07.2017 / 16:35

1 answer

0

J Matthew. I'll explain quickly the logic of how I did it. I created a timer that 50 out of 50 or 150 out of 150, which would draw the text / credits down the position.

The code would be something like this:

public static void main(String[] args) {
  int X,Y;

  TimerTask mudarCreditos= new TimerScheduleFixedRateDelay();
  Timer tempo = new Timer();

  tempo.scheduleAtFixedRate(tasknew,tempo para começar pode ser 0,tempo para repetir 150);      
  }
// este metodo é o que vai acontecer de 150 em 150 ms
  public void run() {
  //diminuir 20px de cada vez pode ser o Y ou ambos
  //X-=20;
  Y-=20; 
  TextView txtView = (TextView) findViewById(R.id.textView);
  txtView.setX(X);
  txtView.setY(Y);
  //Invalidate serve para redesenhar
  invalidate();
   }    

How you will invalidate and objects will depend on whether you will be using an XML layout or a programmable layout.

I hope I have helped

    
05.07.2017 / 16:47