add Episode watched callback

This commit is contained in:
2020-10-13 23:47:48 +02:00
parent cbfd186686
commit 03cd42773d
4 changed files with 47 additions and 8 deletions

View File

@ -31,7 +31,8 @@ data class Episode(
var description: String = "",
var shortDesc: String = "",
var number: Int = 0,
var watched: Boolean = false
var watched: Boolean = false,
var watchedCallback: String = ""
)
data class TMDBResponse(

View File

@ -40,6 +40,10 @@ class EpisodesAdapter(private val episodes: List<Episode>, private val context:
return episodes.size
}
fun updateWatchedState(watched: Boolean, position: Int) {
episodes[position].watched = watched
}
inner class MyViewHolder(val view: View) : RecyclerView.ViewHolder(view) {
init {
view.setOnClickListener {