Class DynamicTintUtils
java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicTintUtils
Helper class to perform various tint operations on views.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcolorizeRippleDrawable(View view, Drawable drawable, int background, int color, boolean borderless, boolean checkable) Colorize a ripple drawable tint according to the supplied view and color.static voidsetInsetForegroundColor(com.google.android.material.internal.ScrimInsetsFrameLayout view, int color, boolean drawBottomInset) Try to set the inset foreground color for the view.static voidsetViewBackgroundTint(View view, int background, boolean borderless) Set a view background tint according to the supplied color.static voidsetViewBackgroundTint(View view, int background, int color, boolean borderless, boolean checkable) Set a view background tint according to the supplied color.static voidsetViewForegroundTint(View view, int background, boolean borderless) Set a view background tint according to the supplied color.static voidsetViewForegroundTint(View view, int background, int color, boolean borderless, boolean checkable) Set a view foreground tint according to the supplied color.
-
Constructor Details
-
DynamicTintUtils
public DynamicTintUtils()
-
-
Method Details
-
colorizeRippleDrawable
public static void colorizeRippleDrawable(@Nullable View view, @Nullable Drawable drawable, @ColorInt int background, @ColorInt int color, boolean borderless, boolean checkable) Colorize a ripple drawable tint according to the supplied view and color.- Parameters:
view- The view to check the background tint.drawable- The ripple drawable to be colorized.background- The background color to calculate the default color.color- The tint color to be used.borderless-trueif the view is borderless.checkable-trueif the view is checkable.
-
setViewBackgroundTint
public static void setViewBackgroundTint(@Nullable View view, @ColorInt int background, @ColorInt int color, boolean borderless, boolean checkable) Set a view background tint according to the supplied color.- Parameters:
view- The view to set the background tint.background- The background color to calculate the default color.color- The tint color to be used.borderless-trueif the view is borderless.checkable-trueif the view is checkable.
-
setViewBackgroundTint
public static void setViewBackgroundTint(@Nullable View view, @ColorInt int background, boolean borderless) Set a view background tint according to the supplied color.- Parameters:
view- The view to set the background tint.background- The background color to consider the background aware.borderless-trueif the view is borderless.
-
setViewForegroundTint
public static void setViewForegroundTint(@Nullable View view, @ColorInt int background, @ColorInt int color, boolean borderless, boolean checkable) Set a view foreground tint according to the supplied color.- Parameters:
view- The view to set the foreground tint.background- The background color to consider the background aware.color- The tint color to be used.borderless-trueif the view is borderless.checkable-trueif the view is checkable.
-
setViewForegroundTint
public static void setViewForegroundTint(@Nullable View view, @ColorInt int background, boolean borderless) Set a view background tint according to the supplied color.- Parameters:
view- The view to set the foreground tint.background- The background color to consider the background aware.borderless-trueif the view is borderless.
-
setInsetForegroundColor
public static void setInsetForegroundColor(@Nullable com.google.android.material.internal.ScrimInsetsFrameLayout view, @ColorInt int color, boolean drawBottomInset) Try to set the inset foreground color for the view.- Parameters:
view- The view set the inset foreground color.color- The scrim color to be set.drawBottomInset-trueto draw the bottom inset.
-