Example usage for android.widget ProgressBar animate

List of usage examples for android.widget ProgressBar animate

Introduction

In this page you can find the example usage for android.widget ProgressBar animate.

Prototype

public ViewPropertyAnimator animate() 

Source Link

Document

This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View.

Usage

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);
}