Advertisement
Guest User

Untitled

a guest
Feb 26th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1.  
  2. private void loadingAmin(final TextView loading) {
  3.  
  4. final Animation pokeLoadingAnim = new Animation() {
  5.  
  6. int step = 0;
  7.  
  8. @Override
  9. protected void applyTransformation(float interpolatedTime,
  10. Transformation t) {
  11. // TODO Auto-generated method stub
  12. super.applyTransformation(interpolatedTime, t);
  13. if (interpolatedTime == 0) {
  14. loading.setText("Loading");
  15. step = 1;
  16. }
  17. if ((interpolatedTime / 0.3) > step) {
  18. loading.setText(loading.getText() + ".");
  19. ++step;
  20. }
  21.  
  22. }
  23. };
  24. pokeLoadingAnim.setDuration(2000);
  25. pokeLoadingAnim.setRepeatCount(Animation.INFINITE);
  26. pokeLoadingAnim.setInterpolator(new LinearInterpolator());
  27. pokeLoadingAnim.setRepeatMode(Animation.RESTART);
  28. loading.startAnimation(pokeLoadingAnim);
  29. }
  30.  
  31. call this method
  32.  
  33.  
  34. TextView layout = (TextView) getView().findViewById(R.id.loading);
  35. loadingAmin(layout);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement