List of usage examples for android.widget ProgressBar animate
public ViewPropertyAnimator animate()
From source file:com.z299studio.pb.HomeActivity.java
private void startSync(boolean animationOn) { Resources r = getResources(); int strRes[] = { R.string.sync_none, R.string.sync_gpg, R.string.sync_gdrive }; mButtonContainer = findViewById(R.id.btn_container); if (animationOn) { mButtonContainer.animate().scaleY(0.0f).setListener(this); } else {/*w w w . j a v a2 s. c o m*/ mButtonContainer.setVisibility(View.INVISIBLE); } mSyncText = (TextView) findViewById(R.id.sync_hint); mSyncText.setText(r.getString(R.string.contacting, r.getString(strRes[Application.Options.mSync]))); ProgressBar pb = (ProgressBar) findViewById(R.id.pb); if (animationOn) { pb.animate().alpha(1.0f).setStartDelay(300); mSyncText.animate().alpha(1.0f).setStartDelay(300); } else { pb.setAlpha(1.0f); mSyncText.setAlpha(1.0f); } SyncService ss = SyncService.getInstance(this, Application.Options.mSync); ss.initialize().setListener(this).connect(0); }