mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 13:37:29 +01:00
Bump dependencies + linting
This commit is contained in:
@@ -50,7 +50,7 @@ private var lockState = LockState.INACTIVE
|
||||
private enum class LockState {
|
||||
INACTIVE,
|
||||
PENDING,
|
||||
ACTIVE
|
||||
ACTIVE,
|
||||
}
|
||||
|
||||
class SecureActivityDelegateImpl : SecureActivityDelegate, DefaultLifecycleObserver {
|
||||
|
||||
@@ -167,8 +167,11 @@ class SearchPresenter(
|
||||
val service = enhancedServices
|
||||
.firstOrNull { it.isTrackFrom(updatedTrack, prevManga, prevSource) }
|
||||
|
||||
if (service != null) service.migrateTrack(updatedTrack, manga, source)
|
||||
else updatedTrack
|
||||
if (service != null) {
|
||||
service.migrateTrack(updatedTrack, manga, source)
|
||||
} else {
|
||||
updatedTrack
|
||||
}
|
||||
}
|
||||
insertTrack.awaitAll(tracks)
|
||||
}
|
||||
|
||||
@@ -190,32 +190,44 @@ class LibraryPresenter(
|
||||
else -> downloadManager.getDownloadCount(item.manga.toDomainManga()!!) > 0
|
||||
}
|
||||
|
||||
return@downloaded if (downloadedOnly || filterDownloaded == State.INCLUDE.value) isDownloaded
|
||||
else !isDownloaded
|
||||
return@downloaded if (downloadedOnly || filterDownloaded == State.INCLUDE.value) {
|
||||
isDownloaded
|
||||
} else {
|
||||
!isDownloaded
|
||||
}
|
||||
}
|
||||
|
||||
val filterFnUnread: (LibraryItem) -> Boolean = unread@{ item ->
|
||||
if (filterUnread == State.IGNORE.value) return@unread true
|
||||
val isUnread = item.manga.unreadCount != 0
|
||||
|
||||
return@unread if (filterUnread == State.INCLUDE.value) isUnread
|
||||
else !isUnread
|
||||
return@unread if (filterUnread == State.INCLUDE.value) {
|
||||
isUnread
|
||||
} else {
|
||||
!isUnread
|
||||
}
|
||||
}
|
||||
|
||||
val filterFnStarted: (LibraryItem) -> Boolean = started@{ item ->
|
||||
if (filterStarted == State.IGNORE.value) return@started true
|
||||
val hasStarted = item.manga.hasStarted
|
||||
|
||||
return@started if (filterStarted == State.INCLUDE.value) hasStarted
|
||||
else !hasStarted
|
||||
return@started if (filterStarted == State.INCLUDE.value) {
|
||||
hasStarted
|
||||
} else {
|
||||
!hasStarted
|
||||
}
|
||||
}
|
||||
|
||||
val filterFnCompleted: (LibraryItem) -> Boolean = completed@{ item ->
|
||||
if (filterCompleted == State.IGNORE.value) return@completed true
|
||||
val isCompleted = item.manga.status == SManga.COMPLETED
|
||||
|
||||
return@completed if (filterCompleted == State.INCLUDE.value) isCompleted
|
||||
else !isCompleted
|
||||
return@completed if (filterCompleted == State.INCLUDE.value) {
|
||||
isCompleted
|
||||
} else {
|
||||
!isCompleted
|
||||
}
|
||||
}
|
||||
|
||||
val filterFnTracking: (LibraryItem) -> Boolean = tracking@{ item ->
|
||||
|
||||
@@ -305,7 +305,8 @@ class MangaController : FullComposeController<MangaPresenter> {
|
||||
previousController.search(query)
|
||||
}
|
||||
is UpdatesController,
|
||||
is HistoryController, -> {
|
||||
is HistoryController,
|
||||
-> {
|
||||
// Manually navigate to LibraryController
|
||||
router.handleBack()
|
||||
(router.activity as MainActivity).setSelectedNavItem(R.id.nav_library)
|
||||
|
||||
@@ -151,7 +151,9 @@ class HttpPageLoader(
|
||||
.mapNotNull {
|
||||
if (it.status == Page.QUEUE) {
|
||||
PriorityPage(it, 0).apply { queue.offer(this) }
|
||||
} else null
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ enum class OrientationType(val prefValue: Int, val flag: Int, @StringRes val str
|
||||
REVERSE_PORTRAIT(6, ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT, R.string.rotation_reverse_portrait, R.drawable.ic_stay_current_portrait_24dp, 0x00000030),
|
||||
LANDSCAPE(3, ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, R.string.rotation_landscape, R.drawable.ic_stay_current_landscape_24dp, 0x00000018),
|
||||
LOCKED_PORTRAIT(4, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, R.string.rotation_force_portrait, R.drawable.ic_screen_lock_portrait_24dp, 0x00000020),
|
||||
LOCKED_LANDSCAPE(5, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, R.string.rotation_force_landscape, R.drawable.ic_screen_lock_landscape_24dp, 0x00000028);
|
||||
LOCKED_LANDSCAPE(5, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, R.string.rotation_force_landscape, R.drawable.ic_screen_lock_landscape_24dp, 0x00000028),
|
||||
;
|
||||
|
||||
companion object {
|
||||
const val MASK = 0x00000038
|
||||
|
||||
@@ -171,7 +171,8 @@ class PagerViewerAdapter(private val viewer: PagerViewer) : ViewPagerAdapter() {
|
||||
|
||||
val placeAtIndex = when (viewer) {
|
||||
is L2RPagerViewer,
|
||||
is VerticalPagerViewer, -> currentIndex + 1
|
||||
is VerticalPagerViewer,
|
||||
-> currentIndex + 1
|
||||
else -> currentIndex
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user