Clean up RecentMangaAdapter

This commit is contained in:
Jays2Kings 2023-03-04 18:51:06 -05:00
parent 80732700fc
commit b11318f249
3 changed files with 4 additions and 9 deletions

View file

@ -28,7 +28,6 @@ class RecentMangaAdapter(val delegate: RecentsInterface) :
var uniformCovers = preferences.uniformGrid().get()
var showOutline = preferences.outlineOnCovers().get()
var sortByFetched = preferences.sortFetchedTime().get()
var isSearching = false
private var collapseGroupedUpdates = preferences.collapseGroupedUpdates().get()
private var collapseGroupedHistory = preferences.collapseGroupedHistory().get()
val collapseGrouped: Boolean

View file

@ -217,7 +217,8 @@ class RecentMangaHolder(
)
}
binding.showMoreChapters.isVisible = item.mch.extraChapters.isNotEmpty() && !adapter.isSearching
binding.showMoreChapters.isVisible = item.mch.extraChapters.isNotEmpty() &&
!adapter.delegate.isSearching()
binding.moreChaptersLayout.isVisible = item.mch.extraChapters.isNotEmpty() &&
adapter.delegate.areExtraChaptersExpanded(flexibleAdapterPosition)
val moreVisible = binding.moreChaptersLayout.isVisible

View file

@ -107,9 +107,7 @@ class RecentsController(bundle: Bundle? = null) :
retainViewMode = RetainViewMode.RETAIN_DETACH
}
/**
* Adapter containing the recent manga.
*/
/** Adapter containing the recent manga. */
private lateinit var adapter: RecentMangaAdapter
var displaySheet: TabbedRecentsOptionsSheet? = null
@ -118,7 +116,7 @@ class RecentsController(bundle: Bundle? = null) :
private var snack: Snackbar? = null
private var lastChapterId: Long? = null
private var showingDownloads = false
var headerHeight = 0
private var headerHeight = 0
private var ogRadius = 0f
private var deviceRadius = 0f to 0f
@ -126,9 +124,6 @@ class RecentsController(bundle: Bundle? = null) :
set(value) {
field = value
presenter.query = value
if (this::adapter.isInitialized) {
adapter.isSearching = value.isNotBlank()
}
}
override val mainRecycler: RecyclerView