Search in sources :

Example 1 with CircularProgressButton

use of com.dd.CircularProgressButton in project circular-progress-button by dmytrodanylyk.

the class Sample3Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_3);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.StateChangeSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(100);
            } else {
                circularButton1.setProgress(0);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(-1);
            } else {
                circularButton2.setProgress(0);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 2 with CircularProgressButton

use of com.dd.CircularProgressButton in project circular-progress-button by dmytrodanylyk.

the class Sample4Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_4);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.ProgressPaddingSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(50);
            } else if (circularButton1.getProgress() == 100) {
                circularButton1.setProgress(0);
            } else {
                circularButton1.setProgress(100);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(true);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(50);
            } else if (circularButton2.getProgress() == -1) {
                circularButton2.setProgress(0);
            } else {
                circularButton2.setProgress(-1);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 3 with CircularProgressButton

use of com.dd.CircularProgressButton in project circular-progress-button by dmytrodanylyk.

the class Sample5Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_5);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.CustomSelectorSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(50);
            } else if (circularButton1.getProgress() == 100) {
                circularButton1.setProgress(0);
            } else {
                circularButton1.setProgress(100);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(true);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(50);
            } else if (circularButton2.getProgress() == -1) {
                circularButton2.setProgress(0);
            } else {
                circularButton2.setProgress(-1);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 4 with CircularProgressButton

use of com.dd.CircularProgressButton in project circular-progress-button by dmytrodanylyk.

the class Sample1Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_1);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.IndeterminateProgressSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(50);
            } else if (circularButton1.getProgress() == 100) {
                circularButton1.setProgress(0);
            } else {
                circularButton1.setProgress(100);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(true);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(50);
            } else if (circularButton2.getProgress() == -1) {
                circularButton2.setProgress(0);
            } else {
                circularButton2.setProgress(-1);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 5 with CircularProgressButton

use of com.dd.CircularProgressButton in project circular-progress-button by dmytrodanylyk.

the class Sample2Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_2);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.IntegerProgressSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                simulateSuccessProgress(circularButton1);
            } else {
                circularButton1.setProgress(0);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                simulateErrorProgress(circularButton2);
            } else {
                circularButton2.setProgress(0);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Aggregations

ActionBar (android.app.ActionBar)5 View (android.view.View)5 CircularProgressButton (com.dd.CircularProgressButton)5