After reading all the questions and answers, I hope this should be your script to do your thing ...
1. Create two graphs According to your logic.
2. Create two drwables from specific bitmaps ....
Drawable G_bg = new BitmapDrawable(Red graph bitmap); Drawable G_pg = new BitmapDrawable(Blue graph bitmap);
3. Then customize your search bar using the list of layers created using java code.
ClipDrawable c=new ClipDrawable(G_pg, Gravity.LEFT,ClipDrawable.HORIZONTAL); LayerDrawable ld =new LayerDrawable (new Drawable[]{G_bg,c});
4.Apply this list of layers to your search.
Graphbar.setProgressDrawable(ld);
This should work the way you wanted .... Thanks
source share