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

25 lines
650 B
Kotlin
Raw Normal View History

package org.schabi.newpipe.local.feed
import androidx.annotation.StringRes
import org.schabi.newpipe.local.feed.item.StreamItem
import java.time.OffsetDateTime
sealed class FeedState {
data class ProgressState(
2020-05-01 18:13:21 +00:00
val currentProgress: Int = -1,
val maxProgress: Int = -1,
@StringRes val progressMessage: Int = 0
) : FeedState()
data class LoadedState(
val items: List<StreamItem>,
2023-04-25 16:06:51 +00:00
val oldestUpdate: OffsetDateTime?,
2020-05-01 18:13:21 +00:00
val notLoadedCount: Long,
2023-04-25 16:06:51 +00:00
val itemsErrors: List<Throwable>
) : FeedState()
data class ErrorState(
2020-05-01 18:13:21 +00:00
val error: Throwable? = null
) : FeedState()
2020-05-01 18:13:01 +00:00
}