Code example for Drawable

Methods: getPadding

0
    public boolean getPadding(Rect padding) {
        // The padding for this Drawable is a composition of some of the 
        // paddings of the underlying Drawables. 
        final Rect rect = mTempRect;
 
        mLeftCapDrawable.getPadding(rect);
        int pLeft = rect.left;
 
        mBottomAnchorDrawable.getPadding(rect);
        int pTop = rect.top;
        int pBottom = rect.bottom;
 
        mRightCapDrawable.getPadding(rect);
        int pRight = rect.right;
 
        padding.set(pLeft, pTop, pRight, pBottom);
 
        return pLeft != 0 && pTop != 0 && pRight != 0 && pBottom != 0;
    } 
 
    @Override