Search in sources :

Example 1 with ProgressBar

use of carbon.widget.ProgressBar in project Carbon by ZieIony.

the class CircularProgressActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_circular_progress);
    final ProgressBar progress1 = (ProgressBar) findViewById(R.id.progress1);
    final Handler handler = new Handler();
    Runnable runnable = new Runnable() {

        @Override
        public void run() {
            progress1.setProgress((float) (progress1.getProgress() + Math.random() / 100));
            if (progress1.getProgress() < 1) {
                handler.postDelayed(this, 10);
            } else {
                progress1.setVisibility(View.INVISIBLE);
            }
        }
    };
    findViewById(R.id.button1).setOnClickListener(view -> progress1.setVisibility(progress1.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));
    final View progress2 = findViewById(R.id.progress2);
    findViewById(R.id.button2).setOnClickListener(view -> progress2.setVisibility(progress2.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));
    final View progress3 = findViewById(R.id.progress3);
    findViewById(R.id.button3).setOnClickListener(view -> progress3.setVisibility(progress3.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));
    final View progress4 = findViewById(R.id.progress4);
    findViewById(R.id.button4).setOnClickListener(view -> progress4.setVisibility(progress4.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));
    handler.postDelayed(runnable, 10);
}
Also used : Handler(android.os.Handler) ProgressBar(carbon.widget.ProgressBar) View(android.view.View)

Example 2 with ProgressBar

use of carbon.widget.ProgressBar in project Carbon by ZieIony.

the class ProgressBarsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_progress_bars);
    final View progress1 = findViewById(R.id.progress5);
    findViewById(R.id.button1).setOnClickListener(view -> progress1.setVisibility(progress1.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));
    final ProgressBar progress2 = (ProgressBar) findViewById(R.id.progress6);
    final Handler handler = new Handler();
    Runnable runnable = new Runnable() {

        @Override
        public void run() {
            progress2.setProgress((float) (progress2.getProgress() + Math.random() / 100));
            if (progress2.getProgress() < 1) {
                handler.postDelayed(this, 10);
            } else {
                progress2.setVisibility(View.INVISIBLE);
            }
        }
    };
    findViewById(R.id.button2).setOnClickListener(view -> progress2.setVisibility(progress2.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));
    final View progress3 = findViewById(R.id.progress7);
    findViewById(R.id.button3).setOnClickListener(view -> progress3.setVisibility(progress3.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));
    handler.postDelayed(runnable, 10);
}
Also used : Handler(android.os.Handler) View(android.view.View) ProgressBar(carbon.widget.ProgressBar)

Example 3 with ProgressBar

use of carbon.widget.ProgressBar in project Carbon by ZieIony.

the class ButtonsUsageActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_buttonsusage);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setIconVisible(true);
    ProgressBar progress = (ProgressBar) findViewById(R.id.progress);
    progress.setProgress(0.8f);
}
Also used : ProgressBar(carbon.widget.ProgressBar) Toolbar(carbon.widget.Toolbar)

Aggregations

ProgressBar (carbon.widget.ProgressBar)3 Handler (android.os.Handler)2 View (android.view.View)2 Toolbar (carbon.widget.Toolbar)1