BPMState

data class BPMState(val startText: String = "Start tapping", val keepText: String = " Keep tapping", val display: String = startText, val pickerVisibility: Boolean = false, val startTime: Long = 0, val elapsed: Long = 0, val times: Queue<Long> = ArrayDeque(), val weights: List<Float> = listOf(0.001f, 0.001f, 0.005f, 0.01f, 0.025f, 0.05f, 0.1f, 0.5f, 1f, 1f))

The backing state of the MainViewModel.

Parameters

startText

The "start" stringResource that is displayed before any tapping has occurred.

keepText

The "keep" stringResource that is displayed between the first and third taps.

display

The text shown in the Text composable with the "reading" contentDescription semantic modifier.

pickerVisibility

Whether or not the color picker is showing color options.

startTime

The time since the last tap.

elapsed

The time between the last 2 taps.

times

A Queue of elapsed times used for the display.

weights

How much recently remembered elapsed times contribute to the current display. The size of this determines how many times are remembered.

Constructors

Link copied to clipboard
constructor(startText: String = "Start tapping", keepText: String = " Keep tapping", display: String = startText, pickerVisibility: Boolean = false, startTime: Long = 0, elapsed: Long = 0, times: Queue<Long> = ArrayDeque(), weights: List<Float> = listOf(0.001f, 0.001f, 0.005f, 0.01f, 0.025f, 0.05f, 0.1f, 0.5f, 1f, 1f))

Properties

Link copied to clipboard
Link copied to clipboard
val elapsed: Long = 0
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val startTime: Long = 0
Link copied to clipboard
Link copied to clipboard