@Nullable
    public static Drawable matchText(Context context, @DrawableRes int drawableId, TextView text) {
        Drawable d = context.getDrawable(drawableId);
        if (d != null) {
            int size = Math.round(text.getTextSize());
            d.setBounds(0, 0, size, size);
            d.setTint(text.getCurrentTextColor());
        }
        return d;
    }
@Nullable
    public static Drawable matchText(Context context, @DrawableRes int drawableId, TextView text) {
        Drawable d = context.getDrawable(drawableId);
        if (d != null) {
            int size = Math.round(text.getTextSize());
            d.setBounds(0, 0, size, size);
            d.setTint(text.getCurrentTextColor());
        }
        return d;
    }
@ Nullable public static Drawable matchText ( Context context , @ DrawableRes int drawableId , TextView text ) { Drawable d = context . getDrawable ( drawableId ) ; if ( d != null ) { int size = Math . round ( text . getTextSize ( ) ) ; d . setBounds ( 0 , 0 , size , size ) ; d . setTint ( text . getCurrentTextColor ( ) ) ; } return d ; }
Set the Drawable's size and tint to be the same as the text.

@return null if the drawable does not exist
@since 4.0.0
Set the Drawable s size and tint to be the same as the text .