-
public class FadingEdgesFadingEdges applies a horizontal fade to the edges of the chart area for scrollable charts. This effect indicates that there’s more content beyond a given edge, and the user can scroll to reveal it.
-
-
Field Summary
Fields Modifier and Type Field Description private FloatstartEdgeWidthDpprivate FloatendEdgeWidthDpprivate FloatvisibilityThresholdDpprivate TimeInterpolatorvisibilityInterpolator
-
Constructor Summary
Constructors Constructor Description FadingEdges(Float edgeWidthDp, Float visibilityThresholdDp, TimeInterpolator visibilityInterpolator)Creates a FadingEdges instance with fading edges of equal width. FadingEdges(Float startEdgeWidthDp, Float endEdgeWidthDp, Float visibilityThresholdDp, TimeInterpolator visibilityInterpolator)
-
Method Summary
Modifier and Type Method Description final FloatgetStartEdgeWidthDp()final UnitsetStartEdgeWidthDp(Float startEdgeWidthDp)final FloatgetEndEdgeWidthDp()final UnitsetEndEdgeWidthDp(Float endEdgeWidthDp)final FloatgetVisibilityThresholdDp()final UnitsetVisibilityThresholdDp(Float visibilityThresholdDp)final TimeInterpolatorgetVisibilityInterpolator()final UnitsetVisibilityInterpolator(TimeInterpolator visibilityInterpolator)final UnitapplyFadingEdges(ChartDrawContext context, RectF bounds)Applies fading edges inside of the given bounds accordingly to the scroll state. -
-
Constructor Detail
-
FadingEdges
FadingEdges(Float edgeWidthDp, Float visibilityThresholdDp, TimeInterpolator visibilityInterpolator)
Creates a FadingEdges instance with fading edges of equal width.- Parameters:
edgeWidthDp- the width of the fade overlay (in dp).visibilityThresholdDp- the scroll distance over which the overlays fade in and out (in dp).visibilityInterpolator- used for the fading edges’ fade-in and fade-out animations.
-
FadingEdges
FadingEdges(Float startEdgeWidthDp, Float endEdgeWidthDp, Float visibilityThresholdDp, TimeInterpolator visibilityInterpolator)
- Parameters:
startEdgeWidthDp- the width of the fade overlay for the start edge (in dp).endEdgeWidthDp- the width of the fade overlay for the end edge (in dp).visibilityThresholdDp- the scroll distance over which the overlays fade in and out (in dp).visibilityInterpolator- used for the fading edges’ fade-in and fade-out animations.
-
-
Method Detail
-
getStartEdgeWidthDp
final Float getStartEdgeWidthDp()
-
setStartEdgeWidthDp
final Unit setStartEdgeWidthDp(Float startEdgeWidthDp)
- Parameters:
startEdgeWidthDp- the width of the fade overlay for the start edge (in dp).
-
getEndEdgeWidthDp
final Float getEndEdgeWidthDp()
-
setEndEdgeWidthDp
final Unit setEndEdgeWidthDp(Float endEdgeWidthDp)
- Parameters:
endEdgeWidthDp- the width of the fade overlay for the end edge (in dp).
-
getVisibilityThresholdDp
final Float getVisibilityThresholdDp()
-
setVisibilityThresholdDp
final Unit setVisibilityThresholdDp(Float visibilityThresholdDp)
- Parameters:
visibilityThresholdDp- the scroll distance over which the overlays fade in and out (in dp).
-
getVisibilityInterpolator
final TimeInterpolator getVisibilityInterpolator()
-
setVisibilityInterpolator
final Unit setVisibilityInterpolator(TimeInterpolator visibilityInterpolator)
- Parameters:
visibilityInterpolator- used for the fading edges’ fade-in and fade-out animations.
-
applyFadingEdges
final Unit applyFadingEdges(ChartDrawContext context, RectF bounds)
Applies fading edges inside of the given bounds accordingly to the scroll state.
- Parameters:
context- the drawing context that holds the information necessary to draw the fading edges.bounds- the bounds within which the fading edges will be drawn.
-
-
-
-