public static GradientDrawable createDrawable(int contentColor, int strokeColor, int radius) {
GradientDrawable drawable = new GradientDrawable();
drawable.setGradientType(GradientDrawable.RECTANGLE);
drawable.setColor(contentColor);
drawable.setStroke(1, strokeColor);
drawable.setCornerRadius(radius);
return drawable;
}
public static StateListDrawable createSelector(Drawable normalState, Drawable pressedState) {
StateListDrawable bg = new StateListDrawable();
bg.addState(new int[]{android.R.attr.state_pressed, android.R.attr.state_enabled}, pressedState);
bg.addState(new int[]{android.R.attr.state_enabled}, normalState);
bg.addState(new int[]{}, normalState);
return bg;
}