after create this class
public class MyColors {
public static String COLOR_APPLICATION = "#FF445FC7";
public static String COLOR_APPLICATION_OPACITY = "#cbb19155";
public static String PRIMARY_COLOR = "#211d1c";
public static String NAVBAR_COLOR = "#0c0c0c";
public static String BACKGROUND_COLOR = "#cbb19155";}
then create:
public class MyDrawables {
public static Drawable txt_shape = new DrawableBuilder()
.rectangle().bottomLeftRadius(9).bottomRightRadius(9)
.solidColor(Color.parseColor(MyColors.COLOR_APPLICATION))
.build();
public static Drawable text_view_center_shape = new DrawableBuilder()
.rectangle().solidColor(Color.parseColor("#009c3bbc"))
.strokeColor(Color.parseColor("#9f9f9f")).strokeWidth(1)
.build();}
gettig that exception when using myDrawable like :
serviceTxt.setBackground(MyDrawables.txt_shape);
what can I do to avoid this crash ?
P.S: application does'nt crashing when create my drawable in activity and use it .