diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt index 0f1ea754e..939113b9c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt @@ -81,11 +81,11 @@ class DownloadHolder(private val view: View, val adapter: DownloadAdapter) : private fun showPopupMenu(view: View) { view.popupMenu(R.menu.download_single, { - findItem(R.id.move_to_top).isVisible = adapterPosition != 0 + findItem(R.id.move_to_top).isVisible = bindingAdapterPosition != 0 findItem(R.id.move_to_bottom).isVisible = - adapterPosition != adapter.itemCount - 1 + bindingAdapterPosition != adapter.itemCount - 1 }, { - adapter.downloadItemListener.onMenuItemClick(adapterPosition, this) + adapter.downloadItemListener.onMenuItemClick(bindingAdapterPosition, this) true }) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt index 6e3d66766..53f2b5b7c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt @@ -30,7 +30,7 @@ class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) : init { ext_button.setOnClickListener { - adapter.buttonClickListener.onButtonClick(adapterPosition) + adapter.buttonClickListener.onButtonClick(bindingAdapterPosition) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt index c34ea614d..4a8a59ad9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt @@ -18,12 +18,12 @@ class TrackHolder(view: View, adapter: TrackAdapter) : BaseViewHolder(view) { init { val listener = adapter.rowClickListener - logo_container.setOnClickListener { listener.onLogoClick(adapterPosition) } - track_set.setOnClickListener { listener.onSetClick(adapterPosition) } - track_title.setOnClickListener { listener.onSetClick(adapterPosition) } - track_status.setOnClickListener { listener.onStatusClick(adapterPosition) } - track_chapters.setOnClickListener { listener.onChaptersClick(adapterPosition) } - track_score.setOnClickListener { listener.onScoreClick(adapterPosition) } + logo_container.setOnClickListener { listener.onLogoClick(bindingAdapterPosition) } + track_set.setOnClickListener { listener.onSetClick(bindingAdapterPosition) } + track_title.setOnClickListener { listener.onSetClick(bindingAdapterPosition) } + track_status.setOnClickListener { listener.onStatusClick(bindingAdapterPosition) } + track_chapters.setOnClickListener { listener.onChaptersClick(bindingAdapterPosition) } + track_score.setOnClickListener { listener.onScoreClick(bindingAdapterPosition) } } @SuppressLint("SetTextI18n") diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt index b6de462ee..1a053e954 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt @@ -29,7 +29,7 @@ class SourceHolder(view: View, override val adapter: SourceAdapter) : source_latest.gone() source_browse.setText(R.string.select) source_browse.setOnClickListener { - adapter.selectClickListener?.onSelectClick(adapterPosition) + adapter.selectClickListener?.onSelectClick(bindingAdapterPosition) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesHolder.kt index b5a52a9a8..d8beb1f13 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesHolder.kt @@ -37,7 +37,7 @@ class UpdatesHolder(private val view: View, private val adapter: UpdatesAdapter) init { manga_cover.setOnClickListener { - adapter.coverClickListener.onCoverClick(adapterPosition) + adapter.coverClickListener.onCoverClick(bindingAdapterPosition) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt index ec58cf8f3..3388f85a3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt @@ -28,11 +28,11 @@ class SourceHolder(view: View, override val adapter: SourceAdapter) : init { source_browse.setOnClickListener { - adapter.browseClickListener.onBrowseClick(adapterPosition) + adapter.browseClickListener.onBrowseClick(bindingAdapterPosition) } source_latest.setOnClickListener { - adapter.latestClickListener.onLatestClick(adapterPosition) + adapter.latestClickListener.onLatestClick(bindingAdapterPosition) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt index 4ffe3a85c..0721da28e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt @@ -446,7 +446,7 @@ open class BrowseSourceController(bundle: Bundle) : val adapter = adapter ?: return null adapter.allBoundViewHolders.forEach { holder -> - val item = adapter.getItem(holder.adapterPosition) as? SourceItem + val item = adapter.getItem(holder.bindingAdapterPosition) as? SourceItem if (item != null && item.manga.id!! == manga.id!!) { return holder as SourceHolder } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchAdapter.kt index c65dc7945..ecf15d199 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchAdapter.kt @@ -48,7 +48,7 @@ class GlobalSearchAdapter(val controller: GlobalSearchController) : * @param outState The bundle where the state is saved. */ private fun saveHolderState(holder: RecyclerView.ViewHolder, outState: Bundle) { - val key = "holder_${holder.adapterPosition}" + val key = "holder_${holder.bindingAdapterPosition}" val holderState = SparseArray() holder.itemView.saveHierarchyState(holderState) outState.putSparseParcelableArray(key, holderState) @@ -60,7 +60,7 @@ class GlobalSearchAdapter(val controller: GlobalSearchController) : * @param holder The holder to restore. */ private fun restoreHolderState(holder: RecyclerView.ViewHolder) { - val key = "holder_${holder.adapterPosition}" + val key = "holder_${holder.bindingAdapterPosition}" val holderState = bundle.getSparseParcelableArray(key) if (holderState != null) { holder.itemView.restoreHierarchyState(holderState) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardHolder.kt index cfd36f865..0cb9f69e5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardHolder.kt @@ -17,13 +17,13 @@ class GlobalSearchCardHolder(view: View, adapter: GlobalSearchCardAdapter) : init { // Call onMangaClickListener when item is pressed. itemView.setOnClickListener { - val item = adapter.getItem(adapterPosition) + val item = adapter.getItem(bindingAdapterPosition) if (item != null) { adapter.mangaClickListener.onMangaClick(item.manga) } } itemView.setOnLongClickListener { - val item = adapter.getItem(adapterPosition) + val item = adapter.getItem(bindingAdapterPosition) if (item != null) { adapter.mangaClickListener.onMangaLongClick(item.manga) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt index 5205a2c04..7e19e1de0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt @@ -163,7 +163,7 @@ open class GlobalSearchController( val adapter = adapter ?: return null adapter.allBoundViewHolders.forEach { holder -> - val item = adapter.getItem(holder.adapterPosition) + val item = adapter.getItem(holder.bindingAdapterPosition) if (item != null && source.id == item.source.id) { return holder as GlobalSearchHolder } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchHolder.kt index 8fb28fcee..54e8b5103 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchHolder.kt @@ -85,7 +85,7 @@ class GlobalSearchHolder(view: View, val adapter: GlobalSearchAdapter) : */ private fun getHolder(manga: Manga): GlobalSearchCardHolder? { mangaAdapter.allBoundViewHolders.forEach { holder -> - val item = mangaAdapter.getItem(holder.adapterPosition) + val item = mangaAdapter.getItem(holder.bindingAdapterPosition) if (item != null && item.manga.id!! == manga.id!!) { return holder as GlobalSearchCardHolder }