NewPipe/app/src/main/java/org/schabi/newpipe/local/feed/FeedState.kt

25 lines
668 B
Kotlin
Raw Normal View History

package org.schabi.newpipe.local.feed
import androidx.annotation.StringRes
2020-05-01 20:13:01 +02:00
import java.util.Calendar
2020-05-01 20:13:21 +02:00
import org.schabi.newpipe.extractor.stream.StreamInfoItem
sealed class FeedState {
data class ProgressState(
2020-05-01 20:13:21 +02:00
val currentProgress: Int = -1,
val maxProgress: Int = -1,
@StringRes val progressMessage: Int = 0
) : FeedState()
data class LoadedState(
2020-05-01 20:13:21 +02:00
val items: List<StreamInfoItem>,
val oldestUpdate: Calendar? = null,
val notLoadedCount: Long,
val itemsErrors: List<Throwable> = emptyList()
) : FeedState()
data class ErrorState(
2020-05-01 20:13:21 +02:00
val error: Throwable? = null
) : FeedState()
2020-05-01 20:13:01 +02:00
}