List of usage examples for android.widget ProgressBar startAnimation
public void startAnimation(Animation animation)
From source file:de.geeksfactory.opacclient.frontend.AccountEditActivity.java
public void setProgress(boolean show, boolean animate) { ProgressBar progress = (ProgressBar) findViewById(R.id.progressBar); View content = findViewById(R.id.svAccount); if (show) {/* ww w .ja va 2s.c om*/ if (animate) { progress.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_in)); content.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out)); } else { progress.clearAnimation(); content.clearAnimation(); } progress.setVisibility(View.VISIBLE); content.setVisibility(View.GONE); } else { if (animate) { progress.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out)); content.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_in)); } else { progress.clearAnimation(); content.clearAnimation(); } progress.setVisibility(View.GONE); content.setVisibility(View.VISIBLE); } }