mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 20:19:05 +01:00
Bump dependencies + linting
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -673,7 +673,9 @@ private fun LazyListScope.sharedChapterItems(
|
||||
},
|
||||
onDownloadClick = if (onDownloadChapter != null) {
|
||||
{ onDownloadChapter(listOf(chapterItem), it) }
|
||||
} else null,
|
||||
} else {
|
||||
null
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ enum class DownloadAction {
|
||||
NEXT_10_CHAPTERS,
|
||||
CUSTOM,
|
||||
UNREAD_CHAPTERS,
|
||||
ALL_CHAPTERS
|
||||
ALL_CHAPTERS,
|
||||
}
|
||||
|
||||
enum class EditCoverAction {
|
||||
|
||||
@@ -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) },
|
||||
),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user