refactor: Change Page.State to sealed interface
Some checks failed
Build app / Build app (push) Has been cancelled
Mirror Repository / mirror (push) Has been cancelled

This commit is contained in:
AwkwardPeak7 2025-05-28 09:19:42 +07:00 committed by Ahmad Ansori Palembani
parent 18528fbd92
commit 370bb62ef9
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
14 changed files with 63 additions and 66 deletions

View file

@ -19,7 +19,7 @@ open class Page(
get() = index + 1
@Transient
private val _statusFlow = MutableStateFlow(State.QUEUE)
private val _statusFlow = MutableStateFlow<State>(State.Queue)
@Transient
val statusFlow = _statusFlow.asStateFlow()
@ -48,11 +48,11 @@ open class Page(
}
}
enum class State {
QUEUE,
LOAD_PAGE,
DOWNLOAD_IMAGE,
READY,
ERROR,
sealed interface State {
data object Queue : State
data object LoadPage : State
data object DownloadImage : State
data object Ready : State
data object Error : State
}
}