@Test public void testGetTintedDrawableNullTint() throws Exception { final Drawable source = ContextCompat.getDrawable( RuntimeEnvironment.application, R.drawable.appwidget_preview_single_row); final Drawable drawable = DrawableUtils.getTintedDrawable(source, null); assertHasNoTint(drawable); }
@Nullable public static Drawable getTintedDrawable(@NonNull final Context context, @DrawableRes final int res, @Nullable final ColorStateList tint) { final Drawable d = ResourcesCompat.getDrawable(context.getResources(), res, context.getTheme()); return getTintedDrawable(d, tint); }
DrawableUtils { @Nullable public static Drawable getTintedDrawable(@NonNull final Context context, @DrawableRes final int res, @Nullable final ColorStateList tint) { final Drawable d = ResourcesCompat.getDrawable(context.getResources(), res, context.getTheme()); return getTintedDrawable(d, tint); } }
DrawableUtils { @Nullable public static Drawable getTintedDrawable(@NonNull final Context context, @DrawableRes final int res, @Nullable final ColorStateList tint) { final Drawable d = ResourcesCompat.getDrawable(context.getResources(), res, context.getTheme()); return getTintedDrawable(d, tint); } private  DrawableUtils(); }
DrawableUtils { @Nullable public static Drawable getTintedDrawable(@NonNull final Context context, @DrawableRes final int res, @Nullable final ColorStateList tint) { final Drawable d = ResourcesCompat.getDrawable(context.getResources(), res, context.getTheme()); return getTintedDrawable(d, tint); } private  DrawableUtils(); @Nullable static Drawable getTintedDrawableFromAttrTint(@NonNull final Context context,
            @DrawableRes final int res,
            @AttrRes final int tintAttr); @Nullable static Drawable getTintedDrawableFromAttrTint(@NonNull final Context context,
            @Nullable final Drawable src,
            @AttrRes final int tintAttr); @Nullable static Drawable getTintedDrawable(@NonNull final Context context,
            @DrawableRes final int res,
            @Nullable final ColorStateList tint); @Nullable static Drawable getTintedDrawable(@NonNull final Context context,
            @DrawableRes final int res,
            @ColorInt final int tint); @Nullable static Drawable getTintedDrawable(@Nullable Drawable drawable,
            @Nullable final ColorStateList tint); @Nullable static Drawable getTintedDrawable(@Nullable Drawable drawable,
            @ColorInt final int tint); }
DrawableUtils { @Nullable public static Drawable getTintedDrawable(@NonNull final Context context, @DrawableRes final int res, @Nullable final ColorStateList tint) { final Drawable d = ResourcesCompat.getDrawable(context.getResources(), res, context.getTheme()); return getTintedDrawable(d, tint); } private  DrawableUtils(); @Nullable static Drawable getTintedDrawableFromAttrTint(@NonNull final Context context,
            @DrawableRes final int res,
            @AttrRes final int tintAttr); @Nullable static Drawable getTintedDrawableFromAttrTint(@NonNull final Context context,
            @Nullable final Drawable src,
            @AttrRes final int tintAttr); @Nullable static Drawable getTintedDrawable(@NonNull final Context context,
            @DrawableRes final int res,
            @Nullable final ColorStateList tint); @Nullable static Drawable getTintedDrawable(@NonNull final Context context,
            @DrawableRes final int res,
            @ColorInt final int tint); @Nullable static Drawable getTintedDrawable(@Nullable Drawable drawable,
            @Nullable final ColorStateList tint); @Nullable static Drawable getTintedDrawable(@Nullable Drawable drawable,
            @ColorInt final int tint);  }