Created
December 10, 2021 13:02
-
-
Save suzukieng/fdd4999b98d385f7d2d06b0c2d5964fd to your computer and use it in GitHub Desktop.
UiState.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Encapsulation of UI state | |
*/ | |
data class UiState( | |
val connected: Boolean, | |
val statusMessage: String, | |
val window1Open: Boolean?, | |
val window2Open: Boolean?, | |
val window3Open: Boolean?, | |
val window4Open: Boolean?, | |
val messageCount: Int | |
) { | |
val incompleteSensorData | |
get() = | |
window1Open == null || window2Open == null || window3Open == null || window4Open == null | |
val anyWindowIsOpen | |
get() = | |
window1Open == true || window2Open == true || window3Open == true || window4Open == true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment