Interface DynamicWidget
- All Superinterfaces:
BaseWidget
- All Known Subinterfaces:
DynamicErrorWidget
,DynamicLinkWidget
,DynamicProgressWidget
,DynamicScrollableWidget
,DynamicStateSelectedWidget
,DynamicStateWidget
,DynamicTextWidget
- All Known Implementing Classes:
ColorPalettePreference
,DynamicAppBarLayout
,DynamicAppThemePreference
,DynamicBackgroundView
,DynamicBottomAppBar
,DynamicBottomNavigationView
,DynamicButton
,DynamicCardView
,DynamicCheckBox
,DynamicCheckedTextView
,DynamicCheckPreference
,DynamicChip
,DynamicCircularProgressIndicator
,DynamicColorCompact
,DynamicColorMenu
,DynamicColorPicker
,DynamicColorPreference
,DynamicColorView
,DynamicDayThemePreference
,DynamicDivider
,DynamicDragIndicator
,DynamicDrawerLayout
,DynamicEditText
,DynamicEmptyView
,DynamicEmptyViewBig
,DynamicExtendedFloatingActionButton
,DynamicFloatingActionButton
,DynamicForegroundLinearLayout
,DynamicFrameLayout
,DynamicGridView
,DynamicHeader
,DynamicHeaderDialog
,DynamicHeaderImageView
,DynamicHorizontalScrollView
,DynamicHueSeekBar
,DynamicHueSlider
,DynamicImageButton
,DynamicImagePreference
,DynamicImageView
,DynamicInfoView
,DynamicInfoViewBig
,DynamicInfoViewBigAuthor
,DynamicItemView
,DynamicItemViewDialog
,DynamicLinearLayout
,DynamicLinearLayoutCompat
,DynamicLinearProgressIndicator
,DynamicListView
,DynamicLocalePreference
,DynamicMaterialCardView
,DynamicMaterialSwitch
,DynamicNavigationMenuItemView
,DynamicNavigationRailView
,DynamicNavigationView
,DynamicNestedGridView
,DynamicNestedListView
,DynamicNestedScrollView
,DynamicNightThemePreference
,DynamicPopupBackground
,DynamicPreference
,DynamicProgressBar
,DynamicRadioButton
,DynamicRangeSlider
,DynamicRatingBar
,DynamicRecyclerView
,DynamicRelativeLayout
,DynamicRemoteThemePreference
,DynamicRemoteThemePreview
,DynamicScreenPreference
,DynamicScrollView
,DynamicSeekBar
,DynamicSeekBarCompact
,DynamicSeekBarHue
,DynamicSeekBarPreference
,DynamicShadowDivider
,DynamicSimplePreference
,DynamicSlider
,DynamicSliderCompact
,DynamicSliderFloat
,DynamicSliderHue
,DynamicSliderPreference
,DynamicSpinner
,DynamicSpinnerPreference
,DynamicSpinnerView
,DynamicSpinnerViewDialog
,DynamicSwipeRefreshLayout
,DynamicSwitchCompat
,DynamicTabLayout
,DynamicTextInputEditText
,DynamicTextInputLayout
,DynamicTextView
,DynamicThemePreference
,DynamicThemePreview
,DynamicThemeVersionPreference
,DynamicToastPreference
,DynamicToolbar
,DynamicView
,DynamicViewPager
,DynamicViewPager2Layout
,ThemeAppShortcutsPreference
,ThemeCheckPreference
,ThemeNavigationBarPreference
,ThemePreference
,ThemePreview
,ThemeReceiverPreference
Interface to create dynamic widgets which can be tinted according to the
DynamicTheme
.-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the background aware functionality used by this widget.int
getColor()
Returns the value of color applied to this widget.int
getColor
(boolean resolve) Returns the value of color applied to this widget.int
Returns the color type applied to this widget.int
Get the contrast value used by this widget.int
getContrast
(boolean resolve) Get the contrast value used by this widget.float
Returns the contrast ratio for by this widget.int
Returns the value of contrast with color applied to this widget.int
Returns the contrast with color type applied to this widget.boolean
Checks whether the background aware functionality is enabled.void
setBackgroundAware
(int backgroundAware) Set the value to make this widget background aware or not.void
setColor()
Set color for this widget according to the supplied values.void
setColor
(int color) Set the value of color for this widget.void
setColorType
(int colorType) Set the color type to this widget.void
setContrast
(int contrast) Set the contrast value used for this widget.void
setContrastWithColor
(int contrastWithColor) Set the value of contrast with color for this widget.void
setContrastWithColorType
(int contrastWithColorType) Set the contrast with color type to this widget.void
setEnabled
(boolean enabled) Override this method to handle state changes for this widget.Methods inherited from interface com.pranavpandey.android.dynamic.support.widget.base.BaseWidget
initialize, loadFromAttributes
-
Method Details
-
getColorType
int getColorType()Returns the color type applied to this widget.- Returns:
- The color type applied to this widget.
- See Also:
-
setColorType
void setColorType(int colorType) Set the color type to this widget.- Parameters:
colorType
- The color type for this widget.- See Also:
-
getContrastWithColorType
int getContrastWithColorType()Returns the contrast with color type applied to this widget.- Returns:
- The contrast with color type applied to this widget.
- See Also:
-
setContrastWithColorType
void setContrastWithColorType(int contrastWithColorType) Set the contrast with color type to this widget.- Parameters:
contrastWithColorType
- The contrast with color type for this widget.- See Also:
-
getColor
Returns the value of color applied to this widget.- Parameters:
resolve
-true
to resolve the applied color.- Returns:
- The value of color applied to this widget.
-
getColor
Returns the value of color applied to this widget.- Returns:
- The value of color applied to this widget.
-
setColor
Set the value of color for this widget.- Parameters:
color
- Color for this widget.
-
getContrastWithColor
Returns the value of contrast with color applied to this widget.- Returns:
- The value of contrast with color applied to this widget.
-
setContrastWithColor
Set the value of contrast with color for this widget.- Parameters:
contrastWithColor
- Contrast with color for this widget.
-
getBackgroundAware
int getBackgroundAware()Returns the background aware functionality used by this widget.- Returns:
- The background aware functionality used by this widget.
-
isBackgroundAware
boolean isBackgroundAware()Checks whether the background aware functionality is enabled.- Returns:
true
if this widget changes color according to the background.
-
setBackgroundAware
void setBackgroundAware(int backgroundAware) Set the value to make this widget background aware or not.- Parameters:
backgroundAware
- The background aware functionality to be set.
-
getContrast
int getContrast(boolean resolve) Get the contrast value used by this widget.- Parameters:
resolve
-true
to resolve auto contrast.- Returns:
- The contrast value used by this widget.
-
getContrast
int getContrast()Get the contrast value used by this widget.- Returns:
- The contrast value used by this widget.
-
getContrastRatio
float getContrastRatio()Returns the contrast ratio for by this widget.- Returns:
- The contrast ratio for by this widget.
-
setContrast
void setContrast(int contrast) Set the contrast value used for this widget.- Parameters:
contrast
- The contrast value to be set.
-
setEnabled
void setEnabled(boolean enabled) Override this method to handle state changes for this widget.For example, change alpha according to the enabled or disabled state of this widget.
- Parameters:
enabled
-true
if this widget is enabled and can receive click events.
-
setColor
void setColor()Set color for this widget according to the supplied values.
-