Skip to content

Commit

Permalink
Address more spotless lint errors in SY
Browse files Browse the repository at this point in the history
  • Loading branch information
cuong-tran committed Aug 22, 2024
1 parent 20df4d9 commit 4ec3e81
Show file tree
Hide file tree
Showing 118 changed files with 532 additions and 293 deletions.
2 changes: 1 addition & 1 deletion app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_tachi_monochrome_launcher" />
</adaptive-icon>
</adaptive-icon>
2 changes: 1 addition & 1 deletion app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_tachi_monochrome_launcher" />
</adaptive-icon>
</adaptive-icon>
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ class GetEnabledSources(
) { a, b, c -> Triple(a, b, c) },
// SY <--
repository.getSources(),
) { pinnedSourceIds,
(enabledLanguages, disabledSources, lastUsedSource),
(excludedFromDataSaver, sourcesInCategories, sourceCategoriesFilter),
sources,
) {
pinnedSourceIds,
(enabledLanguages, disabledSources, lastUsedSource),
(excludedFromDataSaver, sourcesInCategories, sourceCategoriesFilter),
sources,
->

val sourcesAndCategories = sourcesInCategories.map {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/eu/kanade/domain/sync/SyncPreferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SyncPreferences(
fun clientAPIKey() = preferenceStore.getString("sync_client_api_key", "")
fun lastSyncTimestamp() = preferenceStore.getLong(Preference.appStateKey("last_sync_timestamp"), 0L)

fun lastSyncEtag() = preferenceStore.getString("sync_etag", "")
fun lastSyncEtag() = preferenceStore.getString("sync_etag", "")

fun syncInterval() = preferenceStore.getInt("sync_interval", 0)
fun syncService() = preferenceStore.getInt("sync_service", 0)
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ class UiPreferences(

fun themeMode() = preferenceStore.getEnum(
"pref_theme_mode_key",
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ThemeMode.SYSTEM } else { ThemeMode.LIGHT },
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
ThemeMode.SYSTEM
} else {
ThemeMode.LIGHT
},
)

fun appTheme() = preferenceStore.getEnum(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ private fun ColumnScope.SortPage(
}.collectAsState(initial = screenModel.libraryPreferences.sortTagsForLibrary().get().isNotEmpty())
// SY <--


val trackerSortOption = if (trackers.isEmpty()) {
emptyList()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,9 @@ private fun LazyListScope.sharedChapterItems(
// SY <--
},
readProgress = item.chapter.lastPageRead
.takeIf { /* SY --> */(!item.chapter.read || alwaysShowReadingProgress)/* SY <-- */ && it > 0L }
.takeIf {
/* SY --> */(!item.chapter.read || alwaysShowReadingProgress)/* SY <-- */ && it > 0L
}
?.let {
stringResource(
MR.strings.chapter_progress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ fun MangaChapterListItem(
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
if (readProgress != null || scanlator != null/* SY --> */ || sourceName != null/* SY <-- */) DotSeparatorText()
if (readProgress != null ||
scanlator != null/* SY --> */ ||
sourceName != null/* SY <-- */
) {
DotSeparatorText()
}
}
if (readProgress != null) {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import tachiyomi.presentation.core.i18n.stringResource

@Composable
private fun PagePreviewLoading(
setMaxWidth: (Dp) -> Unit
setMaxWidth: (Dp) -> Unit,
) {
val density = LocalDensity.current
Box(
Expand All @@ -63,7 +63,7 @@ private fun PagePreviewLoading(
@Composable
private fun PagePreviewRow(
onOpenPage: (Int) -> Unit,
items: ImmutableList<PagePreview>
items: ImmutableList<PagePreview>,
) {
Row(
modifier = Modifier
Expand All @@ -88,7 +88,7 @@ private fun PagePreviewMore(
) {
Box(
modifier = Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center
contentAlignment = Alignment.Center,
) {
TextButton(onClick = onMorePreviewsClicked) {
Text(stringResource(SYMR.strings.more_previews))
Expand Down Expand Up @@ -116,7 +116,7 @@ fun PagePreviews(
pagePreviewState.pagePreviews.take(rowCount * itemPerRowCount).chunked(itemPerRowCount).forEach {
PagePreviewRow(
onOpenPage = onOpenPage,
items = remember(it) { it.toImmutableList() }
items = remember(it) { it.toImmutableList() },
)
}

Expand Down Expand Up @@ -153,7 +153,7 @@ fun LazyListScope.PagePreviewItems(
) {
PagePreviewRow(
onOpenPage = onOpenPage,
items = remember(it) { it.toImmutableList() }
items = remember(it) { it.toImmutableList() },
)
}
item(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package eu.kanade.presentation.more.settings.screen
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Build
import android.provider.Settings
import android.webkit.WebStorage
import android.webkit.WebView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,15 @@ object SettingsAppearanceScreen : SearchableSettings {
Preference.PreferenceItem.SliderPreference(
value = previewsRowCount,
title = stringResource(SYMR.strings.pref_previews_row_count),
subtitle = if (previewsRowCount > 0) pluralStringResource(
SYMR.plurals.row_count,
previewsRowCount,
previewsRowCount,
) else stringResource(MR.strings.disabled),
subtitle = if (previewsRowCount > 0) {
pluralStringResource(
SYMR.plurals.row_count,
previewsRowCount,
previewsRowCount,
)
} else {
stringResource(MR.strings.disabled)
},
min = 0,
max = 10,
onValueChanged = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ object SettingsBrowseScreen : SearchableSettings {
pref = uiPreferences.feedTabInFront(),
title = stringResource(SYMR.strings.pref_feed_position),
subtitle = stringResource(SYMR.strings.pref_feed_position_summery),
enabled = hideFeedTab.not()
enabled = hideFeedTab.not(),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import eu.kanade.tachiyomi.util.system.toast
import kotlinx.collections.immutable.ImmutableList
import kotlinx.coroutines.flow.update
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.components.LazyColumnWithAction
import tachiyomi.presentation.core.components.SectionCard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fun ExhUtils(
modifier
.fillMaxWidth()
.background(backgroundColor),
horizontalAlignment = Alignment.CenterHorizontally
horizontalAlignment = Alignment.CenterHorizontally,
) {
AnimatedVisibility(visible = isVisible) {
Column {
Expand All @@ -84,7 +84,7 @@ fun ExhUtils(
) {
Column(
Modifier.weight(3f),
horizontalAlignment = Alignment.CenterHorizontally
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = stringResource(SYMR.strings.eh_autoscroll),
Expand All @@ -93,17 +93,17 @@ fun ExhUtils(
fontFamily = FontFamily.SansSerif,
style = MaterialTheme.typography.labelLarge,
modifier = Modifier.fillMaxWidth(0.75f),
textAlign = TextAlign.Center
textAlign = TextAlign.Center,
)
}
Column(
Modifier.weight(1f),
horizontalAlignment = Alignment.CenterHorizontally
horizontalAlignment = Alignment.CenterHorizontally,
) {
Switch(
checked = isAutoScroll,
onCheckedChange = null,
enabled = isAutoScrollEnabled
enabled = isAutoScrollEnabled,
)
}
}
Expand All @@ -114,7 +114,7 @@ fun ExhUtils(
) {
Column(
Modifier.weight(3f),
horizontalAlignment = Alignment.CenterHorizontally
horizontalAlignment = Alignment.CenterHorizontally,
) {
var autoScrollFrequencyState by remember {
mutableStateOf(autoScrollFrequency)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/eu/kanade/tachiyomi/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
"""
App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}, ${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE})
Preview build: $syDebugVersion
Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT})
Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT})
Android build ID: ${Build.DISPLAY}
Device brand: ${Build.BRAND}
Device manufacturer: ${Build.MANUFACTURER}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BackupCreator(
// SY -->
private val savedSearchBackupCreator: SavedSearchBackupCreator = SavedSearchBackupCreator(),
private val getMergedManga: GetMergedManga = Injekt.get(),
private val handler: DatabaseHandler = Injekt.get()
private val handler: DatabaseHandler = Injekt.get(),
// SY <--
) {

Expand Down Expand Up @@ -92,7 +92,7 @@ class BackupCreator(
} else {
emptyList()
} + getMergedManga.await(), // SY <--
options
options,
)
val backup = Backup(
backupManga = backupManga,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ data class BackupOptions(
// SY <--
)

fun canCreate() = libraryEntries || categories || appSettings || extensionRepoSettings || sourceSettings || savedSearches
fun canCreate() =
libraryEntries || categories || appSettings || extensionRepoSettings || sourceSettings || savedSearches

companion object {
val libraryOptions = persistentListOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get

class SavedSearchBackupCreator(
private val handler: DatabaseHandler = Injekt.get()
private val handler: DatabaseHandler = Injekt.get(),
) {

suspend operator fun invoke(): List<BackupSavedSearch> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.backup.models
import eu.kanade.tachiyomi.source.model.UpdateStrategy
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import tachiyomi.domain.manga.model.CustomMangaInfo
import tachiyomi.domain.manga.model.Manga

@Suppress("DEPRECATION")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ data class BackupMergedMangaReference(
}

val backupMergedMangaReferenceMapper =
{ _: Long,
{
_: Long,
isInfoManga: Boolean,
getChapterUpdates: Boolean,
chapterSortMode: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ data class RestoreOptions(
// SY <--
)

fun canRestore() = libraryEntries || categories || appSettings || extensionRepoSettings || sourceSettings /* SY --> */ || savedSearches /* SY <-- */
fun canRestore() =
libraryEntries ||
categories ||
appSettings ||
extensionRepoSettings ||
sourceSettings /* SY --> */ ||
savedSearches /* SY <-- */

companion object {
val options = persistentListOf(
Expand Down Expand Up @@ -72,7 +78,7 @@ data class RestoreOptions(
extensionRepoSettings = array[3],
sourceSettings = array[4],
// SY -->
savedSearches = array[5]
savedSearches = array[5],
// SY <--
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class ChapterCache(
private val context: Context,
private val json: Json,
// SY -->
readerPreferences: ReaderPreferences
//S Y <--
readerPreferences: ReaderPreferences,
// S Y <--
) {

// --> EH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PagePreviewFetcher(
source = ImageSource(
file = file.toOkioPath(),
fileSystem = FileSystem.SYSTEM,
diskCacheKey = diskCacheKey
diskCacheKey = diskCacheKey,
),
mimeType = "image/*",
dataSource = DataSource.DISK,
Expand Down Expand Up @@ -230,7 +230,7 @@ class PagePreviewFetcher(
file = data,
fileSystem = FileSystem.SYSTEM,
diskCacheKey = diskCacheKey,
closeable = this
closeable = this,
)
}

Expand Down
Loading

0 comments on commit 4ec3e81

Please sign in to comment.