diff --git a/app/.gitignore b/app/.gitignore index 329ef4c71..b0b5a87c1 100755 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,6 +1,4 @@ /build *iml *.iml -custom.gradle google-services.json -output.json \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/presentation/history/components/HistoryDialogs.kt b/app/src/main/java/eu/kanade/presentation/history/components/HistoryDialogs.kt index f76a1fa5c..40d3ecfa7 100644 --- a/app/src/main/java/eu/kanade/presentation/history/components/HistoryDialogs.kt +++ b/app/src/main/java/eu/kanade/presentation/history/components/HistoryDialogs.kt @@ -106,11 +106,11 @@ fun HistoryDeleteAllDialog( @ThemePreviews @Composable -internal fun HistoryDeleteDialogPreview() { +private fun HistoryDeleteDialogPreview() { TachiyomiTheme { HistoryDeleteDialog( onDismissRequest = {}, - onDelete = { _ -> 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 6b1bb1e0e..cd37192f6 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 4875c2c09..b9244bc73 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 @@ -432,15 +431,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, @@ -1148,11 +1143,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) @@ -1233,8 +1226,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 diff --git a/app/src/main/res/xml/shortcuts.xml b/app/src/main/res/xml/shortcuts.xml index 64737f58b..78cc10c6f 100644 --- a/app/src/main/res/xml/shortcuts.xml +++ b/app/src/main/res/xml/shortcuts.xml @@ -1,5 +1,4 @@ -