Class Dynamic
DynamicActivity
and inflated views at runtime according
to their implemented types.
These methods are provided to avoid any exceptions when views are replaced by the
DynamicLayoutInflater
or not using the DynamicActivity
.
So, this is the recommended way to modify the activity or any of the following view types
at runtime.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Interface to hold the vibration values. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addBottomSheet
(Context activity, int layoutRes, boolean removePrevious) Add view in the bottom sheet frame layout for theDynamicActivity
.static void
addBottomSheet
(Context activity, View view, boolean removePrevious) Add view in the bottom sheet frame layout for theDynamicActivity
.static void
Add header view just below the app bar for theDynamicActivity
.static void
Add header view just below the app bar for theDynamicActivity
.static void
Add header view just below the app bar for theDynamicActivity
.static void
Add header view just below the app bar for theDynamicActivity
.static void
addSearchViewTextChangedListener
(Context activity, TextWatcher textWatcher) Adds the text watcher to listen search view text changes for theDynamicActivity
.static void
collapseSearchView
(Context activity) Collapse search view to stop searching for theDynamicActivity
.static void
expandSearchView
(Context activity, boolean requestSoftInput) Expand search view to start searching for theDynamicActivity
.static View
findViewById
(View view, int viewId) Try to find view for the supplied view id.static Icon
getAppShortcutIcon
(Context context, int drawableRes, int backgroundId, int foregroundId, boolean theme) Returns the app shortcut icon according to the dynamic theme.static <T,
V> int CallTutorial.getColor()
method for theTutorial
.static <T> int
getColor
(T dynamic, int defaultColor) Returns the color for the supplied dynamic object.static int
getContrast
(int contrast) Returns the resolved contrast for the supplied value.static <T> int
getContrast
(T dynamic) Returns the contrast for the supplied dynamic object.static <T> int
getContrastWithColor
(T dynamic, int defaultColor) Returns the contrast with color for the supplied dynamic object.static float
getElevation
(View view, float defaultElevation) Returns the elevation for the supplied view.static int
getTintColor
(int color) Returns the tint color according to the applied theme.static int
getTintColor
(int color, float visibleContrast) Returns the tint color according to the supplied visible contrast.static <T extends BackgroundAware<?>>
intgetTintColor
(int color, T theme) Returns the tint color according to the supplied theme.static <T,
V> int getTintColor
(Tutorial<T, V> tutorial, int defaultColor) CallTutorial.getTintColor()
method for theTutorial
.static boolean
isBackgroundAware
(int backgroundAware) Checks whether the background aware functionality is enabled for the supplied value.static <T> boolean
isBackgroundAware
(T dynamic) Checks whether the background aware functionality is enabled for the supplied dynamic object.static <T extends DynamicColor<T>>
booleanisDynamicColor
(T theme) Checks whether the dynamic theme object has dynamic colors enabled.static boolean
Checks whether the theme styles version is legacy.static boolean
isLegacyVersion
(int version) Checks whether the supplied theme styles version is legacy.static boolean
isLegacyVersion
(String version) Checks whether the supplied theme styles version is legacy.static boolean
Checks whether the application theme styles version is legacy.static boolean
isSearchViewExpanded
(Context activity) Checks whether the search view is expanded for theDynamicActivity
.static boolean
isStroke()
Checks whether the stroke is required for the current theme.static <T extends StrokeTheme<?>>
booleanisStroke
(T theme) Checks whether the stroke is required for the supplied theme.static String
Load the theme styles version from the shared preferences.static String
loadThemeVersion
(boolean resolve) Load the theme styles version from the shared preferences.static <T,
V> void onColorChanged
(Tutorial<T, V> tutorial, int color, int tint) CallTutorial.onColorChanged(int, int)
method for theTutorial
.static void
onPageScrolled
(ViewPager.OnPageChangeListener pager, int position, float positionOffset, int positionOffsetPixels) CallViewPager.OnPageChangeListener.onPageScrolled(int, float, int)
method for theViewPager
.static void
onPageScrollStateChanged
(ViewPager.OnPageChangeListener pager, int state) CallView.onScreenStateChanged(int)
method for theViewPager
.static void
onPageSelected
(ViewPager.OnPageChangeListener pager, int position) CallViewPager.OnPageChangeListener.onPageSelected(int)
method for theViewPager
.static <T,
V> void onSetPadding
(Tutorial<T, V> tutorial, int left, int top, int right, int bottom) CallTutorial.onSetPadding(int, int, int, int)
method for theTutorial
.static void
removeSearchViewTextChangedListener
(Context activity, TextWatcher textWatcher) Removes the text watcher from the search view to stop listening text changes for theDynamicActivity
.static int
resolveColor
(int background, int color, int tint, boolean backgroundAware) Resolves a color based on the supplied parameters.static int
resolveTintColor
(int background, int color, int tint, boolean backgroundAware) Resolves a color based on the supplied parameters.static void
restoreSearchViewState
(Context activity) Restore the search view state after the configuration change for theDynamicActivity
.static void
saveThemeVersion
(String version) Save the theme styles version into the shared preferences.static void
Set bitmap for the image view and manage its visibility according to the data.static void
Set drawable for the image view and manage its visibility according to the data.static void
Set rating value for the rating bar.static void
set
(TextView textView, CharSequence text) Set text for the text view and manage its visibility according to the data.static void
Set text for the text view and manage its visibility according to the data.static void
setAllCapsIfRequired
(TextView textView, boolean allCaps) Set the text view all caps according to the theme styles version.static void
Set alpha for the view.static void
setAppBarProgressVisible
(Context activity, boolean visible) Set the visibility of app bar progress for theDynamicActivity
.static void
setBackground
(View view, int drawableRes) Set background drawable resource for the view.static void
setBackground
(View view, Drawable drawable) Set background drawable for the view.static <T> void
setBackgroundAware
(T dynamic, int backgroundAware) Sets the background aware for the supplied dynamic object.static <T> void
setBackgroundAware
(T dynamic, int backgroundAware, int contrast) Sets the background aware and contrast for the supplied dynamic object.static <V,
T extends BackgroundAware<?>>
voidsetBackgroundAware
(V dynamic, T theme) Sets the background aware and contrast for the dynamic object according to the supplied theme.static <T> void
setBackgroundAwareSafe
(T dynamic, int backgroundAware) Sets the background aware for the supplied dynamic object after doing appropriate checks.static <T> void
setBackgroundAwareSafe
(T dynamic, int backgroundAware, int contrast) Sets the background aware and contrast for the supplied dynamic object after doing appropriate checks.static <T> void
setBackgroundColor
(T dynamic, int color) Sets the background color for the supplied dynamic object.static <T> void
setBackgroundColorType
(T dynamic, int colorType) Sets the background color type for the supplied dynamic object.static void
setBottomSheetState
(Context activity, int bottomSheetState) Sets the bottom sheet state if present for theDynamicActivity
.static <T> void
setClickable
(T dynamic, boolean clickable) Set the clickable property for the dynamic object.static void
setClickListener
(View view, View.OnClickListener clickListener) Set click listener for the view and manage its visibility according to the data.static void
setClickListener
(View view, View.OnClickListener clickListener, boolean visibility) Set click listener for the view and manage its visibility according to the data.static <T> void
setColor
(T dynamic) Refresh the color for the supplied dynamic object.static <T> void
setColor
(T dynamic, int color) Sets the color for the supplied dynamic object.static <T> void
setColorType
(T dynamic, int colorType) Sets the color type for the supplied dynamic object.static <T> void
setColorTypeOrColor
(T dynamic, int colorType, int color) Sets the color type or color for the supplied dynamic object after doing the appropriate checks.static void
setContentDescription
(ImageView imageView, String text) Set content description for the image view.static <T> void
setContrastWithColor
(T dynamic, int color) Sets the contrast with color for the supplied dynamic object.static <T> void
setContrastWithColorType
(T dynamic, int colorType) Sets the contrast with color type for the supplied dynamic object.static <T> void
setContrastWithColorTypeOrColor
(T dynamic, int colorType, int color) Sets the contrast with color type or color for the supplied dynamic object after doing the appropriate checks.static void
Sets the corner for the supplied view.static void
setCornerMin
(View view, float cornerMax) Sets the minimum corner value for the supplied view.static void
setElevation
(View view, float elevation) Sets elevation for the supplied view.static void
setEnabled
(View view, boolean enabled) Set a view enabled or disabled.static void
setForceElevation
(View view, boolean forceElevation) Sets whether to force elevation for the supplied view.static void
setHtml
(TextView textView, CharSequence text) SetHTML
text for the text view and manage its visibility according to the data.static <T> void
setLinkColor
(T dynamic) Refresh the link color for the supplied dynamic object.static <T> void
setLinkColor
(T dynamic, int color) Sets the link color for the supplied dynamic object.static <T> void
setLinkColorType
(T dynamic, int colorType) Sets the link color type for the supplied dynamic object.static <T> void
setLongClickable
(T dynamic, boolean longClickable) Set the long clickable property for the dynamic object.static <T> void
setOnClickListener
(T dynamic, View.OnClickListener onClickListener) Set on click listener for the dynamic object.static <T> void
setOnLongClickListener
(T dynamic, View.OnLongClickListener onLongClickListener) Set on long click listener for the dynamic object.static void
setPreventCornerOverlap
(View view, boolean preventCornerOverlap) Sets the prevent corner overlap for the supplied view.static void
setResource
(View view, int drawableRes) Set drawable for the image view and manage its visibility according to the data.static <T> void
setRootBackground
(T dynamic, int color) Sets the background for the window or root view.static <T> void
setScrollBarColor
(T dynamic) Refresh the scroll bar color for the supplied dynamic object.static <T> void
setScrollBarColor
(T dynamic, int color) Sets the scroll bar color for the supplied dynamic object.static <T> void
setScrollBarColorType
(T dynamic, int colorType) Sets the scroll bar color type for the supplied dynamic object.static void
setSearchViewListener
(Context activity, DynamicSearchListener searchListener) Sets the listener to listen the search view expand and collapse callbacks for theDynamicActivity
.static <T> void
setStateNormalColor
(T dynamic, int color) Sets the normal state color for the supplied dynamic object.static <T> void
setStateNormalColorType
(T dynamic, int colorType) Sets the normal state color type for the supplied dynamic object.static <T> void
setStateSelectedColor
(T dynamic, int color) Sets the selected state color for the supplied dynamic object.static <T> void
setStateSelectedColorType
(T dynamic, int colorType) Sets the selected state color type for the supplied dynamic object.static <T> void
setStrokeColor
(T dynamic, int color) Sets the stroke color for the supplied dynamic object.static void
Set text for the text view and manage its visibility according to the data.static <T> void
setTextColor
(T dynamic) Refresh the text color for the supplied dynamic object.static <T> void
setTextColor
(T dynamic, int color) Sets the text color for the supplied dynamic object.static <T> void
setTextColorType
(T dynamic, int colorType) Sets the text color type for the supplied dynamic object.static <T extends TypeTheme<?>>
TsetThemeType
(T theme, int type) Sets the type for the supplied dynamic theme object.static <T extends TypeTheme<?>>
TsetThemeType
(T theme, T parent) Sets the type for the supplied dynamic theme object.static void
setTooltip
(View view) Set tooltip for the supplied view.static void
setTooltip
(View view, int backgroundColor, int tintColor) Set tooltip for the supplied view.static void
setTooltip
(View view, int backgroundColor, int tintColor, CharSequence text) Set tooltip for the supplied view.static void
setTooltip
(View view, CharSequence text) Set tooltip for the supplied view.static void
setTransitionName
(View view, String name) Sets the transition name for the supplied view.static void
setTransitionPosition
(Context activity, int transitionPosition) Sets the transition position for theDynamicActivity
.static void
setTransitionResultCode
(Context activity, int transitionResultCode) Sets the transition result code for theDynamicActivity
.static void
setVisibility
(View view, int visibility) Set visibility for the view.static void
setVisibility
(View view, View base) Set visibility for the view according to the base view.static void
showSnackbar
(Context activity, int stringRes) Show the snackbar for theDynamicSnackbar
.static void
showSnackbar
(Context activity, int stringRes, int duration) Show the snackbar for theDynamicSnackbar
.static void
showSnackbar
(Context activity, CharSequence text) Show the snackbar for theDynamicSnackbar
.static void
showSnackbar
(Context activity, CharSequence text, int duration) Show the snackbar for theDynamicSnackbar
.static void
startMotionActivityFromFragment
(Context activity, Fragment fragment, Intent intent, int requestCode, Bundle options) Called by Fragment.startActivityForResult() to implement its behavior for theDynamicActivity
.static void
startMotionActivityFromFragment
(Context activity, Fragment fragment, Intent intent, int requestCode, Bundle options, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior for theDynamicActivity
.static <T> void
tint
(T dynamic, int color) Tint dynamic object according to the supplied colors.static <T> void
tint
(T dynamic, int color, int contrastWithColor) Tint dynamic object according to the supplied colors.static <T> void
tintBackground
(T dynamic) Tint background according to the default contrast with color.static <T> void
tintBackground
(T dynamic, int contrastWithColor) Tint background according to the supplied contrast with color.static <T> void
tintBackground
(T dynamic, int contrastWithColor, boolean borderless) Tint background according to the supplied contrast with color.static <T> void
tintBackground
(T dynamic, int contrastWithColor, int color, boolean borderless) Tint background according to the supplied colors.static <T> void
tintForeground
(T dynamic, int contrastWithColor) Tint foreground according to the supplied contrast with color.static <T> void
tintForeground
(T dynamic, int contrastWithColor, boolean borderless) Tint foreground according to the supplied contrast with color.static <T> void
tintForeground
(T dynamic, int contrastWithColor, int color, boolean borderless) Tint foreground according to the supplied colors.static <T> void
tintScrollable
(T dynamic) Tint scrollable according to the default contrast with color.static <T> void
tintScrollable
(T dynamic, int contrastWithColor) Tint scrollable according to the supplied contrast with color.static int
withContrastRatio
(int color, int contrastWith) Returns the contrast color according to the applied theme.static int
withContrastRatio
(int color, int contrastWith, float visibleContrast) Returns the contrast color according to the supplied visible contrast.static <T extends BackgroundAware<?>>
intwithContrastRatio
(int color, int contrastWith, T theme) Returns the contrast color according to the supplied theme.static int
withThemeOpacity
(int color) Sets the translucent theme opacity for the supplied color.static int
withThemeOpacity
(int color, int min) Sets the translucent theme opacity for the supplied color.static <T extends TranslucentTheme<?>>
intwithThemeOpacity
(int color, T theme) Sets the translucent theme opacity for the supplied color.static <T extends TranslucentTheme<?>>
intwithThemeOpacity
(int color, T theme, int min) Sets the translucent theme opacity for the supplied color.static Drawable
withThemeOpacity
(Drawable drawable) Sets the translucent theme opacity for the supplied drawable.static Drawable
withThemeOpacity
(Drawable drawable, int min) Sets the translucent theme opacity for the supplied drawable.static <T extends TranslucentTheme<?>>
DrawablewithThemeOpacity
(Drawable drawable, T theme) Sets the translucent theme opacity for the supplied drawable.static <T extends TranslucentTheme<?>>
DrawablewithThemeOpacity
(Drawable drawable, T theme, int min) Sets the translucent theme opacity for the supplied drawable.
-
Constructor Details
-
Dynamic
public Dynamic()
-
-
Method Details
-
loadThemeVersion
Load the theme styles version from the shared preferences.- Parameters:
resolve
-true
to resolve the auto theme version.- Returns:
- The theme styles version from the shared preferences.
-
loadThemeVersion
Load the theme styles version from the shared preferences.- Returns:
- The theme styles version from the shared preferences.
- See Also:
-
saveThemeVersion
Save the theme styles version into the shared preferences.- Parameters:
version
- The version to be saved.
-
isLegacyVersion
public static boolean isLegacyVersion(int version) Checks whether the supplied theme styles version is legacy.- Parameters:
version
- The version to be checked.- Returns:
true
if the supplied theme styles version is legacy.
-
isLegacyVersion
Checks whether the supplied theme styles version is legacy.- Parameters:
version
- The version to be checked.- Returns:
true
if the supplied theme styles version is legacy.
-
isLegacyVersion
public static boolean isLegacyVersion()Checks whether the theme styles version is legacy.- Returns:
true
if the theme styles version is legacy.- See Also:
-
isLegacyVersionRemote
public static boolean isLegacyVersionRemote()Checks whether the application theme styles version is legacy.- Returns:
true
if the application theme styles version is legacy.- See Also:
-
setAllCapsIfRequired
Set the text view all caps according to the theme styles version.- Parameters:
textView
- The text view to be used.allCaps
-true
to set the all caps.- See Also:
-
resolveColor
@ColorInt public static int resolveColor(@ColorInt int background, @ColorInt int color, @ColorInt int tint, boolean backgroundAware) Resolves a color based on the supplied parameters.- Parameters:
background
- The background color to be considered.color
- The color to be resolved.tint
- The tint color to be resolved.backgroundAware
-true
if the background aware is enabled.- Returns:
- The resolved color based on the supplied parameters.
-
resolveTintColor
@ColorInt public static int resolveTintColor(@ColorInt int background, @ColorInt int color, @ColorInt int tint, boolean backgroundAware) Resolves a color based on the supplied parameters.- Parameters:
background
- The background color to be considered.color
- The color to be resolved.tint
- The tint color to be resolved.backgroundAware
-true
if the background aware is enabled.- Returns:
- The resolved color based on the supplied parameters.
-
setColorType
Sets the color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
setBackgroundColorType
Sets the background color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
setContrastWithColorType
Sets the contrast with color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
setTextColorType
Sets the text color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
setLinkColorType
Sets the link color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
setStateNormalColorType
Sets the normal state color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
setStateSelectedColorType
Sets the selected state color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
setScrollBarColorType
Sets the scroll bar color type for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.- See Also:
-
getColor
Returns the color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.defaultColor
- The default color to be used.- Returns:
- The color for the supplied dynamic object.
- See Also:
-
setColor
Sets the color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setColor
Refresh the color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.- See Also:
-
setBackgroundColor
Sets the background color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setStrokeColor
Sets the stroke color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The stroke color to be set.
-
getContrastWithColor
@ColorInt public static <T> int getContrastWithColor(@Nullable T dynamic, @ColorInt int defaultColor) Returns the contrast with color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.defaultColor
- The default color to be used.- Returns:
- The contrast color for the supplied dynamic object.
- See Also:
-
setContrastWithColor
Sets the contrast with color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setTextColor
Sets the text color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setTextColor
Refresh the text color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.- See Also:
-
setLinkColor
Sets the link color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setLinkColor
Refresh the link color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.- See Also:
-
setStateNormalColor
Sets the normal state color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setStateSelectedColor
Sets the selected state color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setScrollBarColor
Sets the scroll bar color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setScrollBarColor
Refresh the scroll bar color for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.- See Also:
-
isStroke
Checks whether the stroke is required for the supplied theme.- Type Parameters:
T
- The type of the dynamic theme.- Parameters:
theme
- The theme object to be used.- Returns:
true
if the stroke is required for the supplied theme.
-
isStroke
public static boolean isStroke()Checks whether the stroke is required for the current theme.- Returns:
true
if the stroke is required for the current theme.
-
isBackgroundAware
public static boolean isBackgroundAware(int backgroundAware) Checks whether the background aware functionality is enabled for the supplied value.- Parameters:
backgroundAware
- The value to be checked.- Returns:
true
if the supplied value changes color according to the background.- See Also:
-
isBackgroundAware
Checks whether the background aware functionality is enabled for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be checked.- Returns:
true
if the supplied dynamic object changes color according to the background.- See Also:
-
setBackgroundAware
Sets the background aware and contrast for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.backgroundAware
- The background aware option to be set.contrast
- The contrast to be set.- See Also:
-
setBackgroundAware
public static <V,T extends BackgroundAware<?>> void setBackgroundAware(@Nullable V dynamic, @Nullable T theme) Sets the background aware and contrast for the dynamic object according to the supplied theme.- Type Parameters:
V
- The type of the dynamic object.T
- The type of the dynamic theme.- Parameters:
dynamic
- The dynamic object to be used.theme
- The theme object to be used.- See Also:
-
setBackgroundAware
Sets the background aware for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.backgroundAware
- The background aware option to be set- See Also:
-
getContrast
public static int getContrast(int contrast) Returns the resolved contrast for the supplied value.- Parameters:
contrast
- The contrast to be resolved.- Returns:
- The resolved contrast for the supplied value.
- See Also:
-
getContrast
Returns the contrast for the supplied dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.- Returns:
- The contrast for the supplied dynamic object.
- See Also:
-
withContrastRatio
@ColorInt public static int withContrastRatio(@ColorInt int color, @ColorInt int contrastWith, float visibleContrast) Returns the contrast color according to the supplied visible contrast.- Parameters:
color
- The color to be used.contrastWith
- The contrast with color to be used.visibleContrast
- The minimum ratio for the visible contrast.- Returns:
- The contrast color according to the supplied visible contrast.
- See Also:
-
withContrastRatio
@ColorInt public static <T extends BackgroundAware<?>> int withContrastRatio(@ColorInt int color, @ColorInt int contrastWith, @Nullable T theme) Returns the contrast color according to the supplied theme.- Type Parameters:
T
- The type of the theme.- Parameters:
color
- The color to be used.contrastWith
- The contrast with color to be used.theme
- The theme object to be used.- Returns:
- The contrast color according to the supplied theme.
- See Also:
-
withContrastRatio
Returns the contrast color according to the applied theme.- Parameters:
color
- The color to be used.contrastWith
- The contrast with color to be used.- Returns:
- The contrast color according to the applied theme.
- See Also:
-
withContrastRatio
@ColorInt public static <T> int withContrastRatio(@ColorInt int color, @ColorInt int contrastWith, @Nullable T view) Returns the contrast color according to the supplied dynamic widget.- Type Parameters:
T
- The type of the dynamic widget.- Parameters:
color
- The color to be used.contrastWith
- The contrast with color to be used.view
- The view object to be used.- Returns:
- The contrast color according to the supplied dynamic widget.
- See Also:
-
getTintColor
Returns the tint color according to the supplied visible contrast.- Parameters:
color
- The color to be used.visibleContrast
- The minimum ratio for the visible contrast.- Returns:
- The tint color according to the supplied visible contrast.
- See Also:
-
getTintColor
@ColorInt public static <T extends BackgroundAware<?>> int getTintColor(@ColorInt int color, @Nullable T theme) Returns the tint color according to the supplied theme.- Type Parameters:
T
- The type of the theme.- Parameters:
color
- The color to be used.theme
- The theme object to be used.- Returns:
- The tint color according to the supplied theme.
- See Also:
-
getTintColor
Returns the tint color according to the applied theme.- Parameters:
color
- The color to be used.- Returns:
- The tint color according to the applied theme.
- See Also:
-
getTintColor
Returns the tint color according to the supplied dynamic widget.- Type Parameters:
T
- The type of the dynamic widget.- Parameters:
color
- The color to be used.view
- The view object to be used.- Returns:
- The tint color according to the supplied dynamic widget.
- See Also:
-
withThemeOpacity
@ColorInt public static <T extends TranslucentTheme<?>> int withThemeOpacity(@ColorInt int color, @Nullable T theme, @IntRange(from=0L,to=255L) int min) Sets the translucent theme opacity for the supplied color.- Type Parameters:
T
- The type of the dynamic theme.- Parameters:
color
- The color to be used.theme
- The theme object to be used.min
- The minimum opacity to be used.- Returns:
- The color after applying the theme opacity.
- See Also:
-
withThemeOpacity
@ColorInt public static <T extends TranslucentTheme<?>> int withThemeOpacity(@ColorInt int color, @Nullable T theme) Sets the translucent theme opacity for the supplied color.- Type Parameters:
T
- The type of the dynamic theme.- Parameters:
color
- The color to be used.theme
- The theme object to be used.- Returns:
- The color after applying the theme opacity.
- See Also:
-
withThemeOpacity
@ColorInt public static int withThemeOpacity(@ColorInt int color, @IntRange(from=0L,to=255L) int min) Sets the translucent theme opacity for the supplied color.- Parameters:
color
- The color to be used.min
- The minimum opacity to be used.- Returns:
- The color after applying the theme opacity.
- See Also:
-
withThemeOpacity
Sets the translucent theme opacity for the supplied color.- Parameters:
color
- The color to be used.- Returns:
- The color after applying the theme opacity.
- See Also:
-
withThemeOpacity
@Nullable public static <T extends TranslucentTheme<?>> Drawable withThemeOpacity(@Nullable Drawable drawable, @Nullable T theme, @IntRange(from=0L,to=255L) int min) Sets the translucent theme opacity for the supplied drawable.- Type Parameters:
T
- The type of the dynamic theme.- Parameters:
drawable
- The drawable to be used.theme
- The theme object to be used.min
- The minimum opacity to be used.- Returns:
- The drawable after applying the theme opacity.
- See Also:
-
withThemeOpacity
@Nullable public static <T extends TranslucentTheme<?>> Drawable withThemeOpacity(@Nullable Drawable drawable, @Nullable T theme) Sets the translucent theme opacity for the supplied drawable.- Type Parameters:
T
- The type of the dynamic theme.- Parameters:
drawable
- The drawable to be used.theme
- The theme object to be used.- Returns:
- The drawable after applying the theme opacity.
- See Also:
-
withThemeOpacity
@Nullable public static Drawable withThemeOpacity(@Nullable Drawable drawable, @IntRange(from=0L,to=255L) int min) Sets the translucent theme opacity for the supplied drawable.- Parameters:
drawable
- The drawable to be used.min
- The minimum opacity to be used.- Returns:
- The drawable after applying the theme opacity.
- See Also:
-
withThemeOpacity
Sets the translucent theme opacity for the supplied drawable.- Parameters:
drawable
- The drawable to be used.- Returns:
- The drawable after applying the theme opacity.
- See Also:
-
setThemeType
Sets the type for the supplied dynamic theme object.- Type Parameters:
T
- The type of the theme object.- Parameters:
theme
- The theme object to be used.type
- The theme type to be set.- Returns:
- The theme object after setting the type.
- See Also:
-
setThemeType
Sets the type for the supplied dynamic theme object.- Type Parameters:
T
- The type of the theme object.- Parameters:
theme
- The theme object to be used.parent
- The parent theme to be used.- Returns:
- The theme object after setting the type.
- See Also:
-
setColorTypeOrColor
Sets the color type or color for the supplied dynamic object after doing the appropriate checks.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.color
- The color to be set.- See Also:
-
setContrastWithColorTypeOrColor
public static <T> void setContrastWithColorTypeOrColor(@Nullable T dynamic, int colorType, @ColorInt int color) Sets the contrast with color type or color for the supplied dynamic object after doing the appropriate checks.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.colorType
- The color type to be set.color
- The color to be set.- See Also:
-
setBackgroundAwareSafe
public static <T> void setBackgroundAwareSafe(@Nullable T dynamic, int backgroundAware, int contrast) Sets the background aware and contrast for the supplied dynamic object after doing appropriate checks.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.backgroundAware
- The background aware option to be set.contrast
- The contrast to be set.- See Also:
-
setBackgroundAwareSafe
Sets the background aware for the supplied dynamic object after doing appropriate checks.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.backgroundAware
- The background aware option to be set.- See Also:
-
isDynamicColor
Checks whether the dynamic theme object has dynamic colors enabled.- Type Parameters:
T
- The type of the theme object.- Parameters:
theme
- The theme object to be used.- Returns:
true
if the dynamic theme object has dynamic colors enabled.- See Also:
-
tint
public static <T> void tint(@Nullable T dynamic, @ColorInt int color, @ColorInt int contrastWithColor) Tint dynamic object according to the supplied colors.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.color
- The color to be set.contrastWithColor
- The contrast with color to be set.- See Also:
-
tint
Tint dynamic object according to the supplied colors.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.color
- The color to be set.- See Also:
-
tintBackground
public static <T> void tintBackground(@Nullable T dynamic, @ColorInt int contrastWithColor, @ColorInt int color, boolean borderless) Tint background according to the supplied colors.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.contrastWithColor
- The contrast with color to be considered.color
- The tint color to be applied.borderless
-true
if the view is borderless.- See Also:
-
tintBackground
public static <T> void tintBackground(@Nullable T dynamic, @ColorInt int contrastWithColor, boolean borderless) Tint background according to the supplied contrast with color.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.contrastWithColor
- The contrast with color to be considered.borderless
-true
if the view is borderless.- See Also:
-
tintBackground
Tint background according to the supplied contrast with color.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.contrastWithColor
- The contrast with color to be considered.- See Also:
-
tintBackground
Tint background according to the default contrast with color.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.- See Also:
-
tintForeground
public static <T> void tintForeground(@Nullable T dynamic, @ColorInt int contrastWithColor, @ColorInt int color, boolean borderless) Tint foreground according to the supplied colors.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.contrastWithColor
- The contrast with color to be considered.color
- The tint color to be applied.borderless
-true
if the view is borderless.- See Also:
-
tintForeground
public static <T> void tintForeground(@Nullable T dynamic, @ColorInt int contrastWithColor, boolean borderless) Tint foreground according to the supplied contrast with color.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.contrastWithColor
- The contrast with color to be considered.borderless
-true
if the view is borderless.- See Also:
-
tintForeground
Tint foreground according to the supplied contrast with color.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.contrastWithColor
- The contrast with color to be considered.- See Also:
-
tintScrollable
Tint scrollable according to the supplied contrast with color.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.contrastWithColor
- The contrast with color to be considered.- See Also:
-
tintScrollable
Tint scrollable according to the default contrast with color.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be tinted.- See Also:
-
setOnClickListener
public static <T> void setOnClickListener(@Nullable T dynamic, @Nullable View.OnClickListener onClickListener) Set on click listener for the dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.onClickListener
- The click listener to be set.- See Also:
-
setOnLongClickListener
public static <T> void setOnLongClickListener(@Nullable T dynamic, @Nullable View.OnLongClickListener onLongClickListener) Set on long click listener for the dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.onLongClickListener
- The long click listener to be set.- See Also:
-
setClickable
Set the clickable property for the dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.clickable
-true
to make it clickable.- See Also:
-
setLongClickable
Set the long clickable property for the dynamic object.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.longClickable
-true
to make it long clickable.- See Also:
-
setPreventCornerOverlap
Sets the prevent corner overlap for the supplied view.- Parameters:
view
- The view to be used.preventCornerOverlap
- The value to be set.- See Also:
-
setCorner
Sets the corner for the supplied view.- Parameters:
view
- The view to be used.corner
- The corner to be set.- See Also:
-
DynamicButton.setCorner(Integer)
DynamicNavigationView.setCorner(Float)
DynamicBottomNavigationView.setCorner(Float)
DynamicNavigationRailView.setCorner(Float)
DynamicFloatingActionButton.setCorner(Float)
DynamicCardView.setCorner(Float)
DynamicMaterialCardView.setCorner(Float)
DynamicTextInputLayout.setCorner(Float)
DynamicColorView.setCornerRadius(float)
-
setCornerMin
Sets the minimum corner value for the supplied view.- Parameters:
view
- The view to be used.cornerMax
- The maximum corner value.- See Also:
-
setForceElevation
Sets whether to force elevation for the supplied view.- Parameters:
view
- The view to be used.forceElevation
-true
to force elevation.
-
getElevation
Returns the elevation for the supplied view.- Parameters:
view
- The view to be used.defaultElevation
- The default elevation to be used.- Returns:
- The elevation for the supplied view.
-
setElevation
Sets elevation for the supplied view.- Parameters:
view
- The view to be used.elevation
- The elevation to be set.
-
setRootBackground
Sets the background for the window or root view.- Type Parameters:
T
- The type of the dynamic object.- Parameters:
dynamic
- The dynamic object to be used.color
- The color to be set.- See Also:
-
setBackground
Set background drawable for the view.- Parameters:
view
- The view to set the background.drawable
- The drawable to be set.- See Also:
-
setBackground
Set background drawable resource for the view.- Parameters:
view
- The view to set the background.drawableRes
- The drawable resource to be set.- See Also:
-
set
Set drawable for the image view and manage its visibility according to the data.- Parameters:
imageView
- The image view to set the drawable.drawable
- The drawable to be set.
-
set
Set bitmap for the image view and manage its visibility according to the data.- Parameters:
imageView
- The image view to set the drawable.bitmap
- The bitmap to be set.
-
setContentDescription
Set content description for the image view.- Parameters:
imageView
- The image view to set the content description.text
- The content description to be set.
-
set
Set text for the text view and manage its visibility according to the data.- Parameters:
textView
- The text view to set the text.text
- The text to be set.
-
set
Set text for the text view and manage its visibility according to the data.- Parameters:
textView
- The text view to set the text.text
- The text to be set.
-
set
Set rating value for the rating bar.- Parameters:
ratingBar
- The rating bar to set the rating.rating
- The rating value to be set.
-
setHtml
SetHTML
text for the text view and manage its visibility according to the data.- Parameters:
textView
- The text view to set the text.text
- The text to be set.
-
setResource
Set drawable for the image view and manage its visibility according to the data.- Parameters:
view
- The view to set the drawable.drawableRes
- The drawable resource id to be set.
-
setText
Set text for the text view and manage its visibility according to the data.- Parameters:
textView
- The text view to set the text.stringRes
- The string resource id to be set.
-
setTooltip
public static void setTooltip(@Nullable View view, @ColorInt int backgroundColor, @ColorInt int tintColor, @Nullable CharSequence text) Set tooltip for the supplied view.- Parameters:
view
- The view to be used.backgroundColor
- The background color to be set.tintColor
- The tint color to be set.text
- The tooltip text to be set.- See Also:
-
setTooltip
public static void setTooltip(@Nullable View view, @ColorInt int backgroundColor, @ColorInt int tintColor) Set tooltip for the supplied view.- Parameters:
view
- The view to be used.backgroundColor
- The background color to be set.tintColor
- The tint color to be set.- See Also:
-
setTooltip
Set tooltip for the supplied view.- Parameters:
view
- The view to be used.text
- The tooltip text to be set.- See Also:
-
setTooltip
Set tooltip for the supplied view.- Parameters:
view
- The view to be used.- See Also:
-
setClickListener
public static void setClickListener(@Nullable View view, @Nullable View.OnClickListener clickListener, boolean visibility) Set click listener for the view and manage its visibility according to the data.- Parameters:
view
- The view to set the click listener.clickListener
- The click listener to be set.visibility
-true
to manage the visibility.
-
setClickListener
public static void setClickListener(@Nullable View view, @Nullable View.OnClickListener clickListener) Set click listener for the view and manage its visibility according to the data.- Parameters:
view
- The view to set the click listener.clickListener
- The click listener to be set.
-
setVisibility
Set visibility for the view.- Parameters:
view
- The view to set the visibility.visibility
- The visibility to be set.
-
setVisibility
Set visibility for the view according to the base view.- Parameters:
view
- The view to set the visibility.base
- The view to get the visibility.
-
setEnabled
Set a view enabled or disabled.- Parameters:
view
- The view to be enabled or disabled.enabled
-true
to enable the view.
-
setAlpha
Set alpha for the view.- Parameters:
view
- The view to set the alpha.alpha
- The alpha to be set.
-
setAppBarProgressVisible
Set the visibility of app bar progress for theDynamicActivity
.- Parameters:
activity
- The activity to be used.visible
-true
to show the progress bar below the app bar.
-
showSnackbar
public static void showSnackbar(@Nullable Context activity, @Nullable CharSequence text, int duration) Show the snackbar for theDynamicSnackbar
.- Parameters:
activity
- The activity context to be used.text
- The text for the snackbar.duration
- The duration of the snackbar.BaseTransientBottomBar.LENGTH_SHORT
,BaseTransientBottomBar.LENGTH_LONG
orBaseTransientBottomBar.LENGTH_INDEFINITE
.
-
showSnackbar
Show the snackbar for theDynamicSnackbar
.- Parameters:
activity
- The activity context to be used.text
- The text for the snackbar.D
-
showSnackbar
Show the snackbar for theDynamicSnackbar
.- Parameters:
activity
- The activity context to be used.stringRes
- The string resource for the snackbar.duration
- The duration of the snackbar.BaseTransientBottomBar.LENGTH_SHORT
,BaseTransientBottomBar.LENGTH_LONG
orBaseTransientBottomBar.LENGTH_INDEFINITE
.
-
showSnackbar
Show the snackbar for theDynamicSnackbar
.- Parameters:
activity
- The activity context to be used.stringRes
- The string resource for the snackbar.
-
setBottomSheetState
Sets the bottom sheet state if present for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.bottomSheetState
- The state to be set.
-
findViewById
Try to find view for the supplied view id.- Parameters:
view
- The view to be used.viewId
- The view id to be found.- Returns:
- The view for the supplied view id.
-
setTransitionName
Sets the transition name for the supplied view.- Parameters:
view
- The view to be used.name
- The transition name to be set.
-
setTransitionResultCode
Sets the transition result code for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.transitionResultCode
- The transition result code to be set.
-
setTransitionPosition
Sets the transition position for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.transitionPosition
- The transition position to be set.
-
addSearchViewTextChangedListener
public static void addSearchViewTextChangedListener(@Nullable Context activity, @Nullable TextWatcher textWatcher) Adds the text watcher to listen search view text changes for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.textWatcher
- The search listener to be added.
-
removeSearchViewTextChangedListener
public static void removeSearchViewTextChangedListener(@Nullable Context activity, @Nullable TextWatcher textWatcher) Removes the text watcher from the search view to stop listening text changes for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.textWatcher
- The search listener to be removed.
-
expandSearchView
Expand search view to start searching for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.requestSoftInput
-true
to request the soft input keyboard.
-
collapseSearchView
Collapse search view to stop searching for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.
-
isSearchViewExpanded
Checks whether the search view is expanded for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.- Returns:
true
if search view is expanded.
-
restoreSearchViewState
Restore the search view state after the configuration change for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.
-
addHeader
public static void addHeader(@Nullable Context activity, @Nullable View view, boolean removePrevious, boolean animate) Add header view just below the app bar for theDynamicActivity
.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
activity
- The activity context to be used.view
- The view to be added in the header frame.removePrevious
-true
to remove the previously added views.animate
-true
to animate the changes.
-
addHeader
public static void addHeader(@Nullable Context activity, @Nullable View view, boolean removePrevious) Add header view just below the app bar for theDynamicActivity
.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
activity
- The activity context to be used.view
- The view to be added in the header frame.removePrevious
-true
to remove the previously added views.
-
addHeader
public static void addHeader(@Nullable Context activity, @LayoutRes int layoutRes, boolean removePrevious, boolean animate) Add header view just below the app bar for theDynamicActivity
.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
activity
- The activity context to be used.layoutRes
- The layout resource to be added in the header frame.removePrevious
-true
to remove the previously added views.animate
-true
to animate the changes.
-
addHeader
public static void addHeader(@Nullable Context activity, @LayoutRes int layoutRes, boolean removePrevious) Add header view just below the app bar for theDynamicActivity
.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
activity
- The activity context to be used.layoutRes
- The layout resource to be added in the header frame.removePrevious
-true
to remove the previously added views.
-
addBottomSheet
public static void addBottomSheet(@Nullable Context activity, @Nullable View view, boolean removePrevious) Add view in the bottom sheet frame layout for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.view
- The view to be added in the bottom sheet.removePrevious
-true
to remove the previously added views.
-
addBottomSheet
public static void addBottomSheet(@Nullable Context activity, @LayoutRes int layoutRes, boolean removePrevious) Add view in the bottom sheet frame layout for theDynamicActivity
.- Parameters:
activity
- The activity context to be used.layoutRes
- The layout resource to be added in the bottom sheet.removePrevious
-true
to remove the previously added views.
-
startMotionActivityFromFragment
public static void startMotionActivityFromFragment(@Nullable Context activity, @NonNull Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior for theDynamicActivity
.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
activity
- The activity context to be used.fragment
- The calling fragment.intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.finish
-true
to finish calling activity.afterTransition
-true
to finish the calling activity after transition.
-
startMotionActivityFromFragment
public static void startMotionActivityFromFragment(@Nullable Context activity, @NonNull Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) Called by Fragment.startActivityForResult() to implement its behavior for theDynamicActivity
.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
activity
- The activity context to be used.fragment
- The calling fragment.intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.
-
onPageScrolled
public static void onPageScrolled(@Nullable ViewPager.OnPageChangeListener pager, int position, float positionOffset, @Px int positionOffsetPixels) CallViewPager.OnPageChangeListener.onPageScrolled(int, float, int)
method for theViewPager
.- Parameters:
pager
- The view pager to be used.position
- The position index of the first page currently being displayed.Page position+1 will be visible if positionOffset is nonzero.
positionOffset
- The value from [0, 1) indicating the offset from the page at position.positionOffsetPixels
- The value in pixels indicating the offset from position.
-
onPageSelected
CallViewPager.OnPageChangeListener.onPageSelected(int)
method for theViewPager
.- Parameters:
pager
- The view pager to be used.position
- Position index of the new selected page.
-
onPageScrollStateChanged
public static void onPageScrollStateChanged(@Nullable ViewPager.OnPageChangeListener pager, int state) CallView.onScreenStateChanged(int)
method for theViewPager
.- Parameters:
pager
- The view pager to be used.state
- The new scroll state.- See Also:
-
getAppShortcutIcon
@Nullable public static Icon getAppShortcutIcon(@NonNull Context context, @DrawableRes int drawableRes, @IdRes int backgroundId, @IdRes int foregroundId, boolean theme) Returns the app shortcut icon according to the dynamic theme.- Parameters:
context
- The context to be used.drawableRes
- The drawable resource to be used.backgroundId
- The background id to be used.foregroundId
- The foreground id to be used.theme
-true
to useTheme.ColorType.PRIMARY
as background.- Returns:
- The app shortcut icon according to the dynamic theme.
-