mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-21 18:51:49 +01:00
Lint fixes
This commit is contained in:
parent
4f3a0b3523
commit
953f5fb025
@ -116,7 +116,9 @@ class SyncChaptersWithSource(
|
||||
} else {
|
||||
if (shouldUpdateDbChapter.await(dbChapter, chapter)) {
|
||||
val shouldRenameChapter = downloadProvider.isChapterDirNameChanged(dbChapter, chapter) &&
|
||||
downloadManager.isChapterDownloaded(dbChapter.name, dbChapter.scanlator, manga.title, manga.source)
|
||||
downloadManager.isChapterDownloaded(
|
||||
dbChapter.name, dbChapter.scanlator, manga.title, manga.source,
|
||||
)
|
||||
|
||||
if (shouldRenameChapter) {
|
||||
downloadManager.renameChapter(source, manga, dbChapter, chapter)
|
||||
|
@ -74,7 +74,9 @@ internal fun GlobalSearchContent(
|
||||
items.forEach { (source, result) ->
|
||||
item(key = source.id) {
|
||||
GlobalSearchResultItem(
|
||||
title = fromSourceId?.let { "▶ ${source.name}".takeIf { source.id == fromSourceId } } ?: source.name,
|
||||
title = fromSourceId?.let {
|
||||
"▶ ${source.name}".takeIf { source.id == fromSourceId }
|
||||
} ?: source.name,
|
||||
subtitle = LocaleHelper.getDisplayName(source.lang),
|
||||
onClick = { onClickSource(source) },
|
||||
) {
|
||||
|
@ -56,7 +56,11 @@ fun BrowseSourceToolbar(
|
||||
actions = listOfNotNull(
|
||||
AppBar.Action(
|
||||
title = stringResource(R.string.action_display_mode),
|
||||
icon = if (displayMode == LibraryDisplayMode.List) Icons.Filled.ViewList else Icons.Filled.ViewModule,
|
||||
icon = if (displayMode == LibraryDisplayMode.List) {
|
||||
Icons.Filled.ViewList
|
||||
} else {
|
||||
Icons.Filled.ViewModule
|
||||
},
|
||||
onClick = { selectingDisplayMode = true },
|
||||
),
|
||||
if (isLocalSource) {
|
||||
|
@ -75,7 +75,9 @@ fun CategoryScreen(
|
||||
CategoryContent(
|
||||
categories = state.categories,
|
||||
lazyListState = lazyListState,
|
||||
paddingValues = paddingValues + topSmallPaddingValues + PaddingValues(horizontal = MaterialTheme.padding.medium),
|
||||
paddingValues = paddingValues +
|
||||
topSmallPaddingValues +
|
||||
PaddingValues(horizontal = MaterialTheme.padding.medium),
|
||||
onClickRename = onClickRename,
|
||||
onClickDelete = onClickDelete,
|
||||
onMoveUp = onClickMoveUp,
|
||||
|
@ -74,7 +74,11 @@ fun CategoryCreateDialog(
|
||||
onValueChange = { name = it },
|
||||
label = { Text(text = stringResource(R.string.name)) },
|
||||
supportingText = {
|
||||
val msgRes = if (name.isNotEmpty() && nameAlreadyExists) R.string.error_category_exists else R.string.information_required_plain
|
||||
val msgRes = if (name.isNotEmpty() && nameAlreadyExists) {
|
||||
R.string.error_category_exists
|
||||
} else {
|
||||
R.string.information_required_plain
|
||||
}
|
||||
Text(text = stringResource(msgRes))
|
||||
},
|
||||
isError = name.isNotEmpty() && nameAlreadyExists,
|
||||
@ -134,7 +138,11 @@ fun CategoryRenameDialog(
|
||||
},
|
||||
label = { Text(text = stringResource(R.string.name)) },
|
||||
supportingText = {
|
||||
val msgRes = if (valueHasChanged && nameAlreadyExists) R.string.error_category_exists else R.string.information_required_plain
|
||||
val msgRes = if (valueHasChanged && nameAlreadyExists) {
|
||||
R.string.error_category_exists
|
||||
} else {
|
||||
R.string.information_required_plain
|
||||
}
|
||||
Text(text = stringResource(msgRes))
|
||||
},
|
||||
isError = valueHasChanged && nameAlreadyExists,
|
||||
@ -257,8 +265,12 @@ fun ChangeCategoryDialog(
|
||||
onClick = {
|
||||
onDismissRequest()
|
||||
onConfirm(
|
||||
selection.filter { it is CheckboxState.State.Checked || it is CheckboxState.TriState.Include }.map { it.value.id },
|
||||
selection.filter { it is CheckboxState.State.None || it is CheckboxState.TriState.None }.map { it.value.id },
|
||||
selection
|
||||
.filter { it is CheckboxState.State.Checked || it is CheckboxState.TriState.Include }
|
||||
.map { it.value.id },
|
||||
selection
|
||||
.filter { it is CheckboxState.State.None || it is CheckboxState.TriState.None }
|
||||
.map { it.value.id },
|
||||
)
|
||||
},
|
||||
) {
|
||||
|
@ -370,7 +370,11 @@ fun SearchToolbar(
|
||||
@Composable
|
||||
fun UpIcon(navigationIcon: ImageVector? = null) {
|
||||
val icon = navigationIcon
|
||||
?: if (LocalLayoutDirection.current == LayoutDirection.Ltr) Icons.Outlined.ArrowBack else Icons.Outlined.ArrowForward
|
||||
?: if (LocalLayoutDirection.current == LayoutDirection.Ltr) {
|
||||
Icons.Outlined.ArrowBack
|
||||
} else {
|
||||
Icons.Outlined.ArrowForward
|
||||
}
|
||||
Icon(
|
||||
imageVector = icon,
|
||||
contentDescription = stringResource(R.string.abc_action_bar_up_description),
|
||||
|
@ -167,8 +167,16 @@ private fun ColumnScope.SortPage(
|
||||
onClick = {
|
||||
val isTogglingDirection = sortingMode == mode
|
||||
val direction = when {
|
||||
isTogglingDirection -> if (sortDescending) LibrarySort.Direction.Ascending else LibrarySort.Direction.Descending
|
||||
else -> if (sortDescending) LibrarySort.Direction.Descending else LibrarySort.Direction.Ascending
|
||||
isTogglingDirection -> if (sortDescending) {
|
||||
LibrarySort.Direction.Ascending
|
||||
} else {
|
||||
LibrarySort.Direction.Descending
|
||||
}
|
||||
else -> if (sortDescending) {
|
||||
LibrarySort.Direction.Descending
|
||||
} else {
|
||||
LibrarySort.Direction.Ascending
|
||||
}
|
||||
}
|
||||
screenModel.setSort(category, mode, direction)
|
||||
},
|
||||
|
@ -83,7 +83,8 @@ fun ChapterSettingsDialog(
|
||||
0 -> {
|
||||
FilterPage(
|
||||
downloadFilter = manga?.downloadedFilter ?: TriState.DISABLED,
|
||||
onDownloadFilterChanged = onDownloadFilterChanged.takeUnless { manga?.forceDownloaded() == true },
|
||||
onDownloadFilterChanged = onDownloadFilterChanged
|
||||
.takeUnless { manga?.forceDownloaded() == true },
|
||||
unreadFilter = manga?.unreadFilter ?: TriState.DISABLED,
|
||||
onUnreadFilterChanged = onUnreadFilterChanged,
|
||||
bookmarkedFilter = manga?.bookmarkedFilter ?: TriState.DISABLED,
|
||||
|
@ -225,20 +225,28 @@ object SettingsLibraryScreen : SearchableSettings {
|
||||
pref = libraryPreferences.swipeToStartAction(),
|
||||
title = stringResource(R.string.pref_chapter_swipe_start),
|
||||
entries = mapOf(
|
||||
LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(R.string.disabled),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(R.string.action_bookmark),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(R.string.action_mark_as_read),
|
||||
LibraryPreferences.ChapterSwipeAction.Download to stringResource(R.string.action_download),
|
||||
LibraryPreferences.ChapterSwipeAction.Disabled to
|
||||
stringResource(R.string.disabled),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to
|
||||
stringResource(R.string.action_bookmark),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleRead to
|
||||
stringResource(R.string.action_mark_as_read),
|
||||
LibraryPreferences.ChapterSwipeAction.Download to
|
||||
stringResource(R.string.action_download),
|
||||
),
|
||||
),
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
pref = libraryPreferences.swipeToEndAction(),
|
||||
title = stringResource(R.string.pref_chapter_swipe_end),
|
||||
entries = mapOf(
|
||||
LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(R.string.disabled),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(R.string.action_bookmark),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(R.string.action_mark_as_read),
|
||||
LibraryPreferences.ChapterSwipeAction.Download to stringResource(R.string.action_download),
|
||||
LibraryPreferences.ChapterSwipeAction.Disabled to
|
||||
stringResource(R.string.disabled),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to
|
||||
stringResource(R.string.action_bookmark),
|
||||
LibraryPreferences.ChapterSwipeAction.ToggleRead to
|
||||
stringResource(R.string.action_mark_as_read),
|
||||
LibraryPreferences.ChapterSwipeAction.Download to
|
||||
stringResource(R.string.action_download),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -174,12 +174,12 @@ object SettingsReaderScreen : SearchableSettings {
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
pref = readerPreferences.pagerNavInverted(),
|
||||
title = stringResource(R.string.pref_read_with_tapping_inverted),
|
||||
entries = mapOf(
|
||||
ReaderPreferences.TappingInvertMode.NONE to stringResource(R.string.none),
|
||||
ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(R.string.tapping_inverted_horizontal),
|
||||
ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(R.string.tapping_inverted_vertical),
|
||||
ReaderPreferences.TappingInvertMode.BOTH to stringResource(R.string.tapping_inverted_both),
|
||||
),
|
||||
entries = listOf(
|
||||
ReaderPreferences.TappingInvertMode.NONE,
|
||||
ReaderPreferences.TappingInvertMode.HORIZONTAL,
|
||||
ReaderPreferences.TappingInvertMode.VERTICAL,
|
||||
ReaderPreferences.TappingInvertMode.BOTH,
|
||||
).associateWith { stringResource(it.titleResId) },
|
||||
enabled = navMode != 5,
|
||||
),
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
@ -266,12 +266,12 @@ object SettingsReaderScreen : SearchableSettings {
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
pref = readerPreferences.webtoonNavInverted(),
|
||||
title = stringResource(R.string.pref_read_with_tapping_inverted),
|
||||
entries = mapOf(
|
||||
ReaderPreferences.TappingInvertMode.NONE to stringResource(R.string.none),
|
||||
ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(R.string.tapping_inverted_horizontal),
|
||||
ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(R.string.tapping_inverted_vertical),
|
||||
ReaderPreferences.TappingInvertMode.BOTH to stringResource(R.string.tapping_inverted_both),
|
||||
),
|
||||
entries = listOf(
|
||||
ReaderPreferences.TappingInvertMode.NONE,
|
||||
ReaderPreferences.TappingInvertMode.HORIZONTAL,
|
||||
ReaderPreferences.TappingInvertMode.VERTICAL,
|
||||
ReaderPreferences.TappingInvertMode.BOTH,
|
||||
).associateWith { stringResource(it.titleResId) },
|
||||
enabled = navMode != 5,
|
||||
),
|
||||
Preference.PreferenceItem.SliderPreference(
|
||||
|
@ -202,7 +202,11 @@ private fun SearchResult(
|
||||
SearchResultItem(
|
||||
route = settingsData.route,
|
||||
title = p.title,
|
||||
breadcrumbs = getLocalizedBreadcrumb(path = settingsData.title, node = categoryTitle, isLtr = isLtr),
|
||||
breadcrumbs = getLocalizedBreadcrumb(
|
||||
path = settingsData.title,
|
||||
node = categoryTitle,
|
||||
isLtr = isLtr,
|
||||
),
|
||||
highlightKey = p.title,
|
||||
)
|
||||
}
|
||||
|
@ -78,7 +78,8 @@ class DebugInfoScreen : Screen() {
|
||||
value = when (result) {
|
||||
ProfileVerifier.CompilationStatus.RESULT_CODE_NO_PROFILE -> "No profile installed"
|
||||
ProfileVerifier.CompilationStatus.RESULT_CODE_COMPILED_WITH_PROFILE -> "Compiled"
|
||||
ProfileVerifier.CompilationStatus.RESULT_CODE_COMPILED_WITH_PROFILE_NON_MATCHING -> "Compiled non-matching"
|
||||
ProfileVerifier.CompilationStatus.RESULT_CODE_COMPILED_WITH_PROFILE_NON_MATCHING ->
|
||||
"Compiled non-matching"
|
||||
ProfileVerifier.CompilationStatus.RESULT_CODE_ERROR_CACHE_FILE_EXISTS_BUT_CANNOT_BE_READ,
|
||||
ProfileVerifier.CompilationStatus.RESULT_CODE_ERROR_CANT_WRITE_PROFILE_VERIFICATION_RESULT_CACHE_FILE,
|
||||
ProfileVerifier.CompilationStatus.RESULT_CODE_ERROR_PACKAGE_NAME_DOES_NOT_EXIST,
|
||||
|
@ -446,7 +446,13 @@ class BackupRestorer(
|
||||
return backupManga
|
||||
}
|
||||
|
||||
private suspend fun restoreExtras(manga: Manga, categories: List<Int>, history: List<BackupHistory>, tracks: List<Track>, backupCategories: List<BackupCategory>) {
|
||||
private suspend fun restoreExtras(
|
||||
manga: Manga,
|
||||
categories: List<Int>,
|
||||
history: List<BackupHistory>,
|
||||
tracks: List<Track>,
|
||||
backupCategories: List<BackupCategory>,
|
||||
) {
|
||||
restoreCategories(manga, categories, backupCategories)
|
||||
restoreHistory(history)
|
||||
restoreTracking(manga, tracks)
|
||||
|
@ -39,7 +39,21 @@ data class BackupChapter(
|
||||
}
|
||||
}
|
||||
|
||||
val backupChapterMapper = { _: Long, _: Long, url: String, name: String, scanlator: String?, read: Boolean, bookmark: Boolean, lastPageRead: Long, chapterNumber: Double, source_order: Long, dateFetch: Long, dateUpload: Long, lastModifiedAt: Long ->
|
||||
val backupChapterMapper = {
|
||||
_: Long,
|
||||
_: Long,
|
||||
url: String,
|
||||
name: String,
|
||||
scanlator: String?,
|
||||
read: Boolean,
|
||||
bookmark: Boolean,
|
||||
lastPageRead: Long,
|
||||
chapterNumber: Double,
|
||||
sourceOrder: Long,
|
||||
dateFetch: Long,
|
||||
dateUpload: Long,
|
||||
lastModifiedAt: Long,
|
||||
->
|
||||
BackupChapter(
|
||||
url = url,
|
||||
name = name,
|
||||
@ -50,7 +64,7 @@ val backupChapterMapper = { _: Long, _: Long, url: String, name: String, scanlat
|
||||
lastPageRead = lastPageRead,
|
||||
dateFetch = dateFetch,
|
||||
dateUpload = dateUpload,
|
||||
sourceOrder = source_order,
|
||||
sourceOrder = sourceOrder,
|
||||
lastModifiedAt = lastModifiedAt,
|
||||
)
|
||||
}
|
||||
|
@ -54,7 +54,20 @@ data class BackupTracking(
|
||||
}
|
||||
|
||||
val backupTrackMapper = {
|
||||
_: Long, _: Long, syncId: Long, mediaId: Long, libraryId: Long?, title: String, lastChapterRead: Double, totalChapters: Long, status: Long, score: Double, remoteUrl: String, startDate: Long, finishDate: Long ->
|
||||
_: Long,
|
||||
_: Long,
|
||||
syncId: Long,
|
||||
mediaId: Long,
|
||||
libraryId: Long?,
|
||||
title: String,
|
||||
lastChapterRead: Double,
|
||||
totalChapters: Long,
|
||||
status: Long,
|
||||
score: Double,
|
||||
remoteUrl: String,
|
||||
startDate: Long,
|
||||
finishDate: Long,
|
||||
->
|
||||
BackupTracking(
|
||||
syncId = syncId.toInt(),
|
||||
mediaId = mediaId,
|
||||
|
@ -358,9 +358,8 @@ class DownloadCache(
|
||||
// Folder of images
|
||||
it.isDirectory -> it.name
|
||||
// CBZ files
|
||||
it.isFile && it.name?.endsWith(".cbz") == true -> it.name!!.substringBeforeLast(
|
||||
".cbz",
|
||||
)
|
||||
it.isFile && it.name?.endsWith(".cbz") == true ->
|
||||
it.name!!.substringBeforeLast(".cbz")
|
||||
// Anything else is irrelevant
|
||||
else -> null
|
||||
}
|
||||
|
@ -336,7 +336,9 @@ class LibraryUpdateNotifier(private val context: Context) {
|
||||
if (shouldTruncate) {
|
||||
// "Chapters 1, 2.5, 3, 4, 5 and 10 more"
|
||||
val remaining = displayableChapterNumbers.size - NOTIF_MAX_CHAPTERS
|
||||
val joinedChapterNumbers = displayableChapterNumbers.take(NOTIF_MAX_CHAPTERS).joinToString(", ")
|
||||
val joinedChapterNumbers = displayableChapterNumbers
|
||||
.take(NOTIF_MAX_CHAPTERS)
|
||||
.joinToString(", ")
|
||||
context.resources.getQuantityString(
|
||||
R.plurals.notification_chapters_multiple_and_more,
|
||||
remaining,
|
||||
@ -371,7 +373,8 @@ class LibraryUpdateNotifier(private val context: Context) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val HELP_WARNING_URL = "https://tachiyomi.org/docs/faq/library#why-am-i-warned-about-large-bulk-updates-and-downloads"
|
||||
const val HELP_WARNING_URL =
|
||||
"https://tachiyomi.org/docs/faq/library#why-am-i-warned-about-large-bulk-updates-and-downloads"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,11 @@ abstract class BaseTracker(
|
||||
}
|
||||
|
||||
override suspend fun setRemoteLastChapterRead(track: Track, chapterNumber: Int) {
|
||||
if (track.last_chapter_read == 0f && track.last_chapter_read < chapterNumber && track.status != getRereadingStatus()) {
|
||||
if (
|
||||
track.last_chapter_read == 0f &&
|
||||
track.last_chapter_read < chapterNumber &&
|
||||
track.status != getRereadingStatus()
|
||||
) {
|
||||
track.status = getReadingStatus()
|
||||
}
|
||||
track.last_chapter_read = chapterNumber.toFloat()
|
||||
|
@ -278,7 +278,9 @@ class KitsuApi(private val client: OkHttpClient, interceptor: KitsuInterceptor)
|
||||
"https://AWQO5J657S-dsn.algolia.net/1/indexes/production_media/query/"
|
||||
private const val algoliaAppId = "AWQO5J657S"
|
||||
private const val algoliaFilter =
|
||||
"&facetFilters=%5B%22kind%3Amanga%22%5D&attributesToRetrieve=%5B%22synopsis%22%2C%22canonicalTitle%22%2C%22chapterCount%22%2C%22posterImage%22%2C%22startDate%22%2C%22subtype%22%2C%22endDate%22%2C%20%22id%22%5D"
|
||||
"&facetFilters=%5B%22kind%3Amanga%22%5D&attributesToRetrieve=" +
|
||||
"%5B%22synopsis%22%2C%22canonicalTitle%22%2C%22chapterCount%22%2C%22" +
|
||||
"posterImage%22%2C%22startDate%22%2C%22subtype%22%2C%22endDate%22%2C%20%22id%22%5D"
|
||||
|
||||
fun mangaUrl(remoteId: Long): String {
|
||||
return baseMangaUrl + remoteId
|
||||
|
@ -59,7 +59,8 @@ class ShikimoriApi(
|
||||
).awaitSuccess()
|
||||
.parseAs<JsonObject>()
|
||||
.let {
|
||||
track.library_id = it["id"]!!.jsonPrimitive.long // save id of the entry for possible future delete request
|
||||
// save id of the entry for possible future delete request
|
||||
track.library_id = it["id"]!!.jsonPrimitive.long
|
||||
}
|
||||
track
|
||||
}
|
||||
|
@ -71,7 +71,10 @@ internal class ExtensionGithubApi {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun checkForUpdates(context: Context, fromAvailableExtensionList: Boolean = false): List<Extension.Installed>? {
|
||||
suspend fun checkForUpdates(
|
||||
context: Context,
|
||||
fromAvailableExtensionList: Boolean = false,
|
||||
): List<Extension.Installed>? {
|
||||
// Limit checks to once a day at most
|
||||
if (!fromAvailableExtensionList && Date().time < lastExtCheck.get() + 1.days.inWholeMilliseconds) {
|
||||
return null
|
||||
|
@ -133,7 +133,10 @@ internal class ExtensionInstaller(private val context: Context) {
|
||||
emit(downloadStatus)
|
||||
|
||||
// Stop polling when the download fails or finishes
|
||||
if (downloadStatus == DownloadManager.STATUS_SUCCESSFUL || downloadStatus == DownloadManager.STATUS_FAILED) {
|
||||
if (
|
||||
downloadStatus == DownloadManager.STATUS_SUCCESSFUL ||
|
||||
downloadStatus == DownloadManager.STATUS_FAILED
|
||||
) {
|
||||
return@flow
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,8 @@ class ExtensionsScreenModel(
|
||||
.groupBy { it.lang }
|
||||
.toSortedMap(LocaleHelper.comparator)
|
||||
.map { (lang, exts) ->
|
||||
ExtensionUiModel.Header.Text(LocaleHelper.getSourceDisplayName(lang, context)) to exts.map(extensionMapper(downloads))
|
||||
ExtensionUiModel.Header.Text(LocaleHelper.getSourceDisplayName(lang, context)) to
|
||||
exts.map(extensionMapper(downloads))
|
||||
}
|
||||
if (languagesWithExtensions.isNotEmpty()) {
|
||||
itemsGroups.putAll(languagesWithExtensions)
|
||||
|
@ -133,7 +133,8 @@ class MangaScreenModel(
|
||||
val dateFormat by mutableStateOf(UiPreferences.dateFormat(uiPreferences.dateFormat().get()))
|
||||
private val skipFiltered by readerPreferences.skipFiltered().asState(screenModelScope)
|
||||
|
||||
val isUpdateIntervalEnabled = LibraryPreferences.MANGA_OUTSIDE_RELEASE_PERIOD in libraryPreferences.autoUpdateMangaRestrictions().get()
|
||||
val isUpdateIntervalEnabled =
|
||||
LibraryPreferences.MANGA_OUTSIDE_RELEASE_PERIOD in libraryPreferences.autoUpdateMangaRestrictions().get()
|
||||
|
||||
private val selectedPositions: Array<Int> = arrayOf(-1, -1) // first and last selected index in list
|
||||
private val selectedChapterIds: HashSet<Long> = HashSet()
|
||||
@ -744,7 +745,13 @@ class MangaScreenModel(
|
||||
screenModelScope.launchNonCancellable {
|
||||
val manga = successState?.manga ?: return@launchNonCancellable
|
||||
val categories = getCategories.await(manga.id).map { it.id }
|
||||
if (chapters.isEmpty() || !manga.shouldDownloadNewChapters(categories, downloadPreferences)) return@launchNonCancellable
|
||||
if (
|
||||
chapters.isEmpty() ||
|
||||
!manga.shouldDownloadNewChapters(categories, downloadPreferences)
|
||||
) {
|
||||
return@launchNonCancellable
|
||||
}
|
||||
|
||||
downloadChapters(chapters)
|
||||
}
|
||||
}
|
||||
|
@ -470,7 +470,8 @@ class ReaderActivity : BaseActivity() {
|
||||
} else {
|
||||
if (readerPreferences.fullscreen().get()) {
|
||||
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
|
||||
windowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
windowInsetsController.systemBarsBehavior =
|
||||
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,13 @@ open class ReaderPageImageView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun SubsamplingScaleImageView.landscapeZoom(forward: Boolean) {
|
||||
if (config != null && config!!.landscapeZoom && config!!.minimumScaleType == SCALE_TYPE_CENTER_INSIDE && sWidth > sHeight && scale == minScale) {
|
||||
if (
|
||||
config != null &&
|
||||
config!!.landscapeZoom &&
|
||||
config!!.minimumScaleType == SCALE_TYPE_CENTER_INSIDE &&
|
||||
sWidth > sHeight &&
|
||||
scale == minScale
|
||||
) {
|
||||
handler?.postDelayed(500) {
|
||||
val point = when (config!!.zoomStartPosition) {
|
||||
ZoomStartPosition.LEFT -> if (forward) PointF(0F, 0F) else PointF(sWidth.toFloat(), 0F)
|
||||
|
@ -268,7 +268,8 @@ abstract class PagerViewer(val activity: ReaderActivity) : Viewer {
|
||||
* Sets the active [chapters] on this pager.
|
||||
*/
|
||||
private fun setChaptersInternal(chapters: ViewerChapters) {
|
||||
val forceTransition = config.alwaysShowChapterTransition || adapter.items.getOrNull(pager.currentItem) is ChapterTransition
|
||||
val forceTransition = config.alwaysShowChapterTransition ||
|
||||
adapter.items.getOrNull(pager.currentItem) is ChapterTransition
|
||||
adapter.setChapters(chapters, forceTransition)
|
||||
|
||||
// Layout the pager once a chapter is being set
|
||||
|
@ -56,7 +56,8 @@ fun Date.toRelativeString(
|
||||
return dateFormat.format(this)
|
||||
}
|
||||
val now = Date()
|
||||
val difference = now.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY) - this.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY)
|
||||
val difference = now.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY) -
|
||||
this.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY)
|
||||
val days = difference.floorDiv(MILLISECONDS_IN_DAY).toInt()
|
||||
return when {
|
||||
difference < 0 -> dateFormat.format(this)
|
||||
|
@ -23,7 +23,13 @@ fun Context.notify(id: Int, channelId: String, block: (NotificationCompat.Builde
|
||||
}
|
||||
|
||||
fun Context.notify(id: Int, notification: Notification) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && PermissionChecker.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PermissionChecker.PERMISSION_GRANTED) {
|
||||
if (
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
PermissionChecker.checkSelfPermission(
|
||||
this,
|
||||
Manifest.permission.POST_NOTIFICATIONS,
|
||||
) != PermissionChecker.PERMISSION_GRANTED
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -31,7 +37,13 @@ fun Context.notify(id: Int, notification: Notification) {
|
||||
}
|
||||
|
||||
fun Context.notify(notificationWithIdAndTags: List<NotificationWithIdAndTag>) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && PermissionChecker.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PermissionChecker.PERMISSION_GRANTED) {
|
||||
if (
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
PermissionChecker.checkSelfPermission(
|
||||
this,
|
||||
Manifest.permission.POST_NOTIFICATIONS,
|
||||
) != PermissionChecker.PERMISSION_GRANTED
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user