I want to add a badge with the number of pending events above the menu icon of the application, but as you can see in the image below I have some problems. I'm unable to make the circle opaque, I don't want to see the grey lines behind the circle and the new image is cut on the top
I want to use it on the logo icon of the action bar (the home icon), not in any other menu item of the action bar so custom action view is not an option
Bitmap bm = BitmapFactory.decodeResource(getResources(), drawableId);
bm = bm.copy(bm.getConfig(), true);
Paint circlePaint = new Paint();
circlePaint.setAntiAlias(true);
circlePaint.setColor(Color.RED);
circlePaint.setStyle(Paint.Style.FILL);
//circlePaint.setAlpha(255);
Paint textPaint = new Paint();
textPaint.setStyle(Style.FILL);
textPaint.setColor(Color.WHITE);
textPaint.setTextSize(23);
textPaint.setFakeBoldText(true);
Canvas canvas = new Canvas(bm);
canvas.drawCircle(bm.getWidth()/6, bm.getHeight()/5, 13, circlePaint);
canvas.drawText(text, bm.getWidth()/7 + 5, bm.getHeight()/3, textPaint);
return new BitmapDrawable(context.getResources(), bm);
Any help will be appreciated!
Thanks