Code example for RectShape

0
      return System.currentTimeMillis();
   } 
    
   public static PaintDrawable getPaintDrawable(int startX, int endX){
      PaintDrawable drawable = new PaintDrawable();
      drawable.setShape(new RectShape());
      drawable.setShaderFactory(getShaderFactory(startX, endX));
      return drawable;
   } 
 
   public static ShapeDrawable.ShaderFactory
   getShaderFactory(final int startX, final int endX){
      return new ShapeDrawable.ShaderFactory(){
 
         @Override 
         public Shader resize(int width, int height) {
            return new LinearGradient(startX, 0, endX, 0,
                  new int[]{ 0xFFDCDAD5, 0xFFFDFDF4, 
                  0xFFFFFFFF, 0xFFFDFBEF }, 
                  new float[]{ 0, 0.18f, 0.48f, 1 }, 
Experience pair programming with AI  Get Codota for Java