From 915e38f636e2fba9ae53ee8d87026ea1e0edacf3 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 24 Jun 2022 12:06:43 -0400 Subject: [PATCH] Fix crashes from KTX extension changes --- .../ui/browse/source/browse/BrowseSourceController.kt | 3 +-- .../tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt | 3 +-- .../kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt | 4 +--- .../java/eu/kanade/tachiyomi/widget/MaterialSpinnerView.kt | 6 ++++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt index fe33d9a85..f9915e110 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt @@ -8,7 +8,6 @@ import android.view.MenuInflater import android.view.MenuItem import android.view.View import android.view.ViewGroup -import androidx.core.view.get import androidx.core.view.isVisible import androidx.core.view.updatePadding import androidx.recyclerview.widget.GridLayoutManager @@ -203,7 +202,7 @@ open class BrowseSourceController(bundle: Bundle) : numColumnsJob?.cancel() var oldPosition = RecyclerView.NO_POSITION - val oldRecycler = binding.catalogueView[1] + val oldRecycler = binding.catalogueView.getChildAt(1) if (oldRecycler is RecyclerView) { oldPosition = (oldRecycler.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition() oldRecycler.adapter = null diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt index b0c8b0965..bcda39e8d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt @@ -6,7 +6,6 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import androidx.core.view.get import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.databinding.SourceFilterSheetBinding @@ -56,7 +55,7 @@ class SourceFilterSheet( init { recycler.adapter = adapter recycler.setHasFixedSize(true) - (binding.root[1] as ViewGroup).addView(recycler) + (binding.root.getChildAt(1) as ViewGroup).addView(recycler) addView(binding.root) binding.filterBtn.setOnClickListener { onFilterClicked() } binding.resetBtn.setOnClickListener { onResetClicked() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt index 47bf4d800..146a22994 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt @@ -245,9 +245,8 @@ class MangaFullCoverDialog : FullComposeController