Omkar Amberkar
rememberSaveable
@OptIn(FlowPreview::class) class SkipState( scope: CoroutineScope, initialCachedSkipDeltaMs: Int, ) { private var cachedSkipDeltaMs = initialCachedSkipDeltaMs private val sharedFlow = MutableSharedFlow<Int>(extraBufferCapacity = 1) private var _skipValue = MutableStateFlow<SkipValue>(SkipValue.Unknown) val skipValue = _skipValue.asStateFlow() init { sharedFlow ... .launchIn(scope) } fun skipBack() { ... } fun skipForward() { ... } private fun skipInProgress(skipDeltaMs: Int) { ... } private fun skipCompleted(skipDeltaMs: Int) { ... } }
A modern programming language that makes developers happier.