mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fixes to locked manga details page when it shouldnt be
This commit is contained in:
parent
6bc1b20529
commit
59e83f3e91
3 changed files with 11 additions and 5 deletions
|
@ -130,7 +130,8 @@ class MangaDetailsController :
|
|||
manga: Manga?,
|
||||
fromCatalogue: Boolean = false,
|
||||
smartSearchConfig: BrowseController.SmartSearchConfig? = null,
|
||||
update: Boolean = false
|
||||
update: Boolean = false,
|
||||
shouldLockIfNeeded: Boolean = false,
|
||||
) : super(
|
||||
Bundle().apply {
|
||||
putLong(MANGA_EXTRA, manga?.id ?: 0)
|
||||
|
@ -143,6 +144,7 @@ class MangaDetailsController :
|
|||
if (manga != null) {
|
||||
source = Injekt.get<SourceManager>().getOrStub(manga.source)
|
||||
}
|
||||
this.shouldLockIfNeeded = shouldLockIfNeeded
|
||||
presenter = MangaDetailsPresenter(manga!!, source!!)
|
||||
}
|
||||
|
||||
|
@ -169,6 +171,7 @@ class MangaDetailsController :
|
|||
private var headerColor: Int? = null
|
||||
private var toolbarIsColored = false
|
||||
private var snack: Snackbar? = null
|
||||
val shouldLockIfNeeded: Boolean
|
||||
val fromCatalogue = args.getBoolean(FROM_CATALOGUE_EXTRA, false)
|
||||
private var trackingBottomSheet: TrackingBottomSheet? = null
|
||||
private var startingRangeChapterPos: Int? = null
|
||||
|
@ -535,7 +538,7 @@ class MangaDetailsController :
|
|||
//region Lifecycle methods
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
super.onActivityResumed(activity)
|
||||
presenter.isLockedFromSearch = SecureActivityDelegate.shouldBeLocked()
|
||||
presenter.isLockedFromSearch = shouldLockIfNeeded && SecureActivityDelegate.shouldBeLocked()
|
||||
presenter.headerItem.isLocked = presenter.isLockedFromSearch
|
||||
manga!!.thumbnail_url = presenter.refreshMangaFromDb().thumbnail_url
|
||||
presenter.fetchChapters(refreshTracker == null)
|
||||
|
|
|
@ -115,7 +115,7 @@ class MangaDetailsPresenter(
|
|||
tabletChapterHeaderItem = MangaHeaderItem(manga, false)
|
||||
tabletChapterHeaderItem?.isChapterHeader = true
|
||||
}
|
||||
isLockedFromSearch = SecureActivityDelegate.shouldBeLocked()
|
||||
isLockedFromSearch = controller.shouldLockIfNeeded && SecureActivityDelegate.shouldBeLocked()
|
||||
headerItem.isLocked = isLockedFromSearch
|
||||
downloadManager.addListener(this)
|
||||
LibraryUpdateService.setListener(this)
|
||||
|
|
|
@ -104,7 +104,10 @@ open class GlobalSearchController(
|
|||
*/
|
||||
override fun onMangaClick(manga: Manga) {
|
||||
// Open MangaController.
|
||||
router.pushController(MangaDetailsController(manga, true).withFadeTransaction())
|
||||
router.pushController(
|
||||
MangaDetailsController(manga, true, shouldLockIfNeeded = activity is SearchActivity)
|
||||
.withFadeTransaction()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -269,7 +272,7 @@ open class GlobalSearchController(
|
|||
if (results != null && searchResult.size == 1 && results.size == 1) {
|
||||
val manga = results.first().manga
|
||||
router.replaceTopController(
|
||||
MangaDetailsController(manga, true)
|
||||
MangaDetailsController(manga, true, shouldLockIfNeeded = true)
|
||||
.withFadeTransaction()
|
||||
)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue