From 82a9d36df7c8a22c7dbd7762ecc38dbdacd2626e Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 14 Oct 2023 22:46:51 -0400 Subject: [PATCH] Minor cleanup --- .github/renovate.json5 | 5 ----- app/.gitignore | 1 - app/shortcuts.xml | 1 - .../history/components/HistoryDialogs.kt | 4 ++-- .../history/components/HistoryItem.kt | 6 +++--- .../tachiyomi/ui/reader/ReaderActivity.kt | 20 +++++++------------ 6 files changed, 12 insertions(+), 25 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 55dae05ca5..d333b80a66 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -5,11 +5,6 @@ ], "schedule": ["every sunday"], "packageRules": [ - { - "managers": ["maven"], - "packageNames": ["com.google.guava:guava"], - "versionScheme": "docker" - }, { // Compiler plugins are tightly coupled to Kotlin version "groupName": "Kotlin", diff --git a/app/.gitignore b/app/.gitignore index 88f41197ea..12864471f1 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,4 +1,3 @@ /build *iml *.iml -custom.gradle diff --git a/app/shortcuts.xml b/app/shortcuts.xml index b9e38f27c6..48936aafe6 100644 --- a/app/shortcuts.xml +++ b/app/shortcuts.xml @@ -1,5 +1,4 @@ - run {} }, + onDelete = {}, ) } } diff --git a/app/src/main/java/eu/kanade/presentation/history/components/HistoryItem.kt b/app/src/main/java/eu/kanade/presentation/history/components/HistoryItem.kt index 6b1bb1e0e4..cd37192f6b 100644 --- a/app/src/main/java/eu/kanade/presentation/history/components/HistoryItem.kt +++ b/app/src/main/java/eu/kanade/presentation/history/components/HistoryItem.kt @@ -30,7 +30,7 @@ import tachiyomi.domain.history.model.HistoryWithRelations import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.util.ThemePreviews -private val HISTORY_ITEM_HEIGHT = 96.dp +private val HistoryItemHeight = 96.dp @Composable fun HistoryItem( @@ -43,7 +43,7 @@ fun HistoryItem( Row( modifier = modifier .clickable(onClick = onClickResume) - .height(HISTORY_ITEM_HEIGHT) + .height(HistoryItemHeight) .padding(horizontal = MaterialTheme.padding.medium, vertical = MaterialTheme.padding.small), verticalAlignment = Alignment.CenterVertically, ) { @@ -93,7 +93,7 @@ fun HistoryItem( @ThemePreviews @Composable -internal fun HistoryItemPreviews( +private fun HistoryItemPreviews( @PreviewParameter(HistoryWithRelationsProvider::class) historyWithRelations: HistoryWithRelations, ) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index a2a92d1e85..6d58736e34 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -1,7 +1,6 @@ package eu.kanade.tachiyomi.ui.reader import android.annotation.SuppressLint -import android.annotation.TargetApi import android.app.assist.AssistContent import android.content.Context import android.content.Intent @@ -362,15 +361,11 @@ class ReaderActivity : BaseActivity() { }, readingMode = ReadingModeType.fromPreference( - viewModel.getMangaReadingMode( - resolveDefault = false, - ), + viewModel.getMangaReadingMode(resolveDefault = false), ), onClickReadingMode = viewModel::openReadingModeSelectDialog, orientationMode = OrientationType.fromPreference( - viewModel.getMangaOrientationType( - resolveDefault = false, - ), + viewModel.getMangaOrientationType(resolveDefault = false), ), onClickOrientationMode = viewModel::openOrientationModeSelectDialog, cropEnabled = cropEnabled, @@ -786,11 +781,9 @@ class ReaderActivity : BaseActivity() { .onEach(::setTrueColor) .launchIn(lifecycleScope) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - readerPreferences.cutoutShort().changes() - .onEach(::setCutoutShort) - .launchIn(lifecycleScope) - } + readerPreferences.cutoutShort().changes() + .onEach(::setCutoutShort) + .launchIn(lifecycleScope) readerPreferences.keepScreenOn().changes() .onEach(::setKeepScreenOn) @@ -842,8 +835,9 @@ class ReaderActivity : BaseActivity() { } } - @TargetApi(Build.VERSION_CODES.P) private fun setCutoutShort(enabled: Boolean) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) return + window.attributes.layoutInDisplayCutoutMode = when (enabled) { true -> WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES false -> WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER