diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/BaseActivity.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/BaseActivity.kt index e2481c33..285d0a42 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/BaseActivity.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/BaseActivity.kt @@ -42,16 +42,8 @@ abstract class BaseActivity : ComponentActivity() { preLaunch() Whetstone.inject(this) enableEdgeToEdge( - statusBarStyle = - SystemBarStyle.light( - Color.TRANSPARENT, - Color.TRANSPARENT, - ), - navigationBarStyle = - SystemBarStyle.light( - Color.TRANSPARENT, - Color.TRANSPARENT, - ), + statusBarStyle = SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT), + navigationBarStyle = SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT), ) setContent { LobstersTheme( diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/SavedPostsWidget.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/SavedPostsWidget.kt index 05c8be4a..ffc74c94 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/SavedPostsWidget.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/SavedPostsWidget.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -30,9 +30,7 @@ import dev.msfjarvis.claw.common.theme.DarkThemeColors import dev.msfjarvis.claw.common.theme.LightThemeColors import dev.msfjarvis.claw.database.local.SavedPost -class SavedPostsWidget( - private val posts: List, -) : GlanceAppWidget() { +class SavedPostsWidget(private val posts: List) : GlanceAppWidget() { override suspend fun provideGlance(context: Context, id: GlanceId) { provideContent { GlanceTheme( @@ -51,7 +49,7 @@ class SavedPostsWidget( GlanceModifier.fillMaxSize() .background(GlanceTheme.colors.background) .appWidgetBackground(), - horizontalAlignment = Alignment.CenterHorizontally + horizontalAlignment = Alignment.CenterHorizontally, ) { item { val style = MaterialTheme.typography.titleLarge diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/WidgetListEntry.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/WidgetListEntry.kt index da163487..25c89073 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/WidgetListEntry.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/glance/WidgetListEntry.kt @@ -39,10 +39,7 @@ private val destinationKey = Key(NAVIGATION_KEY) @Composable @GlanceComposable -fun WidgetListEntry( - post: SavedPost, - modifier: GlanceModifier = GlanceModifier, -) { +fun WidgetListEntry(post: SavedPost, modifier: GlanceModifier = GlanceModifier) { val titleStyle = MaterialTheme.typography.titleMedium val commentsAction = actionStartActivity(actionParametersOf(destinationKey to post.shortId)) @@ -67,12 +64,12 @@ fun WidgetListEntry( fontSize = titleStyle.fontSize, fontWeight = titleStyle.fontWeight.toGlance(), fontStyle = titleStyle.fontStyle.toGlance(), - ) + ), ) Image( provider = ImageProvider(R.drawable.ic_comment), contentDescription = "${post.commentCount ?: 0} comments", - modifier = GlanceModifier.padding(end = 4.dp).clickable(commentsAction) + modifier = GlanceModifier.padding(end = 4.dp).clickable(commentsAction), ) } } diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/MetadataExtractorModule.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/MetadataExtractorModule.kt index 3fc2073c..4f14c05d 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/MetadataExtractorModule.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/MetadataExtractorModule.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -32,13 +32,7 @@ object MetadataExtractorModule { } @Provides - fun provideUnfurler( - okHttpClient: OkHttpClient, - logger: UnfurlLogger, - ): Unfurler { - return Unfurler( - httpClient = okHttpClient, - logger = logger, - ) + fun provideUnfurler(okHttpClient: OkHttpClient, logger: UnfurlLogger): Unfurler { + return Unfurler(httpClient = okHttpClient, logger = logger) } } diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/WorkManagerPlugin.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/WorkManagerPlugin.kt index 64d07ab3..a90b62d7 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/WorkManagerPlugin.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/injection/WorkManagerPlugin.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -17,18 +17,14 @@ import dev.msfjarvis.claw.core.injection.AppPlugin import javax.inject.Inject @ContributesMultibinding(ApplicationScope::class) -class WorkManagerPlugin -@Inject -constructor( - private val workerFactory: WorkerFactory, -) : AppPlugin { +class WorkManagerPlugin @Inject constructor(private val workerFactory: WorkerFactory) : AppPlugin { override fun apply(application: Application) { WorkManager.initialize( application, Configuration.Builder() .setWorkerFactory(workerFactory) .setMinimumLoggingLevel(Log.DEBUG) - .build() + .build(), ) } } diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/datatransfer/DataTransferScreen.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/datatransfer/DataTransferScreen.kt index 734de2c3..d3b7635f 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/datatransfer/DataTransferScreen.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/datatransfer/DataTransferScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -145,11 +145,7 @@ private fun GenericExportOption( } } } - SettingsActionItem( - title = title, - description = description, - icon = icon, - ) { + SettingsActionItem(title = title, description = description, icon = icon) { exportAction.launch(fileName) } } @@ -167,11 +163,7 @@ private fun SettingsActionItem( supportingContent = { description?.let { Text(it) } }, leadingContent = { icon?.let { - Icon( - imageVector = icon, - contentDescription = null, - modifier = Modifier.height(32.dp), - ) + Icon(imageVector = icon, contentDescription = null, modifier = Modifier.height(32.dp)) } }, modifier = modifier.clickable { onClick?.invoke() }, @@ -179,9 +171,7 @@ private fun SettingsActionItem( } /** Shows a Snackbar but dismisses any existing ones first. */ -private suspend fun SnackbarHostState.showSnackbarDismissing( - text: String, -) { +private suspend fun SnackbarHostState.showSnackbarDismissing(text: String) { currentSnackbarData?.dismiss() showSnackbar(text) } diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/decorations/ClawAppBar.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/decorations/ClawAppBar.kt index 9be1af79..57fb67bc 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/decorations/ClawAppBar.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/decorations/ClawAppBar.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -46,9 +46,5 @@ fun ClawAppBar( @ThemePreviews @Composable fun ClawAppBarPreview() { - LobstersTheme { - ClawAppBar( - title = { Text("Claw", fontWeight = FontWeight.Bold) }, - ) - } + LobstersTheme { ClawAppBar(title = { Text("Claw", fontWeight = FontWeight.Bold) }) } } diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/DatabasePosts.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/DatabasePosts.kt index e16799e1..d2522cca 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/DatabasePosts.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/DatabasePosts.kt @@ -53,11 +53,7 @@ fun DatabasePosts( LazyColumn(state = listState) { items.forEach { (month, posts) -> stickyHeader(contentType = "month-header") { MonthHeader(label = month) } - items( - items = posts, - key = { it.shortId }, - contentType = { "LobstersItem" }, - ) { item -> + items(items = posts, key = { it.shortId }, contentType = { "LobstersItem" }) { item -> LobstersListItem( item = item, isSaved = { true }, diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/LobstersListItem.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/LobstersListItem.kt index e2651480..054f8901 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/LobstersListItem.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/LobstersListItem.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -35,9 +35,7 @@ fun LobstersListItem( background = MaterialTheme.colorScheme.tertiary, onSwipe = { postActions.viewCommentsPage(item.commentsUrl) }, ) - SwipeableActionsBox( - endActions = listOf(commentsAction), - ) { + SwipeableActionsBox(endActions = listOf(commentsAction)) { LobstersCard( post = item, isSaved = isSaved(item), diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/NetworkPosts.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/NetworkPosts.kt index 9e584a1e..9b0e42f1 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/NetworkPosts.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/lists/NetworkPosts.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -56,9 +56,7 @@ fun NetworkPosts( modifier = Modifier.align(Alignment.Center), ) } else { - LazyColumn( - state = listState, - ) { + LazyColumn(state = listState) { items( count = lazyPagingItems.itemCount, key = lazyPagingItems.itemKey { it.shortId }, @@ -83,7 +81,7 @@ fun NetworkPosts( modifier = Modifier.fillMaxWidth() .wrapContentWidth(Alignment.CenterHorizontally) - .padding(vertical = 16.dp), + .padding(vertical = 16.dp) ) } } diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/login/LobstersLoginWebView.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/login/LobstersLoginWebView.kt index c406577d..139dd887 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/login/LobstersLoginWebView.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/login/LobstersLoginWebView.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -20,9 +20,7 @@ import okhttp3.HttpUrl.Companion.toHttpUrl @Suppress("Unused") @Composable -fun LobstersLoginWebView( - modifier: Modifier = Modifier, -) { +fun LobstersLoginWebView(modifier: Modifier = Modifier) { val state = rememberWebViewState(url = "https://lobste.rs/login") val webClient = remember { object : AccompanistWebViewClient() { @@ -43,10 +41,5 @@ fun LobstersLoginWebView( } } } - WebView( - state = state, - client = webClient, - modifier = modifier, - captureBackPresses = false, - ) + WebView(state = state, client = webClient, modifier = modifier, captureBackPresses = false) } diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/LobstersPostsScreen.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/LobstersPostsScreen.kt index e1ca3c98..1d24181d 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/LobstersPostsScreen.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/screens/LobstersPostsScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -162,7 +162,7 @@ fun LobstersPostsScreen( navItems.none { it.route == currentDestination } ) { IconButton( - onClick = { if (!navController.popBackStack()) context.getActivity()?.finish() }, + onClick = { if (!navController.popBackStack()) context.getActivity()?.finish() } ) { Icon( imageVector = Icons.AutoMirrored.Filled.ArrowBack, @@ -202,7 +202,7 @@ fun LobstersPostsScreen( imageVector = Icons.Filled.ImportExport, contentDescription = "Data transfer options", ) - } + }, ) DropdownMenuItem( text = { Text("Search posts") }, @@ -211,11 +211,8 @@ fun LobstersPostsScreen( expanded = false }, leadingIcon = { - Icon( - imageVector = Icons.Filled.Search, - contentDescription = "Search posts", - ) - } + Icon(imageVector = Icons.Filled.Search, contentDescription = "Search posts") + }, ) } } @@ -273,11 +270,7 @@ fun LobstersPostsScreen( } composable(route = Destinations.Saved.route) { setWebUri(null) - DatabasePosts( - items = savedPosts, - listState = savedListState, - postActions = postActions, - ) + DatabasePosts(items = savedPosts, listState = savedListState, postActions = postActions) } composable( route = Destinations.Comments.route, @@ -304,18 +297,14 @@ fun LobstersPostsScreen( composable( route = Destinations.User.route, arguments = listOf(navArgument("username") { type = NavType.StringType }), - deepLinks = - listOf(navDeepLink { uriPattern = "$uri/u/${Destinations.User.PLACEHOLDER}" }), + deepLinks = listOf(navDeepLink { uriPattern = "$uri/u/${Destinations.User.PLACEHOLDER}" }), ) { backStackEntry -> val username = requireNotNull(backStackEntry.arguments?.getString("username")) { "Navigating to ${Destinations.User.route} without necessary 'username' argument" } setWebUri("https://lobste.rs/u/$username") - UserProfile( - username = username, - getProfile = viewModel::getUserProfile, - ) + UserProfile(username = username, getProfile = viewModel::getUserProfile) } composable(route = Destinations.DataTransfer.route) { DataTransferScreen( diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/viewmodel/DataTransferRepository.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/viewmodel/DataTransferRepository.kt index 5348bb3d..bf45d622 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/viewmodel/DataTransferRepository.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/viewmodel/DataTransferRepository.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -37,12 +37,7 @@ constructor( suspend fun importPosts(input: InputStream) { val posts: List = - withContext(ioDispatcher) { - json.decodeFromStream( - serializer, - input, - ) - } + withContext(ioDispatcher) { json.decodeFromStream(serializer, input) } withContext(dbDispatcher) { savedPostQueries.transaction { posts.forEach(savedPostQueries::insertOrReplacePost) } } diff --git a/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/SearchConverter.kt b/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/SearchConverter.kt index 7bd429cf..2a606254 100644 --- a/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/SearchConverter.kt +++ b/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/SearchConverter.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -77,7 +77,7 @@ object SearchConverter : Converter> { override fun responseBodyConverter( type: Type, annotations: Array, - retrofit: Retrofit + retrofit: Retrofit, ): Converter> { return SearchConverter } diff --git a/api/src/main/kotlin/dev/msfjarvis/claw/api/injection/RetrofitModule.kt b/api/src/main/kotlin/dev/msfjarvis/claw/api/injection/RetrofitModule.kt index 123eb2ad..9fab2476 100644 --- a/api/src/main/kotlin/dev/msfjarvis/claw/api/injection/RetrofitModule.kt +++ b/api/src/main/kotlin/dev/msfjarvis/claw/api/injection/RetrofitModule.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -91,10 +91,7 @@ object RetrofitModule { @Provides @SearchApi fun provideConverters(): List<@JvmSuppressWildcards Converter.Factory> = - listOf( - ApiResultConverterFactory, - SearchConverter.Factory, - ) + listOf(ApiResultConverterFactory, SearchConverter.Factory) @Provides @Named("LobstersURL") fun provideLobstersUrl(): String = LobstersApi.BASE_URL } diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt index 542ffffb..c20f3f0d 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022-2023 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -43,10 +43,7 @@ class KotlinCommonPlugin : Plugin { } companion object { - private val ADDITIONAL_COMPILER_ARGS = - listOf( - "-opt-in=kotlin.RequiresOptIn", - ) + private val ADDITIONAL_COMPILER_ARGS = listOf("-opt-in=kotlin.RequiresOptIn") val JVM_TOOLCHAIN_ACTION = Action { languageVersion.set(JavaLanguageVersion.of(17)) } diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt index e61706b3..c81afa3d 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022-2023 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -45,7 +45,7 @@ class SpotlessPlugin : Plugin { endWithNewline() licenseHeaderFile( project.file("spotless/license.xml"), - "<(adaptive-icon|appwidget-provider|data-extraction-rules|full-backup-content|manifest|vector|resources)" + "<(adaptive-icon|appwidget-provider|data-extraction-rules|full-backup-content|manifest|vector|resources)", ) } } @@ -55,6 +55,6 @@ class SpotlessPlugin : Plugin { } private companion object { - private const val KTFMT_VERSION = "0.46" + private const val KTFMT_VERSION = "0.47" } } diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt index 2a402cae..8fbdcd8b 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -60,9 +60,7 @@ internal fun CommentsHeader( ) { val uriHandler = LocalUriHandler.current val linkMetadata by - produceState( - initialValue = LinkMetadata(postDetails.url, null), - ) { + produceState(initialValue = LinkMetadata(postDetails.url, null)) { runSuspendCatching { postActions.getLinkMetadata(postDetails.url) } .onSuccess { metadata -> value = metadata } } @@ -105,10 +103,7 @@ internal fun CommentsHeader( } @Composable -private fun PostLink( - linkMetadata: LinkMetadata, - modifier: Modifier = Modifier, -) { +private fun PostLink(linkMetadata: LinkMetadata, modifier: Modifier = Modifier) { Box( modifier.background( color = MaterialTheme.colorScheme.secondary, @@ -155,7 +150,7 @@ internal fun CommentEntry( end = CommentEntryPadding, top = CommentEntryPadding, bottom = CommentEntryPadding, - ), + ) ) { Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { Submitter( @@ -175,7 +170,7 @@ internal fun CommentEntry( if (commentNode.isExpanded) { ThemedRichText( text = htmlConverter.convertHTMLToMarkdown(comment.comment), - modifier = Modifier.padding(top = 8.dp) + modifier = Modifier.padding(top = 8.dp), ) } } @@ -228,11 +223,7 @@ fun buildCommenterString( if (isUnread) { append(' ') withStyle( - style = - SpanStyle( - fontWeight = FontWeight.Bold, - color = MaterialTheme.colorScheme.error, - ) + style = SpanStyle(fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.error) ) { append("(unread)") } diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt index 33869720..4279dc18 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentNode.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022-2023 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -17,7 +17,7 @@ internal data class CommentNode( val children: MutableList = mutableListOf(), val isUnread: Boolean = false, var isExpanded: Boolean = true, - var indentLevel: Int + var indentLevel: Int, ) { fun addChild(child: CommentNode) { if (comment.shortId == child.comment.parentComment) { @@ -32,7 +32,7 @@ internal data class CommentNode( internal fun createListNode( comments: List, - commentState: PostComments? + commentState: PostComments?, ): MutableList { val commentNodes = mutableListOf() val isUnread = { id: String -> commentState?.commentIds?.contains(id) == false } @@ -43,7 +43,7 @@ internal fun createListNode( CommentNode( comment = comments[i], isUnread = isUnread(comments[i].shortId), - indentLevel = 1 + indentLevel = 1, ) ) } else { @@ -52,7 +52,7 @@ internal fun createListNode( CommentNode( comment = comments[i], isUnread = isUnread(comments[i].shortId), - indentLevel = it.indentLevel + 1 + indentLevel = it.indentLevel + 1, ) ) } @@ -86,11 +86,7 @@ internal fun LazyListScope.nodes( toggleExpanded: (CommentNode) -> Unit, ) { nodes.forEach { node -> - node( - node = node, - htmlConverter = htmlConverter, - toggleExpanded = toggleExpanded, - ) + node(node = node, htmlConverter = htmlConverter, toggleExpanded = toggleExpanded) } } @@ -104,18 +100,10 @@ private fun LazyListScope.node( return } item { - CommentEntry( - commentNode = node, - htmlConverter = htmlConverter, - toggleExpanded = toggleExpanded, - ) + CommentEntry(commentNode = node, htmlConverter = htmlConverter, toggleExpanded = toggleExpanded) HorizontalDivider() } if (node.children.isNotEmpty()) { - nodes( - node.children, - htmlConverter = htmlConverter, - toggleExpanded = toggleExpanded, - ) + nodes(node.children, htmlConverter = htmlConverter, toggleExpanded = toggleExpanded) } } diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt index c306275d..9a03ba8a 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -73,17 +73,13 @@ fun LobstersCard( .fillMaxWidth() .clickable { postActions.viewPost(post.shortId, post.url, post.commentsUrl) } .background(MaterialTheme.colorScheme.background) - .padding(start = 16.dp, top = 16.dp, end = 4.dp, bottom = 16.dp), + .padding(start = 16.dp, top = 16.dp, end = 4.dp, bottom = 16.dp) ) { Row( horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically, ) { - PostDetails( - modifier = Modifier.weight(1f), - post = post, - isRead = isRead, - ) + PostDetails(modifier = Modifier.weight(1f), post = post, isRead = isRead) Column( modifier = Modifier.wrapContentHeight(), verticalArrangement = Arrangement.spacedBy(8.dp), @@ -126,11 +122,7 @@ fun PostDetails(post: SavedPost, isRead: Boolean, modifier: Modifier = Modifier) } @Composable -internal fun PostTitle( - title: String, - isRead: Boolean, - modifier: Modifier = Modifier, -) { +internal fun PostTitle(title: String, isRead: Boolean, modifier: Modifier = Modifier) { Text( text = title, modifier = modifier, @@ -169,10 +161,7 @@ internal fun Submitter( } @Composable -private fun SaveButton( - isSaved: Boolean, - modifier: Modifier = Modifier, -) { +private fun SaveButton(isSaved: Boolean, modifier: Modifier = Modifier) { Crossfade(targetState = isSaved, label = "save-button") { saved -> Box(modifier = modifier.padding(12.dp)) { Icon( @@ -186,10 +175,7 @@ private fun SaveButton( } @Composable -private fun CommentsButton( - commentCount: Int?, - modifier: Modifier = Modifier, -) { +private fun CommentsButton(commentCount: Int?, modifier: Modifier = Modifier) { BadgedBox( modifier = modifier.padding(12.dp), badge = { @@ -219,10 +205,7 @@ private fun CommentsButton( @Composable @OptIn(ExperimentalLayoutApi::class) -internal fun TagRow( - tags: ImmutableList, - modifier: Modifier = Modifier, -) { +internal fun TagRow(tags: ImmutableList, modifier: Modifier = Modifier) { FlowRow( modifier = modifier, horizontalArrangement = Arrangement.spacedBy(8.dp), @@ -233,10 +216,7 @@ internal fun TagRow( } @Composable -private fun TagText( - tag: String, - modifier: Modifier = Modifier, -) { +private fun TagText(tag: String, modifier: Modifier = Modifier) { Text( text = tag, modifier = diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt index 8bc99e09..fce56847 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt @@ -23,10 +23,7 @@ import dev.msfjarvis.claw.common.theme.LobstersTheme import dev.msfjarvis.claw.common.ui.preview.ThemePreviews @Composable -internal fun ThemedRichText( - text: String, - modifier: Modifier = Modifier, -) { +internal fun ThemedRichText(text: String, modifier: Modifier = Modifier) { val linkStyle = SpanStyle( background = MaterialTheme.colorScheme.surfaceVariant, @@ -39,10 +36,7 @@ internal fun ThemedRichText( LocalTextStyle provides MaterialTheme.typography.bodyLarge, LocalContentColor provides MaterialTheme.colorScheme.onBackground, ) { - RichText( - modifier = modifier, - style = RichTextStyle.Default.copy(stringStyle = stringStyle), - ) { + RichText(modifier = modifier, style = RichTextStyle.Default.copy(stringStyle = stringStyle)) { Markdown(text) } } diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt index f34c8bcd..c445e282 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022-2023 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -29,11 +29,7 @@ import dev.msfjarvis.claw.common.ui.preview.ThemePreviews import io.github.aakira.napier.Napier @Composable -fun NetworkError( - label: String, - error: Throwable, - modifier: Modifier = Modifier, -) { +fun NetworkError(label: String, error: Throwable, modifier: Modifier = Modifier) { LaunchedEffect(true) { Napier.e(error, "NetworkError") { "Failed to load posts" } } var showDialog by remember { mutableStateOf(false) } Column(verticalArrangement = Arrangement.spacedBy(4.dp), modifier = modifier) { @@ -60,15 +56,10 @@ fun NetworkError( Modifier.clickable { clipboard.setText(AnnotatedString(error.stackTraceToString())) showDialog = false - } + }, ) }, - text = { - Text( - text = "${error.message}", - style = MaterialTheme.typography.bodyLarge, - ) - } + text = { Text(text = "${error.message}", style = MaterialTheme.typography.bodyLarge) }, ) } } diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/PasswordField.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/PasswordField.kt index b296057f..d216774a 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/PasswordField.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/PasswordField.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -45,7 +45,7 @@ fun PasswordField( if (isPasswordVisible) rememberVectorPainter(Icons.Filled.VisibilityOff) else rememberVectorPainter(Icons.Filled.Visibility), contentDescription = null, - modifier = Modifier.clickable { isPasswordVisible = !isPasswordVisible } + modifier = Modifier.clickable { isPasswordVisible = !isPasswordVisible }, ) }, modifier = modifier, @@ -57,10 +57,6 @@ fun PasswordField( private fun PasswordFieldPreview() { LobstersTheme { var value by remember { mutableStateOf("") } - PasswordField( - value = value, - label = "Password", - onValueChange = { value = it }, - ) + PasswordField(value = value, label = "Password", onValueChange = { value = it }) } } diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/SearchBar.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/SearchBar.kt index f66b860c..5221e7d7 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/SearchBar.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/SearchBar.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -59,10 +59,7 @@ fun SearchBar( }, keyboardActions = KeyboardActions(onSearch = { onSearch(value) }), keyboardOptions = - KeyboardOptions( - keyboardType = KeyboardType.Text, - imeAction = ImeAction.Search, - ), + KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.Search), singleLine = true, modifier = modifier.focusable().focusRequester(focusRequester), ) @@ -81,7 +78,7 @@ fun SearchBarPreview() { value = value, onValueChange = { value = it }, onSearch = {}, - modifier = Modifier.align(Alignment.TopCenter).fillMaxWidth() + modifier = Modifier.align(Alignment.TopCenter).fillMaxWidth(), ) } } diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt index 939c5ee1..64b363a4 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt @@ -22,10 +22,7 @@ import dev.msfjarvis.claw.common.ui.preview.ThemePreviews import dev.msfjarvis.claw.common.ui.surfaceColorAtNavigationBarElevation @Composable -fun MonthHeader( - label: String, - modifier: Modifier = Modifier, -) { +fun MonthHeader(label: String, modifier: Modifier = Modifier) { Box( modifier .fillMaxWidth() diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt index 3e351787..e8590838 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022-2023 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -50,12 +50,8 @@ fun UserProfile( .fold( success = { profile -> value = Success(profile) }, failure = { - value = - Error( - error = it, - description = "Failed to load profile for $username", - ) - } + value = Error(error = it, description = "Failed to load profile for $username") + }, ) } when (user) { @@ -81,10 +77,7 @@ fun UserProfile( } @Composable -private fun UserProfileInternal( - user: User, - modifier: Modifier = Modifier, -) { +private fun UserProfileInternal(user: User, modifier: Modifier = Modifier) { Surface(modifier = modifier) { Column( horizontalAlignment = Alignment.CenterHorizontally, @@ -97,17 +90,10 @@ private fun UserProfileInternal( contentDescription = "Avatar of ${user.username}", modifier = Modifier.requiredSize(120.dp).clip(CircleShape), ) - Text( - text = user.username, - style = MaterialTheme.typography.displaySmall, - ) - ThemedRichText( - text = user.about, - ) + Text(text = user.username, style = MaterialTheme.typography.displaySmall) + ThemedRichText(text = user.about) user.invitedBy?.let { invitedBy -> - ThemedRichText( - text = "Invited by [${invitedBy}](https://lobste.rs/u/${user.invitedBy})", - ) + ThemedRichText(text = "Invited by [${invitedBy}](https://lobste.rs/u/${user.invitedBy})") } } } diff --git a/core/src/main/kotlin/dev/msfjarvis/claw/core/network/DelegatingSocketFactory.kt b/core/src/main/kotlin/dev/msfjarvis/claw/core/network/DelegatingSocketFactory.kt index 5fa336f7..3165f658 100644 --- a/core/src/main/kotlin/dev/msfjarvis/claw/core/network/DelegatingSocketFactory.kt +++ b/core/src/main/kotlin/dev/msfjarvis/claw/core/network/DelegatingSocketFactory.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -29,7 +29,7 @@ open class DelegatingSocketFactory(private val delegate: SocketFactory) : Socket host: String, port: Int, localAddress: InetAddress, - localPort: Int + localPort: Int, ): Socket { val socket = delegate.createSocket(host, port, localAddress, localPort) return configureSocket(socket) @@ -44,7 +44,7 @@ open class DelegatingSocketFactory(private val delegate: SocketFactory) : Socket host: InetAddress, port: Int, localAddress: InetAddress, - localPort: Int + localPort: Int, ): Socket { val socket = delegate.createSocket(host, port, localAddress, localPort) return configureSocket(socket) diff --git a/database/impl/src/main/kotlin/dev/msfjarvis/claw/database/injection/QueriesModule.kt b/database/impl/src/main/kotlin/dev/msfjarvis/claw/database/injection/QueriesModule.kt index acc5d30d..ccfefb59 100644 --- a/database/impl/src/main/kotlin/dev/msfjarvis/claw/database/injection/QueriesModule.kt +++ b/database/impl/src/main/kotlin/dev/msfjarvis/claw/database/injection/QueriesModule.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -32,9 +32,7 @@ object QueriesModule { } @Provides - fun provideReadPostsQueries( - @InternalDatabaseApi database: LobstersDatabase, - ): ReadPostsQueries { + fun provideReadPostsQueries(@InternalDatabaseApi database: LobstersDatabase): ReadPostsQueries { return database.readPostsQueries } } diff --git a/model/src/main/kotlin/dev/msfjarvis/claw/model/LinkMetadata.kt b/model/src/main/kotlin/dev/msfjarvis/claw/model/LinkMetadata.kt index 468dc693..8c878bbd 100644 --- a/model/src/main/kotlin/dev/msfjarvis/claw/model/LinkMetadata.kt +++ b/model/src/main/kotlin/dev/msfjarvis/claw/model/LinkMetadata.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022-2023 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -10,8 +10,4 @@ package dev.msfjarvis.claw.model import dev.drewhamilton.poko.Poko -@Poko -class LinkMetadata( - val url: String, - val faviconUrl: String?, -) +@Poko class LinkMetadata(val url: String, val faviconUrl: String?) diff --git a/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPost.kt b/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPost.kt index 1a1a85b0..6e035d96 100644 --- a/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPost.kt +++ b/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPost.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -21,14 +21,8 @@ import kotlinx.serialization.Serializable value = SavedPost::class, mappings = [ - Mapping( - target = "submitterName", - expression = "it.submitter.username", - ), - Mapping( - target = "submitterAvatarUrl", - expression = "it.submitter.avatarUrl", - ), + Mapping(target = "submitterName", expression = "it.submitter.username"), + Mapping(target = "submitterAvatarUrl", expression = "it.submitter.avatarUrl"), ], ) class LobstersPost( diff --git a/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPostDetails.kt b/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPostDetails.kt index 4b13cbda..a82d2e56 100644 --- a/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPostDetails.kt +++ b/model/src/main/kotlin/dev/msfjarvis/claw/model/LobstersPostDetails.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -21,14 +21,8 @@ import kotlinx.serialization.Serializable value = SavedPost::class, mappings = [ - Mapping( - target = "submitterName", - expression = "it.submitter.username", - ), - Mapping( - target = "submitterAvatarUrl", - expression = "it.submitter.avatarUrl", - ), + Mapping(target = "submitterName", expression = "it.submitter.username"), + Mapping(target = "submitterAvatarUrl", expression = "it.submitter.avatarUrl"), ], ) class LobstersPostDetails( diff --git a/settings.gradle.kts b/settings.gradle.kts index 009e03c6..431097a8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,7 @@ pluginManagement { includeModule("dev.iurysouza", "modulegraph") includeModule( "com.jraska.module.graph.assertion", - "com.jraska.module.graph.assertion.gradle.plugin" + "com.jraska.module.graph.assertion.gradle.plugin", ) includeModule("com.gradle", "gradle-enterprise-gradle-plugin") includeModule("com.gradle.enterprise", "com.gradle.enterprise.gradle.plugin") diff --git a/web/src/main/java/com/google/accompanist/web/WebView.kt b/web/src/main/java/com/google/accompanist/web/WebView.kt index 2b20867b..540ff7eb 100644 --- a/web/src/main/java/com/google/accompanist/web/WebView.kt +++ b/web/src/main/java/com/google/accompanist/web/WebView.kt @@ -103,7 +103,7 @@ public fun WebView( onDispose, client, chromeClient, - factory + factory, ) } } @@ -166,7 +166,7 @@ public fun WebView( content.data, content.mimeType, content.encoding, - content.historyUrl + content.historyUrl, ) } is WebContent.Post -> { @@ -204,7 +204,7 @@ public fun WebView( .also { state.webView = it } }, modifier = modifier, - onRelease = { onDispose(it) } + onRelease = { onDispose(it) }, ) } @@ -248,7 +248,7 @@ public open class AccompanistWebViewClient : WebViewClient() { override fun onReceivedError( view: WebView, request: WebResourceRequest?, - error: WebResourceError? + error: WebResourceError?, ) { super.onReceivedError(view, request, error) @@ -298,7 +298,7 @@ public sealed class WebContent { val baseUrl: String? = null, val encoding: String = "utf-8", val mimeType: String? = null, - val historyUrl: String? = null + val historyUrl: String? = null, ) : WebContent() public data class Post(val url: String, val postData: ByteArray) : WebContent() { @@ -417,7 +417,7 @@ public class WebViewNavigator( data class LoadUrl( val url: String, - val additionalHttpHeaders: Map = emptyMap() + val additionalHttpHeaders: Map = emptyMap(), ) : NavigationEvent data class LoadHtml( @@ -425,7 +425,7 @@ public class WebViewNavigator( val baseUrl: String? = null, val mimeType: String? = null, val encoding: String? = "utf-8", - val historyUrl: String? = null + val historyUrl: String? = null, ) : NavigationEvent data class PostUrl(val url: String, val postData: ByteArray) : NavigationEvent { @@ -466,7 +466,7 @@ public class WebViewNavigator( event.html, event.mimeType, event.encoding, - event.historyUrl + event.historyUrl, ) is NavigationEvent.LoadUrl -> { loadUrl(event.url, event.additionalHttpHeaders) @@ -497,7 +497,7 @@ public class WebViewNavigator( baseUrl: String? = null, mimeType: String? = null, encoding: String? = "utf-8", - historyUrl: String? = null + historyUrl: String? = null, ) { coroutineScope.launch { navigationEvents.emit(NavigationEvent.LoadHtml(html, baseUrl, mimeType, encoding, historyUrl)) @@ -546,7 +546,7 @@ public data class WebViewError( /** The request the error came from. */ val request: WebResourceRequest?, /** The error that was reported. */ - val error: WebResourceError + val error: WebResourceError, ) /** @@ -559,7 +559,7 @@ public data class WebViewError( @Composable public fun rememberWebViewState( url: String, - additionalHttpHeaders: ImmutableMap = persistentMapOf() + additionalHttpHeaders: ImmutableMap = persistentMapOf(), ): WebViewState = // Rather than using .apply {} here we will recreate the state, this prevents // a recomposition loop when the webview updates the url itself. @@ -581,7 +581,7 @@ public fun rememberWebViewStateWithHTMLData( baseUrl: String? = null, encoding: String = "utf-8", mimeType: String? = null, - historyUrl: String? = null + historyUrl: String? = null, ): WebViewState = remember { WebViewState(WebContent.Data(data, baseUrl, encoding, mimeType, historyUrl)) } .apply { this.content = WebContent.Data(data, baseUrl, encoding, mimeType, historyUrl) } @@ -619,7 +619,7 @@ public val WebStateSaver: Saver = run { mapOf( pageTitleKey to it.pageTitle, lastLoadedUrlKey to it.lastLoadedUrl, - stateBundle to viewState + stateBundle to viewState, ) }, restore = { @@ -628,6 +628,6 @@ public val WebStateSaver: Saver = run { this.lastLoadedUrl = it[lastLoadedUrlKey] as String? this.viewState = it[stateBundle] as Bundle? } - } + }, ) }