ColorFilterDimmer

public final class ColorFilterDimmer
extends Object

java.lang.Object
   ↳ androidx.leanback.graphics.ColorFilterDimmer


Helper class for applying a dim level to a View. The ColorFilterDimmer uses a ColorFilter in a Paint object to dim the view according to the currently active level.

Summary

Public methods

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.

Inherited methods

Public methods

applyFilterToView

public void applyFilterToView (View view)

Apply current the ColorFilter to a View. This method will set the hardware layer of the view when applying a filter, and remove it when not applying a filter.

Parameters
view View: The View to apply the ColorFilter to.

create