I want to draw a circle with Canvas. As the code below, i can draw a circle on the view but i wonder that; how to make an animated circle as radius increases slowly and color is going to lighter (like a drop wave on water). like :
Can anyone help? Thanks.
Draws simple circle with canvas :
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
mPaint.setColor(Tool.colors[6]);
canvas.drawCircle(coorX(), coorY(), radius, mPaint);
}
Shows touches on the screen as in settings->developer options->show touches : This code uses system settings. So i only get animated circle which is defined already and cannot be change (radius,color, etc.).
private final String SHOW_TOUCHES_SETTING = "show_touches";
private boolean getSystemSetting(){
return Settings.System.getInt(getContentResolver(), SHOW_TOUCHES_SETTING, 0) == 1;
}
private void setSystemSetting(boolean paramBoolean){
if (getSystemSetting() == paramBoolean) {
return;
}
for (;;){
try{
ContentResolver localContentResolver = getContentResolver();
if (paramBoolean){
Settings.System.putInt(localContentResolver, SHOW_TOUCHES_SETTING, 1);
return;
}
}
finally {}
}
}
protected void onCreate(Bundle paramBundle){
super.onCreate(paramBundle);
setContentView(R.layout.activity_main);
this.setSystemSetting(paramAnonymousBoolean);
}