2019-04-28 20:43:54 +00:00
|
|
|
package org.schabi.newpipe.local.feed
|
|
|
|
|
|
|
|
import androidx.annotation.StringRes
|
2020-04-05 14:11:03 +00:00
|
|
|
import org.schabi.newpipe.local.feed.item.StreamItem
|
2020-12-20 04:23:05 +00:00
|
|
|
import java.time.OffsetDateTime
|
2019-04-28 20:43:54 +00:00
|
|
|
|
|
|
|
sealed class FeedState {
|
2019-12-16 07:36:04 +00:00
|
|
|
data class ProgressState(
|
2020-05-01 18:13:21 +00:00
|
|
|
val currentProgress: Int = -1,
|
|
|
|
val maxProgress: Int = -1,
|
|
|
|
@StringRes val progressMessage: Int = 0
|
2019-12-16 07:36:04 +00:00
|
|
|
) : FeedState()
|
|
|
|
|
|
|
|
data class LoadedState(
|
2020-04-05 14:11:03 +00:00
|
|
|
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>
|
2019-12-16 07:36:04 +00:00
|
|
|
) : FeedState()
|
|
|
|
|
|
|
|
data class ErrorState(
|
2020-05-01 18:13:21 +00:00
|
|
|
val error: Throwable? = null
|
2019-12-16 07:36:04 +00:00
|
|
|
) : FeedState()
|
2020-05-01 18:13:01 +00:00
|
|
|
}
|