2019-04-28 22:43:54 +02:00
|
|
|
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
|
2019-04-28 22:43:54 +02:00
|
|
|
|
|
|
|
sealed class FeedState {
|
2019-12-16 08:36:04 +01:00
|
|
|
data class ProgressState(
|
2020-05-01 20:13:21 +02:00
|
|
|
val currentProgress: Int = -1,
|
|
|
|
val maxProgress: Int = -1,
|
|
|
|
@StringRes val progressMessage: Int = 0
|
2019-12-16 08:36:04 +01:00
|
|
|
) : 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()
|
2019-12-16 08:36:04 +01:00
|
|
|
) : FeedState()
|
|
|
|
|
|
|
|
data class ErrorState(
|
2020-05-01 20:13:21 +02:00
|
|
|
val error: Throwable? = null
|
2019-12-16 08:36:04 +01:00
|
|
|
) : FeedState()
|
2020-05-01 20:13:01 +02:00
|
|
|
}
|