Back to project page circular-progress-button.
The source code is released under:
MIT License
If you think the Android project circular-progress-button listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dd.sample; // w ww . ja v a2 s . c om import com.dd.CircularProgressButton; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; /** * State Change Sample */ public class Sample3Activity extends Activity { public static void startThisActivity(Activity activity) { activity.startActivity(new Intent(activity, Sample3Activity.class)); } @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); } } }); } }