add up next to home screen

for now up next will show the series and not play the actual episode
This commit is contained in:
2022-01-05 00:28:49 +01:00
parent d5d70e49d2
commit 188d0d9162
8 changed files with 99 additions and 58 deletions

View File

@ -1,6 +1,8 @@
package org.mosad.teapod.util
import android.widget.TextView
import org.mosad.teapod.parser.crunchyroll.Collection
import org.mosad.teapod.parser.crunchyroll.ContinueWatchingList
fun TextView.setDrawableTop(drawable: Int) {
this.setCompoundDrawablesWithIntrinsicBounds(0, drawable, 0, 0)
@ -9,3 +11,18 @@ fun TextView.setDrawableTop(drawable: Int) {
fun <T> concatenate(vararg lists: List<T>): List<T> {
return listOf(*lists).flatten()
}
// TODO move to correct location
fun Collection.toItemMediaList(): List<ItemMedia> {
return this.items.map {
ItemMedia(it.id, it.title, it.images.poster_wide[0][0].source)
}
}
fun ContinueWatchingList.toItemMediaList(): List<ItemMedia> {
return this.items.map {
// TODO add season and episode to title
ItemMedia(it.panel.episodeMetadata.seriesId, it.panel.title, it.panel.images.thumbnail[0][0].source)
}
}