Update dependency com.pinterest.ktlint:ktlint-cli to v1.7.1 (#2503)
* Update dependency com.pinterest.ktlint:ktlint-cli to v1.7.1 * Fix spotless --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FooIbar <118464521+FooIbar@users.noreply.github.com>
This commit is contained in:
1 parent
2fde327195
commit
2c90ceb5ca
22 files changed
+28
-28
No files matched your search
@@ -19,8 +19,8 @@ import com.hippo.ehviewer.util.findActivity
|
||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
||||
context(scope: AnimatedVisibilityScope)
|
||||
@Composable
|
||||
context(scope: AnimatedVisibilityScope)
|
||||
inline fun <R> Screen(
|
||||
navigator: DestinationsNavigator,
|
||||
block: @Composable context(MainActivity, SnackbarHostState, DialogState, SharedTransitionScope, TransitionsVisibilityScope, DestinationsNavigator, CoroutineScope)
|
||||
|
||||
@@ -62,8 +62,8 @@ private fun GalleryDetail.content() = arrayOf(
|
||||
R.string.favorite_name to favoriteName,
|
||||
)
|
||||
|
||||
context(_: Context, _: DestinationsNavigator)
|
||||
@Composable
|
||||
context(_: Context, _: DestinationsNavigator)
|
||||
fun GalleryInfoBottomSheet(detail: GalleryDetail) {
|
||||
Column(modifier = Modifier.fillMaxWidth()) {
|
||||
Text(
|
||||
|
||||
@@ -84,8 +84,8 @@ private val limitFlow: StateFlow<Result> = refreshEvent.conflate()
|
||||
.let { src -> merge(src, invalidateEvent.map { none() }) }
|
||||
.stateIn(limitScope, SharingStarted.Eagerly, none())
|
||||
|
||||
context(_: CoroutineScope, _: DialogState, _: SnackbarHostState, _: DestinationsNavigator)
|
||||
@Composable
|
||||
context(_: CoroutineScope, _: DialogState, _: SnackbarHostState, _: DestinationsNavigator)
|
||||
fun AvatarIcon() {
|
||||
val hasSignedIn by Settings.hasSignedIn.collectAsState()
|
||||
if (hasSignedIn) {
|
||||
|
||||
@@ -50,8 +50,8 @@ import com.hippo.ehviewer.ui.tools.TransitionsVisibilityScope
|
||||
import com.hippo.ehviewer.ui.tools.listThumbGenerator
|
||||
import com.hippo.ehviewer.util.FileUtils
|
||||
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
@Composable
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
fun DownloadCard(
|
||||
onClick: () -> Unit,
|
||||
onThumbClick: () -> Unit,
|
||||
|
||||
@@ -32,8 +32,8 @@ fun requestOf(model: GalleryInfo) = with(LocalContext.current) {
|
||||
remember(model) { imageRequest(model) }
|
||||
}
|
||||
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope, _: SETNodeGenerator)
|
||||
@Composable
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope, _: SETNodeGenerator)
|
||||
fun EhAsyncCropThumb(
|
||||
key: GalleryInfo,
|
||||
modifier: Modifier = Modifier,
|
||||
@@ -56,8 +56,8 @@ fun EhAsyncCropThumb(
|
||||
)
|
||||
}
|
||||
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope, _: SETNodeGenerator)
|
||||
@Composable
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope, _: SETNodeGenerator)
|
||||
fun EhThumbCard(
|
||||
key: GalleryInfo,
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@@ -98,8 +98,8 @@ fun interface FabBuilder {
|
||||
fun onClick(icon: ImageVector, that: suspend () -> Unit) = onClick(icon, true, that)
|
||||
}
|
||||
|
||||
context(_: CoroutineScope)
|
||||
@Composable
|
||||
context(_: CoroutineScope)
|
||||
fun FabLayout(
|
||||
hidden: Boolean,
|
||||
expanded: Boolean,
|
||||
|
||||
@@ -76,8 +76,8 @@ fun GalleryDetailHeaderInfoCard(
|
||||
}
|
||||
}
|
||||
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
@Composable
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
fun GalleryDetailHeaderCard(
|
||||
info: GalleryInfo,
|
||||
onInfoCardClick: () -> Unit,
|
||||
|
||||
@@ -51,8 +51,8 @@ import com.hippo.ehviewer.ui.tools.TransitionsVisibilityScope
|
||||
import com.hippo.ehviewer.ui.tools.listThumbGenerator
|
||||
import com.hippo.ehviewer.util.FavouriteStatusRouter
|
||||
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
@Composable
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
fun GalleryInfoListItem(
|
||||
onClick: () -> Unit,
|
||||
onLongClick: () -> Unit,
|
||||
@@ -145,8 +145,8 @@ fun GalleryInfoListItem(
|
||||
}
|
||||
}
|
||||
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
@Composable
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
fun GalleryInfoGridItem(
|
||||
onClick: () -> Unit,
|
||||
onLongClick: () -> Unit,
|
||||
|
||||
@@ -78,8 +78,8 @@ operator fun PaddingValues.plus(r: PaddingValues) = object : PaddingValues {
|
||||
override fun calculateTopPadding() = l.calculateTopPadding() + r.calculateTopPadding()
|
||||
}
|
||||
|
||||
context(_: CoroutineScope, ctx: Context)
|
||||
@Composable
|
||||
context(_: CoroutineScope, ctx: Context)
|
||||
fun GalleryList(
|
||||
modifier: Modifier = Modifier,
|
||||
data: LazyPagingItems<BaseGalleryInfo>,
|
||||
|
||||
@@ -30,8 +30,8 @@ import com.hippo.ehviewer.client.data.VoteStatus
|
||||
import com.hippo.ehviewer.collectAsState
|
||||
import com.hippo.ehviewer.ui.tools.includeFontPadding
|
||||
|
||||
context(_: Context)
|
||||
@Composable
|
||||
context(_: Context)
|
||||
fun GalleryTags(
|
||||
tagGroups: List<GalleryTagGroup>,
|
||||
onTagClick: (String) -> Unit,
|
||||
|
||||
@@ -8,8 +8,8 @@ import androidx.compose.material3.IconButtonDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||
|
||||
context(navigator: DestinationsNavigator)
|
||||
@Composable
|
||||
context(navigator: DestinationsNavigator)
|
||||
fun NavigationIcon() = IconButton(onClick = { navigator.popBackStack() }, shapes = IconButtonDefaults.shapes()) {
|
||||
Icon(imageVector = Icons.AutoMirrored.Default.ArrowBack, contentDescription = null)
|
||||
}
|
||||
@@ -60,8 +60,8 @@ private val categoryTable = arrayOf(
|
||||
EhUtils.MISC to R.string.misc,
|
||||
)
|
||||
|
||||
context(_: DialogState, _: CoroutineScope, _: Context)
|
||||
@Composable
|
||||
context(_: DialogState, _: CoroutineScope, _: Context)
|
||||
fun SearchFilter(
|
||||
modifier: Modifier = Modifier,
|
||||
category: Int,
|
||||
|
||||
@@ -182,8 +182,8 @@ fun AnimatedVisibilityScope.ReaderScreen(args: ReaderScreenArgs, navigator: Dest
|
||||
}
|
||||
}
|
||||
|
||||
context(activity: MainActivity, _: SnackbarHostState, _: DialogState, _: CoroutineScope)
|
||||
@Composable
|
||||
context(activity: MainActivity, _: SnackbarHostState, _: DialogState, _: CoroutineScope)
|
||||
fun ReaderScreen(pageLoader: PageLoader, info: BaseGalleryInfo?) {
|
||||
LaunchedEffect(Unit) {
|
||||
val orientation = activity.requestedOrientation
|
||||
|
||||
@@ -164,8 +164,8 @@ import moe.tarsin.navigate
|
||||
import moe.tarsin.snackbar
|
||||
import moe.tarsin.string
|
||||
|
||||
context(_: CoroutineScope, _: DestinationsNavigator, _: DialogState, _: MainActivity, _: SnackbarHostState, _: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
@Composable
|
||||
context(_: CoroutineScope, _: DestinationsNavigator, _: DialogState, _: MainActivity, _: SnackbarHostState, _: SharedTransitionScope, _: TransitionsVisibilityScope)
|
||||
fun GalleryDetailContent(
|
||||
galleryInfo: GalleryInfo,
|
||||
contentPadding: PaddingValues,
|
||||
@@ -393,8 +393,8 @@ fun GalleryDetailContent(
|
||||
}
|
||||
}
|
||||
|
||||
context(ctx: Context, _: CoroutineScope, _: DestinationsNavigator, _: DialogState, _: SnackbarHostState)
|
||||
@Composable
|
||||
context(ctx: Context, _: CoroutineScope, _: DestinationsNavigator, _: DialogState, _: SnackbarHostState)
|
||||
fun BelowHeader(galleryDetail: GalleryDetail, voteTag: VoteTag) {
|
||||
@Composable
|
||||
fun EhIconButton(
|
||||
@@ -786,8 +786,8 @@ private fun getRatingText(rating: Float): Int = when ((rating * 2).roundToInt())
|
||||
|
||||
private fun List<GalleryTagGroup>.artistTag() = find { (ns, _) -> ns == TagNamespace.Artist || ns == TagNamespace.Cosplayer }?.let { (ns, tags) -> "$ns:${tags[0].text}" }
|
||||
|
||||
context(_: Context)
|
||||
@Composable
|
||||
context(_: Context)
|
||||
private fun GalleryDetail.collectPreviewItems() = rememberInVM(previewList) {
|
||||
val pageSize = previewList.size
|
||||
val pages = pages
|
||||
|
||||
@@ -617,9 +617,9 @@ fun AnimatedVisibilityScope.GalleryListScreen(
|
||||
|
||||
const val TOPLIST_PAGES = 200
|
||||
|
||||
context(_: Context)
|
||||
@Composable
|
||||
@Stable
|
||||
context(_: Context)
|
||||
private fun getSuitableTitleForUrlBuilder(urlBuilder: ListUrlBuilder, appName: Boolean = true): String? {
|
||||
val keyword = urlBuilder.keyword
|
||||
val category = urlBuilder.category
|
||||
|
||||
@@ -24,8 +24,8 @@ private fun urlToDestination(url: String): Direction? {
|
||||
return null
|
||||
}
|
||||
|
||||
context(nav: DestinationsNavigator)
|
||||
@MainThread
|
||||
context(nav: DestinationsNavigator)
|
||||
fun navWithUrl(url: String): Boolean {
|
||||
val dest = urlToDestination(url) ?: return false
|
||||
navigate(dest)
|
||||
|
||||
@@ -107,8 +107,8 @@ abstract class Suggestion {
|
||||
|
||||
suspend fun SearchDao.suggestions(prefix: String, limit: Int) = (if (prefix.isBlank()) list(limit) else rawSuggestions(prefix, limit))
|
||||
|
||||
context(_: DialogState, _: DestinationsNavigator)
|
||||
@Composable
|
||||
context(_: DialogState, _: DestinationsNavigator)
|
||||
fun SearchBarScreen(
|
||||
onApplySearch: (String) -> Unit,
|
||||
expanded: Boolean,
|
||||
|
||||
@@ -140,8 +140,8 @@ fun AnnotatedString.toBBCode() = buildString {
|
||||
}
|
||||
}
|
||||
|
||||
context(activity: MainActivity)
|
||||
@Composable
|
||||
context(activity: MainActivity)
|
||||
fun rememberBBCodeTextToolbar(textFieldValue: MutableState<TextFieldValue>): TextToolbar {
|
||||
var tfv by textFieldValue
|
||||
val view = LocalView.current
|
||||
|
||||
@@ -119,8 +119,8 @@ class DialogState(val mutex: MutatorMutex = MutatorMutex()) : MutableComposable
|
||||
@Composable
|
||||
fun rememberLocal() = remember { DialogState(mutex) }
|
||||
|
||||
context(scope: BoxScope)
|
||||
@Composable
|
||||
context(scope: BoxScope)
|
||||
fun Place() = value?.let { it(scope) }
|
||||
|
||||
fun dismiss() {
|
||||
|
||||
@@ -25,12 +25,12 @@ val NoopTransitionsVisibilityScope = TransitionsVisibilityScope(emptySet())
|
||||
@Stable
|
||||
value class TransitionsVisibilityScope(val scopes: Set<AnimatedVisibilityScope>)
|
||||
|
||||
context(visScope: TransitionsVisibilityScope)
|
||||
@Composable
|
||||
context(visScope: TransitionsVisibilityScope)
|
||||
inline fun <T> togetherWith(scope: AnimatedVisibilityScope, block: @Composable TransitionsVisibilityScope.() -> T) = block(remember(visScope.scopes, scope) { TransitionsVisibilityScope(visScope.scopes + scope) })
|
||||
|
||||
context(shareScope: SharedTransitionScope, visScope: TransitionsVisibilityScope, generator: SETNodeGenerator)
|
||||
@Composable
|
||||
context(shareScope: SharedTransitionScope, visScope: TransitionsVisibilityScope, generator: SETNodeGenerator)
|
||||
fun Modifier.sharedBounds(
|
||||
key: String,
|
||||
enter: EnterTransition = fadeIn(),
|
||||
@@ -53,8 +53,8 @@ fun Modifier.sharedBounds(
|
||||
}
|
||||
}
|
||||
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope, _: SETNodeGenerator)
|
||||
@Composable
|
||||
context(_: SharedTransitionScope, _: TransitionsVisibilityScope, _: SETNodeGenerator)
|
||||
inline fun SharedElementBox(key: String, shape: Shape, crossinline content: @Composable BoxScope.() -> Unit) {
|
||||
val modifier = Modifier.sharedBounds(key = key).clip(shape)
|
||||
CompositionLocalProvider { Box(modifier = modifier, content = content) }
|
||||
|
||||
@@ -82,8 +82,8 @@ suspend fun requestPermission(key: String): Boolean {
|
||||
context(_: Context)
|
||||
suspend fun pickVisualMedia(type: VisualMediaType): Uri? = awaitActivityResult(ActivityResultContracts.PickVisualMedia(), PickVisualMediaRequest(mediaType = type))
|
||||
|
||||
context(ctx: Context)
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
context(ctx: Context)
|
||||
suspend fun requestInstallPermission(): Boolean = with(ctx) {
|
||||
if (packageManager.canRequestPackageInstalls()) return true
|
||||
val granted = requestPermission(Manifest.permission.REQUEST_INSTALL_PACKAGES)
|
||||
|
||||
@@ -91,7 +91,7 @@ diff = "io.github.petertrr:kotlin-multiplatform-diff:1.1.0"
|
||||
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
|
||||
|
||||
ktlint = "com.pinterest.ktlint:ktlint-cli:1.6.0"
|
||||
ktlint = "com.pinterest.ktlint:ktlint-cli:1.7.1"
|
||||
|
||||
okhttp-bom = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttp" }
|
||||
okhttp-android = { module = "com.squareup.okhttp3:okhttp-android" }
|
||||
|
||||
Reference in new issue
Block a user