public final class ColorFilterDimmer extends Object
Modifier and Type | Method and Description |
---|---|
void |
applyFilterToView(View view)
Apply current the ColorFilter to a View.
|
static ColorFilterDimmer |
create(ColorFilterCache dimmer,
float activeLevel,
float dimmedLevel)
Creates a ColorFilterDimmer for the given color and levels..
|
static ColorFilterDimmer |
createDefault(Context context)
Creates a default ColorFilterDimmer.
|
ColorFilter |
getColorFilter()
Gets the ColorFilter set to the current dim level.
|
Paint |
getPaint()
Gets the Paint object set to the current dim level.
|
void |
setActiveLevel(float level)
Sets the active level of the dimmer.
|
public static ColorFilterDimmer createDefault(Context context)
context
- A Context used to retrieve Resources.public static ColorFilterDimmer create(ColorFilterCache dimmer, float activeLevel, float dimmedLevel)
dimmer
- The ColorFilterCache for dim color.activeLevel
- The level of dimming when the View is in its active
state. Must be a float value between 0.0 and 1.0.dimmedLevel
- The level of dimming when the View is in its dimmed
state. Must be a float value between 0.0 and 1.0.public void applyFilterToView(View view)
view
- The View to apply the ColorFilter to.public void setActiveLevel(float level)
level
- A float between 0 (fully dim) and 1 (fully active).public ColorFilter getColorFilter()
public Paint getPaint()