public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vitesse);
gpsManager = new GPSManager();
Android gives you elegant mechanisms to represent the loading process. You could use an indeterminate ProgressBar
, or an ImageView
with a scale/alpha animation, instead of animating the TextView
itself.
Maybe you might find this animation useful, for animating alpha and scale at the same time. Vary the parameters for your preference:
file R.anim.alpha_scale_animation
then to launch it in your code:
Animation connectingAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.alpha_scale_animation);
myView.startAnimation(connectingAnimation);
And to stop it:
myView.clearAnimation();
connectingAnimation.cancel();
connectingAnimation.reset();
You can also use libraries like ProgressButtonView to have both user interaction and loading process supported in the same widget.
Hope that any of these solutions result useful to someone :)