wrap
Potentially wrap drawable
so that it may be used for tinting across the different API levels, via the tinting methods in this class.
If the given drawable is wrapped, we will copy over certain state over to the wrapped drawable, such as its bounds, level, visibility and state.
You must use the result of this call. If the given drawable is being used by a view (as its background for instance), you must replace the original drawable with the result of this call:
Drawable bg = DrawableCompat.wrap(view.getBackground());
// Need to set the background with the wrapped drawable
view.setBackground(bg);
// You can now tint the drawable
DrawableCompat.setTint(bg, ...);
Content copied to clipboard
If you need to get hold of the original android.graphics.drawable.Drawable again, you can use the value returned from unwrap.
Return
A drawable capable of being tinted across all API levels.
Parameters
drawable
The Drawable to process