diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt index 122e081a5..deb95aa95 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt @@ -1,12 +1,15 @@ package eu.kanade.tachiyomi.ui.manga.track +import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import eu.kanade.tachiyomi.R +import eu.kanade.tachiyomi.databinding.TrackItemBinding import eu.kanade.tachiyomi.util.view.inflate class TrackAdapter(controller: TrackController) : RecyclerView.Adapter() { + private lateinit var binding: TrackItemBinding + var items = emptyList() set(value) { if (field !== value) { @@ -26,8 +29,8 @@ class TrackAdapter(controller: TrackController) : RecyclerView.Adapter 0) track.total_chapters else "-" - track_status.text = item.service.getStatus(track.status) - track_score.text = if (track.score == 0f) "-" else item.service.displayScore(track) + binding.trackStatus.text = item.service.getStatus(track.status) + binding.trackScore.text = if (track.score == 0f) "-" else item.service.displayScore(track) if (item.service.supportsReadingDates) { - track_start_date.text = + binding.trackStartDate.text = if (track.started_reading_date != 0L) dateFormat.format(track.started_reading_date) else "-" - track_finish_date.text = + binding.trackFinishDate.text = if (track.finished_reading_date != 0L) dateFormat.format(track.finished_reading_date) else "-" } else { - bottom_divider.gone() - vert_divider_3.gone() - track_start_date.gone() - track_finish_date.gone() + binding.bottomDivider.gone() + binding.vertDivider3.gone() + binding.trackStartDate.gone() + binding.trackFinishDate.gone() } } }