mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Update linter
This commit is contained in:
@@ -29,7 +29,7 @@ fun EmptyScreen(
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.fillMaxSize(),
|
||||
) {
|
||||
AndroidView(
|
||||
factory = { context ->
|
||||
|
||||
@@ -23,7 +23,7 @@ enum class MangaCover(private val ratio: Float) {
|
||||
modifier: Modifier = Modifier,
|
||||
data: String?,
|
||||
contentDescription: String? = null,
|
||||
shape: Shape? = null
|
||||
shape: Shape? = null,
|
||||
) {
|
||||
AsyncImage(
|
||||
model = data,
|
||||
|
||||
@@ -56,7 +56,7 @@ fun PreferenceRow(
|
||||
onLongClick = onLongClick,
|
||||
onClick = onClick,
|
||||
),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
if (painter != null) {
|
||||
Icon(
|
||||
@@ -71,7 +71,7 @@ fun PreferenceRow(
|
||||
Column(
|
||||
Modifier
|
||||
.padding(horizontal = horizontalPadding)
|
||||
.weight(1f)
|
||||
.weight(1f),
|
||||
) {
|
||||
Text(
|
||||
text = title,
|
||||
|
||||
@@ -88,7 +88,7 @@ fun HistoryContent(
|
||||
onClickResume: (HistoryWithRelations) -> Unit,
|
||||
onClickDelete: (HistoryWithRelations, Boolean) -> Unit,
|
||||
preferences: PreferencesHelper = Injekt.get(),
|
||||
nestedScroll: NestedScrollConnection
|
||||
nestedScroll: NestedScrollConnection,
|
||||
) {
|
||||
if (history.loadState.refresh is LoadState.Loading) {
|
||||
LoadingScreen()
|
||||
@@ -118,7 +118,7 @@ fun HistoryContent(
|
||||
.animateItemPlacement(),
|
||||
date = item.date,
|
||||
relativeTime = relativeTime,
|
||||
dateFormat = dateFormat
|
||||
dateFormat = dateFormat,
|
||||
)
|
||||
}
|
||||
is HistoryUiModel.Item -> {
|
||||
@@ -142,7 +142,7 @@ fun HistoryContent(
|
||||
onClickDelete(removeState, all)
|
||||
setRemoveState(null)
|
||||
},
|
||||
onNegative = { setRemoveState(null) }
|
||||
onNegative = { setRemoveState(null) },
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -160,12 +160,12 @@ fun HistoryHeader(
|
||||
text = date.toRelativeString(
|
||||
LocalContext.current,
|
||||
relativeTime,
|
||||
dateFormat
|
||||
dateFormat,
|
||||
),
|
||||
style = MaterialTheme.typography.bodyMedium.copy(
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
)
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ fun HistoryItem(
|
||||
text = history.title,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = textStyle.copy(fontWeight = FontWeight.SemiBold)
|
||||
style = textStyle.copy(fontWeight = FontWeight.SemiBold),
|
||||
)
|
||||
Row {
|
||||
Text(
|
||||
@@ -232,7 +232,7 @@ fun HistoryItem(
|
||||
@Composable
|
||||
fun RemoveHistoryDialog(
|
||||
onPositive: (Boolean) -> Unit,
|
||||
onNegative: () -> Unit
|
||||
onNegative: () -> Unit,
|
||||
) {
|
||||
val (removeEverything, removeEverythingState) = remember { mutableStateOf(false) }
|
||||
|
||||
@@ -250,9 +250,9 @@ fun RemoveHistoryDialog(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = null,
|
||||
value = removeEverything,
|
||||
onValueChange = removeEverythingState
|
||||
onValueChange = removeEverythingState,
|
||||
),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Checkbox(
|
||||
checked = removeEverything,
|
||||
@@ -260,7 +260,7 @@ fun RemoveHistoryDialog(
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 4.dp),
|
||||
text = stringResource(id = R.string.dialog_with_checkbox_reset)
|
||||
text = stringResource(id = R.string.dialog_with_checkbox_reset),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ fun BaseMangaListItem(
|
||||
.clickable(onClick = onClickItem)
|
||||
.height(56.dp)
|
||||
.padding(horizontal = horizontalPadding),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
cover()
|
||||
content()
|
||||
@@ -47,7 +47,7 @@ private val defaultCover: @Composable RowScope.(Manga, () -> Unit) -> Unit = { m
|
||||
.padding(vertical = 8.dp)
|
||||
.clickable(onClick = onClick)
|
||||
.fillMaxHeight(),
|
||||
data = manga.thumbnailUrl
|
||||
data = manga.thumbnailUrl,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ private val defaultContent: @Composable RowScope.(Manga) -> Unit = {
|
||||
.padding(start = horizontalPadding),
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 1,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import eu.kanade.tachiyomi.R
|
||||
fun LogoHeader() {
|
||||
Column {
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.ic_tachi),
|
||||
|
||||
@@ -25,7 +25,7 @@ fun MigrateMangaScreen(
|
||||
nestedScrollInterop: NestedScrollConnection,
|
||||
presenter: MigrationMangaPresenter,
|
||||
onClickItem: (Manga) -> Unit,
|
||||
onClickCover: (Manga) -> Unit
|
||||
onClickCover: (Manga) -> Unit,
|
||||
) {
|
||||
val state by presenter.state.collectAsState()
|
||||
|
||||
@@ -48,7 +48,7 @@ fun MigrateMangaContent(
|
||||
nestedScrollInterop: NestedScrollConnection,
|
||||
list: List<Manga>,
|
||||
onClickItem: (Manga) -> Unit,
|
||||
onClickCover: (Manga) -> Unit
|
||||
onClickCover: (Manga) -> Unit,
|
||||
) {
|
||||
if (list.isEmpty()) {
|
||||
EmptyScreen(textResource = R.string.migrate_empty_screen)
|
||||
@@ -62,7 +62,7 @@ fun MigrateMangaContent(
|
||||
MigrateMangaItem(
|
||||
manga = manga,
|
||||
onClickItem = onClickItem,
|
||||
onClickCover = onClickCover
|
||||
onClickCover = onClickCover,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -73,12 +73,12 @@ fun MigrateMangaItem(
|
||||
modifier: Modifier = Modifier,
|
||||
manga: Manga,
|
||||
onClickItem: (Manga) -> Unit,
|
||||
onClickCover: (Manga) -> Unit
|
||||
onClickCover: (Manga) -> Unit,
|
||||
) {
|
||||
BaseMangaListItem(
|
||||
modifier = modifier,
|
||||
manga = manga,
|
||||
onClickItem = { onClickItem(manga) },
|
||||
onClickCover = { onClickCover(manga) }
|
||||
onClickCover = { onClickCover(manga) },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ fun MigrateSourceList(
|
||||
modifier = Modifier
|
||||
.animateItemPlacement()
|
||||
.padding(horizontal = horizontalPadding, vertical = 8.dp),
|
||||
style = MaterialTheme.typography.header
|
||||
style = MaterialTheme.typography.header,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -78,14 +78,14 @@ fun MigrateSourceList(
|
||||
items = list,
|
||||
key = { (source, _) ->
|
||||
source.id
|
||||
}
|
||||
},
|
||||
) { (source, count) ->
|
||||
MigrateSourceItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
source = source,
|
||||
count = count,
|
||||
onClickItem = { onClickItem(source) },
|
||||
onLongClickItem = { onLongClickItem(source) }
|
||||
onLongClickItem = { onLongClickItem(source) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ fun SourceFilterScreen(
|
||||
nestedScrollInterop: NestedScrollConnection,
|
||||
presenter: SourceFilterPresenter,
|
||||
onClickLang: (String) -> Unit,
|
||||
onClickSource: (Source) -> Unit
|
||||
onClickSource: (Source) -> Unit,
|
||||
) {
|
||||
val state by presenter.state.collectAsState()
|
||||
|
||||
@@ -53,7 +53,7 @@ fun SourceFilterContent(
|
||||
nestedScrollInterop: NestedScrollConnection,
|
||||
items: List<FilterUiModel>,
|
||||
onClickLang: (String) -> Unit,
|
||||
onClickSource: (Source) -> Unit
|
||||
onClickSource: (Source) -> Unit,
|
||||
) {
|
||||
if (items.isEmpty()) {
|
||||
EmptyScreen(textResource = R.string.source_filter_empty_screen)
|
||||
@@ -76,7 +76,7 @@ fun SourceFilterContent(
|
||||
is FilterUiModel.Header -> it.hashCode()
|
||||
is FilterUiModel.Item -> it.source.key()
|
||||
}
|
||||
}
|
||||
},
|
||||
) { model ->
|
||||
when (model) {
|
||||
is FilterUiModel.Header -> {
|
||||
@@ -84,14 +84,14 @@ fun SourceFilterContent(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
language = model.language,
|
||||
isEnabled = model.isEnabled,
|
||||
onClickItem = onClickLang
|
||||
onClickItem = onClickLang,
|
||||
)
|
||||
}
|
||||
is FilterUiModel.Item -> SourceFilterItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
source = model.source,
|
||||
isEnabled = model.isEnabled,
|
||||
onClickItem = onClickSource
|
||||
onClickItem = onClickSource,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ fun SourceFilterHeader(
|
||||
modifier: Modifier,
|
||||
language: String,
|
||||
isEnabled: Boolean,
|
||||
onClickItem: (String) -> Unit
|
||||
onClickItem: (String) -> Unit,
|
||||
) {
|
||||
PreferenceRow(
|
||||
modifier = modifier,
|
||||
@@ -120,7 +120,7 @@ fun SourceFilterItem(
|
||||
modifier: Modifier,
|
||||
source: Source,
|
||||
isEnabled: Boolean,
|
||||
onClickItem: (Source) -> Unit
|
||||
onClickItem: (Source) -> Unit,
|
||||
) {
|
||||
BaseSourceItem(
|
||||
modifier = modifier,
|
||||
@@ -129,6 +129,6 @@ fun SourceFilterItem(
|
||||
onClickItem = { onClickItem(source) },
|
||||
action = {
|
||||
Checkbox(checked = isEnabled, onCheckedChange = null)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -105,13 +105,13 @@ fun SourceList(
|
||||
is SourceUiModel.Header -> it.hashCode()
|
||||
is SourceUiModel.Item -> it.source.key()
|
||||
}
|
||||
}
|
||||
},
|
||||
) { model ->
|
||||
when (model) {
|
||||
is SourceUiModel.Header -> {
|
||||
SourceHeader(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
language = model.language
|
||||
language = model.language,
|
||||
)
|
||||
}
|
||||
is SourceUiModel.Item -> SourceItem(
|
||||
@@ -139,7 +139,7 @@ fun SourceList(
|
||||
onClickDisable(sourceState)
|
||||
setSourceState(null)
|
||||
},
|
||||
onDismiss = { setSourceState(null) }
|
||||
onDismiss = { setSourceState(null) },
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -147,14 +147,14 @@ fun SourceList(
|
||||
@Composable
|
||||
fun SourceHeader(
|
||||
modifier: Modifier = Modifier,
|
||||
language: String
|
||||
language: String,
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
Text(
|
||||
text = LocaleHelper.getSourceDisplayName(language, context),
|
||||
modifier = modifier
|
||||
.padding(horizontal = horizontalPadding, vertical = 8.dp),
|
||||
style = MaterialTheme.typography.header
|
||||
style = MaterialTheme.typography.header,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ fun SourceItem(
|
||||
onClickItem: (Source) -> Unit,
|
||||
onLongClickItem: (Source) -> Unit,
|
||||
onClickLatest: (Source) -> Unit,
|
||||
onClickPin: (Source) -> Unit
|
||||
onClickPin: (Source) -> Unit,
|
||||
) {
|
||||
BaseSourceItem(
|
||||
modifier = modifier,
|
||||
@@ -178,14 +178,14 @@ fun SourceItem(
|
||||
Text(
|
||||
text = stringResource(id = R.string.latest),
|
||||
style = LocalTextStyle.current.copy(
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
SourcePinButton(
|
||||
isPinned = Pin.Pinned in source.pin,
|
||||
onClick = { onClickPin(source) }
|
||||
onClick = { onClickPin(source) },
|
||||
)
|
||||
},
|
||||
)
|
||||
@@ -193,7 +193,7 @@ fun SourceItem(
|
||||
|
||||
@Composable
|
||||
fun SourceIcon(
|
||||
source: Source
|
||||
source: Source,
|
||||
) {
|
||||
val icon = source.icon
|
||||
val modifier = Modifier
|
||||
@@ -217,7 +217,7 @@ fun SourceIcon(
|
||||
@Composable
|
||||
fun SourcePinButton(
|
||||
isPinned: Boolean,
|
||||
onClick: () -> Unit
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
val icon = if (isPinned) Icons.Filled.PushPin else Icons.Outlined.PushPin
|
||||
val tint = if (isPinned) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onBackground
|
||||
@@ -225,7 +225,7 @@ fun SourcePinButton(
|
||||
Icon(
|
||||
imageVector = icon,
|
||||
contentDescription = "",
|
||||
tint = tint
|
||||
tint = tint,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ fun SourceOptionsDialog(
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onClickPin)
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 16.dp)
|
||||
.padding(vertical = 16.dp),
|
||||
)
|
||||
if (source.id != LocalSource.ID) {
|
||||
Text(
|
||||
@@ -257,7 +257,7 @@ fun SourceOptionsDialog(
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onClickDisable)
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 16.dp)
|
||||
.padding(vertical = 16.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,10 @@ fun BaseSourceItem(
|
||||
modifier = modifier
|
||||
.combinedClickable(
|
||||
onClick = onClickItem,
|
||||
onLongClick = onLongClickItem
|
||||
onLongClick = onLongClickItem,
|
||||
)
|
||||
.padding(horizontal = horizontalPadding, vertical = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
icon.invoke(this, source)
|
||||
content.invoke(this, source, showLanguageInContent)
|
||||
@@ -51,20 +51,20 @@ private val defaultContent: @Composable RowScope.(Source, Boolean) -> Unit = { s
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(horizontal = horizontalPadding)
|
||||
.weight(1f)
|
||||
.weight(1f),
|
||||
) {
|
||||
Text(
|
||||
text = source.name,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
if (showLanguageInContent) {
|
||||
Text(
|
||||
text = LocaleHelper.getDisplayName(source.lang),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user