Bump dependencies + linting

This commit is contained in:
arkon
2022-09-10 23:57:03 -04:00
parent 5b474e96b7
commit cd3cb72b65
33 changed files with 195 additions and 104 deletions

View File

@@ -338,7 +338,9 @@ private fun InfoText(
val clickableModifier = if (onClick != null) {
Modifier.clickable(interactionSource, indication = null) { onClick() }
} else Modifier
} else {
Modifier
}
Column(
modifier = modifier.then(clickableModifier),

View File

@@ -18,7 +18,8 @@ import eu.kanade.tachiyomi.R
enum class MangaCover(val ratio: Float) {
Square(1f / 1f),
Book(2f / 3f);
Book(2f / 3f),
;
@Composable
operator fun invoke(
@@ -42,7 +43,9 @@ enum class MangaCover(val ratio: Float) {
role = Role.Button,
onClick = onClick,
)
} else Modifier,
} else {
Modifier
},
),
contentScale = ContentScale.Crop,
)

View File

@@ -220,12 +220,18 @@ private fun ScaffoldLayout(
.asPaddingValues(this@SubcomposeLayout)
val innerPadding = PaddingValues(
top =
if (topBarHeight == 0) insets.calculateTopPadding()
else topBarHeight.toDp(),
if (topBarHeight == 0) {
insets.calculateTopPadding()
} else {
topBarHeight.toDp()
},
bottom =
(
if (bottomBarHeight == 0) insets.calculateBottomPadding()
else bottomBarHeight.toDp()
if (bottomBarHeight == 0) {
insets.calculateBottomPadding()
} else {
bottomBarHeight.toDp()
}
) + fabHeight.toDp(),
start = insets.calculateLeftPadding((this@SubcomposeLayout).layoutDirection),
end = insets.calculateRightPadding((this@SubcomposeLayout).layoutDirection),

View File

@@ -145,13 +145,17 @@ fun VerticalFastScroller(
)
},
)
} else Modifier,
} else {
Modifier
},
)
.then(
// Exclude thumb from gesture area only when needed
if (isThumbVisible && !isThumbDragged && !listState.isScrollInProgress) {
Modifier.systemGestureExclusion()
} else Modifier,
} else {
Modifier
},
)
.height(ThumbLength)
.padding(horizontal = 8.dp)
@@ -321,13 +325,17 @@ fun VerticalGridFastScroller(
)
},
)
} else Modifier,
} else {
Modifier
},
)
.then(
// Exclude thumb from gesture area only when needed
if (isThumbVisible && !isThumbDragged && !state.isScrollInProgress) {
Modifier.systemGestureExclusion()
} else Modifier,
} else {
Modifier
},
)
.height(ThumbLength)
.padding(horizontal = 8.dp)

View File

@@ -673,7 +673,9 @@ private fun LazyListScope.sharedChapterItems(
},
onDownloadClick = if (onDownloadChapter != null) {
{ onDownloadChapter(listOf(chapterItem), it) }
} else null,
} else {
null
},
)
}
}

View File

@@ -6,7 +6,7 @@ enum class DownloadAction {
NEXT_10_CHAPTERS,
CUSTOM,
UNREAD_CHAPTERS,
ALL_CHAPTERS
ALL_CHAPTERS,
}
enum class EditCoverAction {

View File

@@ -316,10 +316,12 @@ private fun MangaAndSourceTitlesLarge(
.padding(top = 2.dp)
.clickableNoIndication(
onLongClick = {
if (!author.isNullOrBlank()) context.copyToClipboard(
author,
author,
)
if (!author.isNullOrBlank()) {
context.copyToClipboard(
author,
author,
)
}
},
onClick = { if (!author.isNullOrBlank()) doSearch(author, true) },
),
@@ -428,10 +430,12 @@ private fun MangaAndSourceTitlesSmall(
style = MaterialTheme.typography.titleLarge,
modifier = Modifier.clickableNoIndication(
onLongClick = {
if (title.isNotBlank()) context.copyToClipboard(
title,
title,
)
if (title.isNotBlank()) {
context.copyToClipboard(
title,
title,
)
}
},
onClick = { if (title.isNotBlank()) doSearch(title, true) },
),
@@ -446,10 +450,12 @@ private fun MangaAndSourceTitlesSmall(
.padding(top = 2.dp)
.clickableNoIndication(
onLongClick = {
if (!author.isNullOrBlank()) context.copyToClipboard(
author,
author,
)
if (!author.isNullOrBlank()) {
context.copyToClipboard(
author,
author,
)
}
},
onClick = { if (!author.isNullOrBlank()) doSearch(author, true) },
),

View File

@@ -103,12 +103,16 @@ private fun Modifier.drawScrollbar(
val estimatedItemSize = if (items.isEmpty()) 0f else itemsSize.toFloat() / items.size
val totalSize = estimatedItemSize * layoutInfo.totalItemsCount
val thumbSize = viewportSize / totalSize * viewportSize
val startOffset = if (items.isEmpty()) 0f else items
.first()
.run {
val startPadding = if (reverseDirection) layoutInfo.afterContentPadding else layoutInfo.beforeContentPadding
startPadding + ((estimatedItemSize * index - offset) / totalSize * viewportSize)
}
val startOffset = if (items.isEmpty()) {
0f
} else {
items
.first()
.run {
val startPadding = if (reverseDirection) layoutInfo.afterContentPadding else layoutInfo.beforeContentPadding
startPadding + ((estimatedItemSize * index - offset) / totalSize * viewportSize)
}
}
val drawScrollbar = onDrawScrollbar(
orientation, reverseDirection, atEnd, showScrollbar,
thickness, color, alpha, thumbSize, startOffset, positionOffset,
@@ -202,7 +206,9 @@ private fun Modifier.drawScrollbar(
val isLtr = LocalLayoutDirection.current == LayoutDirection.Ltr
val reverseDirection = if (orientation == Orientation.Horizontal) {
if (isLtr) reverseScrolling else !reverseScrolling
} else reverseScrolling
} else {
reverseScrolling
}
val atEnd = if (orientation == Orientation.Vertical) isLtr else true
val context = LocalContext.current