Code example for Paint

Methods: getTextSize

0
         
        // Get the desired height of the icon menu view (last row of items does 
        // not have a divider below) 
        Rect padding = new Rect();
        mSelectionHighlight.getPadding(padding);
        final int desiredHeight = ((int)mPaint.getTextSize()) + mVerticalPadding
                + padding.top + padding.bottom;
         
        // Maximum possible width and desired height 
        setMeasuredDimension(measuredWidth,
                resolveSize(desiredHeight, heightMeasureSpec));
    } 
 
    /** 
     * If the canvas is null, then only touch calculations are performed to pick the target 
     * candidate. 
     */ 
    @Override 
    protected void onDraw(Canvas canvas) {
        if (canvas != null) {
            super.onDraw(canvas);