Code example for Rect

Methods: setEmpty

0
        //If drawing to a path, we cannot measure intrinsic bounds 
        //We must resly on setBounds being called externally 
        if (mTextPath != null) {
            //Clear any previous measurement 
            mTextLayout = null;
            mTextBounds.setEmpty();
        } else { 
            //Measure text bounds 
            float desired = Layout.getDesiredWidth(mText, mTextPaint);
            mTextLayout = new StaticLayout(mText, mTextPaint, (int)desired,
                    mTextAlignment, 1.0f, 0.0f, false);
            mTextBounds.set(0, 0, mTextLayout.getWidth(), mTextLayout.getHeight());
        } 
 
        //We may need to be redrawn 
        invalidateSelf();
    } 
 
    /** 
     * Internal method to apply the correct text color based on the drawable's state 
     */