FadingEdges

open class FadingEdges(var startEdgeWidthDp: Float = FADING_EDGE_WIDTH_DP, var endEdgeWidthDp: Float = startEdgeWidthDp, var visibilityThresholdDp: Float = FADING_EDGE_VISIBILITY_THRESHOLD_DP, var visibilityInterpolator: TimeInterpolator = AccelerateDecelerateInterpolator())

FadingEdges 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.

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. This is a mapping of the degree to which visibilityThresholdDp has been satisfied to the opacity of the fading edges.

Constructors

Link copied to clipboard
constructor(edgeWidthDp: Float = FADING_EDGE_WIDTH_DP, visibilityThresholdDp: Float = FADING_EDGE_VISIBILITY_THRESHOLD_DP, visibilityInterpolator: TimeInterpolator = AccelerateDecelerateInterpolator())

Creates a FadingEdges instance with fading edges of equal width.

constructor(startEdgeWidthDp: Float = FADING_EDGE_WIDTH_DP, endEdgeWidthDp: Float = startEdgeWidthDp, visibilityThresholdDp: Float = FADING_EDGE_VISIBILITY_THRESHOLD_DP, visibilityInterpolator: TimeInterpolator = AccelerateDecelerateInterpolator())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun applyFadingEdges(context: ChartDrawContext, bounds: RectF)

Applies fading edges inside of the given bounds accordingly to the scroll state.