I am doing for custom circular progress wheel. here what i need for, once the progress wheel finish it hundred percent progress. then , when i click again,i need to change the progressing color at runtime...
I downloaded code from this link.. https://github.com/Todd-Davies/ProgressWheel
note : I click on a button, the progress starts progressing. that progress bar circle already one color. After the progress complete 100%, I want it to start again, that time , i need to change the color to be red runtimely...
I tried this link also.. this link is for having for default progress bar. but, i am using for custom progress bar.thats why, i cant used this method like... http://myandroidsolutions.blogspot.in/2012/11/android-change-indeterminate-progress.html http://www.tiemenschut.com/how-to-customize-android-progress-bars/
can anyone help me to complete this task.. Thanks Advance....
my code : onCreate Method:
increment.setOnClickListener(new OnClickListener() {
@SuppressLint("WrongCall")
public void onClick(View v) {
Log.v("test", "-----increment button clicked--------");
if(!running) {
progress1 = (int) 370 ;
Thread s = new Thread(r);
s.start();
}
}
});
final Runnable r = new Runnable() {
@SuppressLint("WrongCall")
public void run() {
//Log.v("test", "----- thread called--------");
running = true;
//Log.v("test", "progress:"+progress);
//Log.v("test", "progress1:"+progress1);
progress2 = progress - progress1 ;
//progress = 360 , progress1 = uservalue
Log.v("test", "progress:"+progress);
Log.v("test", "progress1:"+progress1);
Log.v("test", "progress2 = progress - progress1:"+progress2);
//percentage = pw_two.incrementProgress();
// pw_two.setBarColor(Color.parseColor("#FF0000"));
while(progress2<360) {
percentage = pw_two.incrementProgress();
Log.v("test","percentage:"+percentage);
progress2++;
try {
Thread.sleep(15);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// here when crossing 360 above , then color change effect needed..
//why we using this function, when put ten minutes for break,
who taking more than ten minutes,,
// then that time itself, need to change color..
i finish that time calculation....
if(progress2 > 359) {
// here.. need to call this method two times.. then only, wheel will be refreshed......
//onPause_Reset_ProgressWheelOne();
onPause_Reset_ProgressWheelOne();
//break;
}
}
running = false;
}
};
public void onPause_Reset_ProgressWheelOne() {
Log.v("test", "onPause_Reset_ProgressWheelOne--------");
progress = 360;
pw_two.setRimColor(Color.parseColor("#fe854c")); //1988c4 //fe854c
pw_two.setBarColor(Color.RED);
//pw_two.resetCount();
pw_two.refreshWheel();
// progress = 0;
// pw_two.setProgress(0);
}
ProgressWheel.java CLass :
public void refreshWheel() {
setupPaints();
}