Code example for Paint

Methods: getTextBoundssetAlpha

0
            addText(canvas, distanceScale[2], center, center + radius * 3 / 4);
            addText(canvas, distanceScale[3], center, center + radius);
     
            // Draw the blip. Alpha is based on how long ago the sweep crossed the blip 
            long blipDifference = now - mBlipTime;
            gridPaint.setAlpha(255 - (int)((128 * blipDifference) >> 10));
            canvas.drawBitmap(mBlip, center + (cos * blipRadius) - 8 , 
                    center + (sin * blipRadius) - 8, gridPaint);
            gridPaint.setAlpha(255);
        } 
    } 
     
    private void addText(Canvas canvas, String str, int x, int y) {
         
        mGridPaint.getTextBounds(str, 0, str.length(), mTextBounds);
        mTextBounds.offset(x - (mTextBounds.width() >> 1), y);
        mTextBounds.inset(-2, -2);
        canvas.drawRect(mTextBounds, mErasePaint);
        canvas.drawText(str, x, y, mGridPaint);
    } 
Connect your IDE to all the code out there  Get Codota for Java