Example usage for android.widget ProgressBar setAlpha

List of usage examples for android.widget ProgressBar setAlpha

Introduction

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

Prototype

public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) 

Source Link

Document

Sets the opacity of the view to a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque.

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