Code example for RectShape

      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(){
         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 }, 
Connect your IDE to all the code out there  Get Codota for Java