I am trying to change the background of a ProgressDialog
. I searched the net and found various suggestions (like How to remove border from Dialog?), but I am un
You can try my gist. It basicly sets a color filter on drawable.
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.ProgressBar;
public class ColoredProgressBar extends ProgressBar {
public ColoredProgressBar(Context context) {
super(context);
if (!isInEditMode())
init();
}
public ColoredProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
if (!isInEditMode())
init();
}
public ColoredProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (!isInEditMode())
init();
}
/**
* Changes color.
*/
private void init() {
getIndeterminateDrawable().setColorFilter(Color.BLUE, android.graphics.PorterDuff.Mode.MULTIPLY);
}
}