Advertisement
Guest User

Anim textview android

a guest
Jun 10th, 2014
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1.  
  2. animToast = AnimationUtils.loadAnimation(context, R.anim.toast);
  3.         animToast.setAnimationListener(new Animation.AnimationListener() {
  4.  
  5.             @Override
  6.             public void onAnimationStart(Animation p1) {
  7.             }
  8.  
  9.             @Override
  10.             public void onAnimationEnd(Animation p1) {
  11.                 toastText.setVisibility(View.GONE);
  12.             }
  13.  
  14.             @Override
  15.             public void onAnimationRepeat(Animation p1) {
  16.             }
  17.         });
  18.  
  19. ---Сама анимация
  20.  
  21. toastText.setTextColor(unit.getColor());
  22. toastText.setVisibility(View.VISIBLE);
  23. toastText.setX(e.getX() - toastText.getWidth() / 2);
  24. toastText.setY(e.getY());
  25. toastText.startAnimation(animToast);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement