Created
April 16, 2018 15:41
-
-
Save n-belokopytov/b67db2efdeea92e0d6fc3c2c26324109 to your computer and use it in GitHub Desktop.
A state object implemented with Kotlin's sealed classes
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
sealed class TabbedListState | |
class InProgressState : TabbedListState() | |
class FinishedState : TabbedListState() | |
data class ErrorState(val errorMessage: String, | |
val errorColor: Int) : TabbedListState() | |
data class ListState(val listElements: List<Element>, | |
val totalItems: Int, | |
val currentTabId: Int, | |
val tabs: List<TabElement>) : TabbedListState() | |
data class OfflineState(val listElements: List<Element>) : TabbedListState() | |
class Element | |
class TabElement |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment