getPaddingOrNull

Returns the padding of drawable, or null if it has none.

Drawable.getPadding is not thread-safe: on a android.graphics.drawable.DrawableContainer the first call lazily inflates child drawables without synchronization. The same drawable can be read by overlapping resolves (e.g. a drawable held across renders), so reads are serialized on the drawable.