diff --git a/common/build.gradle.kts b/common/build.gradle.kts index fd5c7a14..5a95f5cb 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,13 +1,10 @@ -@file:OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) @file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") -import org.jetbrains.compose.compose import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.pushingpixels.aurora.tools.svgtranscoder.gradle.TranscodeTask plugins { - kotlin("multiplatform") - alias(libs.plugins.compose) + kotlin("android") id("dev.msfjarvis.claw.kotlin-common") id("dev.msfjarvis.claw.android-library") alias(libs.plugins.aurora.svg.transcoder) @@ -15,7 +12,7 @@ plugins { val transcodeTask = tasks.register("transcodeSvgs") { - inputDirectory = file("src/commonMain/svgs/") + inputDirectory = file("svgs") outputDirectory = file("src/gen/kotlin/dev/msfjarvis/claw/common/res/clawicons") outputPackageName = "dev.msfjarvis.claw.common.res.clawicons" transcode() @@ -23,37 +20,35 @@ val transcodeTask = tasks.withType().configureEach { dependsOn(transcodeTask) } -kotlin { - android() - jvm("desktop") - sourceSets["commonMain"].apply { - dependencies { - api(compose.foundation) - api(compose.material) - api(compose.material3) - api(compose.runtime) - api(libs.napier) - api(projects.database) - api(projects.model) - implementation(libs.kotlinx.coroutines.core) - implementation(libs.kotlinx.datetime) - implementation(libs.compose.richtext.markdown) - implementation(libs.compose.richtext.material3) - implementation(libs.compose.richtext.ui) - } - kotlin.srcDir("src/gen/kotlin/") - } - sourceSets["androidMain"].apply { - dependencies { - implementation(libs.androidx.browser) - implementation(libs.coil.compose) - } - } - sourceSets["desktopMain"].apply { dependencies { implementation(libs.kamel.image) } } +dependencies { + implementation(libs.androidx.compose.animation) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.runtime) + implementation(libs.androidx.compose.ui.ui.text) + api(libs.napier) + implementation(projects.database) + implementation(projects.model) + implementation(libs.accompanist.flowlayout) + implementation(libs.androidx.browser) + implementation(libs.coil.compose) + implementation(libs.compose.richtext.markdown) + implementation(libs.compose.richtext.material3) + implementation(libs.compose.richtext.ui) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.datetime) } android { - buildFeatures { androidResources = true } + buildFeatures { + androidResources = true + compose = true + } + composeOptions { + useLiveLiterals = false + kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() + } namespace = "dev.msfjarvis.claw.common" - sourceSets["main"].apply { manifest.srcFile("src/androidMain/AndroidManifest.xml") } + sourceSets { getByName("main") { kotlin.srcDir("src/gen/kotlin") } } } diff --git a/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt b/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt deleted file mode 100644 index 0497c2ff..00000000 --- a/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt +++ /dev/null @@ -1,19 +0,0 @@ -@file:JvmName("AndroidType") - -package dev.msfjarvis.claw.common.theme - -import androidx.compose.ui.text.font.Font -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight -import dev.msfjarvis.claw.common.R - -actual fun createFontFamily() = - FontFamily( - Font(R.font.manrope_bold, FontWeight.Bold), - Font(R.font.manrope_extrabold, FontWeight.ExtraBold), - Font(R.font.manrope_extralight, FontWeight.ExtraLight), - Font(R.font.manrope_light, FontWeight.Light), - Font(R.font.manrope_medium, FontWeight.Medium), - Font(R.font.manrope_regular, FontWeight.Normal), - Font(R.font.manrope_semibold, FontWeight.SemiBold), - ) diff --git a/common/src/commonMain/kotlin/com/google/accompanist/flowlayout/Flow.kt b/common/src/commonMain/kotlin/com/google/accompanist/flowlayout/Flow.kt deleted file mode 100644 index 6cb47535..00000000 --- a/common/src/commonMain/kotlin/com/google/accompanist/flowlayout/Flow.kt +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.accompanist.flowlayout - -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.Layout -import androidx.compose.ui.layout.Placeable -import androidx.compose.ui.unit.Constraints -import androidx.compose.ui.unit.Dp -import androidx.compose.ui.unit.IntSize -import androidx.compose.ui.unit.LayoutDirection -import androidx.compose.ui.unit.dp -import kotlin.math.max - -/** - * A composable that places its children in a horizontal flow. Unlike [Row], if the horizontal space - * is too small to put all the children in one row, multiple rows may be used. - * - * Note that just like [Row], flex values cannot be used with [FlowRow]. - * - * @param modifier The modifier to be applied to the FlowRow. - * @param mainAxisSize The size of the layout in the main axis direction. - * @param mainAxisAlignment The alignment of each row's children in the main axis direction. - * @param mainAxisSpacing The main axis spacing between the children of each row. - * @param crossAxisAlignment The alignment of each row's children in the cross axis direction. - * @param crossAxisSpacing The cross axis spacing between the rows of the layout. - * @param lastLineMainAxisAlignment Overrides the main axis alignment of the last row. - */ -@Composable -fun FlowRow( - modifier: Modifier = Modifier, - mainAxisSize: SizeMode = SizeMode.Wrap, - mainAxisAlignment: FlowMainAxisAlignment = FlowMainAxisAlignment.Start, - mainAxisSpacing: Dp = 0.dp, - crossAxisAlignment: FlowCrossAxisAlignment = FlowCrossAxisAlignment.Start, - crossAxisSpacing: Dp = 0.dp, - lastLineMainAxisAlignment: FlowMainAxisAlignment = mainAxisAlignment, - content: @Composable () -> Unit -) { - Flow( - modifier = modifier, - orientation = LayoutOrientation.Horizontal, - mainAxisSize = mainAxisSize, - mainAxisAlignment = mainAxisAlignment, - mainAxisSpacing = mainAxisSpacing, - crossAxisAlignment = crossAxisAlignment, - crossAxisSpacing = crossAxisSpacing, - lastLineMainAxisAlignment = lastLineMainAxisAlignment, - content = content - ) -} - -/** - * A composable that places its children in a vertical flow. Unlike [Column], if the vertical space - * is too small to put all the children in one column, multiple columns may be used. - * - * Note that just like [Column], flex values cannot be used with [FlowColumn]. - * - * @param modifier The modifier to be applied to the FlowColumn. - * @param mainAxisSize The size of the layout in the main axis direction. - * @param mainAxisAlignment The alignment of each column's children in the main axis direction. - * @param mainAxisSpacing The main axis spacing between the children of each column. - * @param crossAxisAlignment The alignment of each column's children in the cross axis direction. - * @param crossAxisSpacing The cross axis spacing between the columns of the layout. - * @param lastLineMainAxisAlignment Overrides the main axis alignment of the last column. - */ -@Composable -fun FlowColumn( - modifier: Modifier = Modifier, - mainAxisSize: SizeMode = SizeMode.Wrap, - mainAxisAlignment: FlowMainAxisAlignment = FlowMainAxisAlignment.Start, - mainAxisSpacing: Dp = 0.dp, - crossAxisAlignment: FlowCrossAxisAlignment = FlowCrossAxisAlignment.Start, - crossAxisSpacing: Dp = 0.dp, - lastLineMainAxisAlignment: FlowMainAxisAlignment = mainAxisAlignment, - content: @Composable () -> Unit -) { - Flow( - modifier = modifier, - orientation = LayoutOrientation.Vertical, - mainAxisSize = mainAxisSize, - mainAxisAlignment = mainAxisAlignment, - mainAxisSpacing = mainAxisSpacing, - crossAxisAlignment = crossAxisAlignment, - crossAxisSpacing = crossAxisSpacing, - lastLineMainAxisAlignment = lastLineMainAxisAlignment, - content = content - ) -} - -/** Used to specify the alignment of a layout's children, in cross axis direction. */ -enum class FlowCrossAxisAlignment { - /** Place children such that their center is in the middle of the cross axis. */ - Center, - /** Place children such that their start edge is aligned to the start edge of the cross axis. */ - Start, - /** Place children such that their end edge is aligned to the end edge of the cross axis. */ - End, -} - -typealias FlowMainAxisAlignment = MainAxisAlignment - -/** Layout model that arranges its children in a horizontal or vertical flow. */ -@Composable -private fun Flow( - modifier: Modifier, - orientation: LayoutOrientation, - mainAxisSize: SizeMode, - mainAxisAlignment: FlowMainAxisAlignment, - mainAxisSpacing: Dp, - crossAxisAlignment: FlowCrossAxisAlignment, - crossAxisSpacing: Dp, - lastLineMainAxisAlignment: FlowMainAxisAlignment, - content: @Composable () -> Unit -) { - fun Placeable.mainAxisSize() = if (orientation == LayoutOrientation.Horizontal) width else height - fun Placeable.crossAxisSize() = if (orientation == LayoutOrientation.Horizontal) height else width - - Layout(content, modifier) { measurables, outerConstraints -> - val sequences = mutableListOf>() - val crossAxisSizes = mutableListOf() - val crossAxisPositions = mutableListOf() - - var mainAxisSpace = 0 - var crossAxisSpace = 0 - - val currentSequence = mutableListOf() - var currentMainAxisSize = 0 - var currentCrossAxisSize = 0 - - val constraints = OrientationIndependentConstraints(outerConstraints, orientation) - - val childConstraints = - if (orientation == LayoutOrientation.Horizontal) { - Constraints(maxWidth = constraints.mainAxisMax) - } else { - Constraints(maxHeight = constraints.mainAxisMax) - } - - // Return whether the placeable can be added to the current sequence. - fun canAddToCurrentSequence(placeable: Placeable) = - currentSequence.isEmpty() || - currentMainAxisSize + mainAxisSpacing.roundToPx() + placeable.mainAxisSize() <= - constraints.mainAxisMax - - // Store current sequence information and start a new sequence. - fun startNewSequence() { - if (sequences.isNotEmpty()) { - crossAxisSpace += crossAxisSpacing.roundToPx() - } - sequences += currentSequence.toList() - crossAxisSizes += currentCrossAxisSize - crossAxisPositions += crossAxisSpace - - crossAxisSpace += currentCrossAxisSize - mainAxisSpace = max(mainAxisSpace, currentMainAxisSize) - - currentSequence.clear() - currentMainAxisSize = 0 - currentCrossAxisSize = 0 - } - - for (measurable in measurables) { - // Ask the child for its preferred size. - val placeable = measurable.measure(childConstraints) - - // Start a new sequence if there is not enough space. - if (!canAddToCurrentSequence(placeable)) startNewSequence() - - // Add the child to the current sequence. - if (currentSequence.isNotEmpty()) { - currentMainAxisSize += mainAxisSpacing.roundToPx() - } - currentSequence.add(placeable) - currentMainAxisSize += placeable.mainAxisSize() - currentCrossAxisSize = max(currentCrossAxisSize, placeable.crossAxisSize()) - } - - if (currentSequence.isNotEmpty()) startNewSequence() - - val mainAxisLayoutSize = - if (constraints.mainAxisMax != Constraints.Infinity && mainAxisSize == SizeMode.Expand) { - constraints.mainAxisMax - } else { - max(mainAxisSpace, constraints.mainAxisMin) - } - val crossAxisLayoutSize = max(crossAxisSpace, constraints.crossAxisMin) - - val layoutWidth = - if (orientation == LayoutOrientation.Horizontal) { - mainAxisLayoutSize - } else { - crossAxisLayoutSize - } - val layoutHeight = - if (orientation == LayoutOrientation.Horizontal) { - crossAxisLayoutSize - } else { - mainAxisLayoutSize - } - - layout(layoutWidth, layoutHeight) { - sequences.forEachIndexed { i, placeables -> - val childrenMainAxisSizes = - IntArray(placeables.size) { j -> - placeables[j].mainAxisSize() + - if (j < placeables.lastIndex) mainAxisSpacing.roundToPx() else 0 - } - val arrangement = - if (i < sequences.lastIndex) { - mainAxisAlignment.arrangement - } else { - lastLineMainAxisAlignment.arrangement - } - // TODO(soboleva): rtl support - // Handle vertical direction - val mainAxisPositions = IntArray(childrenMainAxisSizes.size) { 0 } - with(arrangement) { arrange(mainAxisLayoutSize, childrenMainAxisSizes, mainAxisPositions) } - placeables.forEachIndexed { j, placeable -> - val crossAxis = - when (crossAxisAlignment) { - FlowCrossAxisAlignment.Start -> 0 - FlowCrossAxisAlignment.End -> crossAxisSizes[i] - placeable.crossAxisSize() - FlowCrossAxisAlignment.Center -> - Alignment.Center.align( - IntSize.Zero, - IntSize(width = 0, height = crossAxisSizes[i] - placeable.crossAxisSize()), - LayoutDirection.Ltr - ) - .y - } - if (orientation == LayoutOrientation.Horizontal) { - placeable.place(x = mainAxisPositions[j], y = crossAxisPositions[i] + crossAxis) - } else { - placeable.place(x = crossAxisPositions[i] + crossAxis, y = mainAxisPositions[j]) - } - } - } - } - } -} - -/** Used to specify how a layout chooses its own size when multiple behaviors are possible. */ -// TODO(popam): remove this when Flow is reworked -enum class SizeMode { - /** - * Minimize the amount of free space by wrapping the children, subject to the incoming layout - * constraints. - */ - Wrap, - /** - * Maximize the amount of free space by expanding to fill the available space, subject to the - * incoming layout constraints. - */ - Expand -} - -/** Used to specify the alignment of a layout's children, in main axis direction. */ -enum class MainAxisAlignment(internal val arrangement: Arrangement.Vertical) { - // TODO(soboleva) support RTl in Flow - // workaround for now - use Arrangement that equals to previous Arrangement - /** Place children such that they are as close as possible to the middle of the main axis. */ - Center(Arrangement.Center), - - /** Place children such that they are as close as possible to the start of the main axis. */ - Start(Arrangement.Top), - - /** Place children such that they are as close as possible to the end of the main axis. */ - End(Arrangement.Bottom), - - /** - * Place children such that they are spaced evenly across the main axis, including free space - * before the first child and after the last child. - */ - SpaceEvenly(Arrangement.SpaceEvenly), - - /** - * Place children such that they are spaced evenly across the main axis, without free space before - * the first child or after the last child. - */ - SpaceBetween(Arrangement.SpaceBetween), - - /** - * Place children such that they are spaced evenly across the main axis, including free space - * before the first child and after the last child, but half the amount of space existing - * otherwise between two consecutive children. - */ - SpaceAround(Arrangement.SpaceAround) -} diff --git a/common/src/commonMain/kotlin/com/google/accompanist/flowlayout/Layout.kt b/common/src/commonMain/kotlin/com/google/accompanist/flowlayout/Layout.kt deleted file mode 100644 index 6b644e2f..00000000 --- a/common/src/commonMain/kotlin/com/google/accompanist/flowlayout/Layout.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.accompanist.flowlayout - -import androidx.compose.ui.unit.Constraints - -internal enum class LayoutOrientation { - Horizontal, - Vertical -} - -internal data class OrientationIndependentConstraints( - val mainAxisMin: Int, - val mainAxisMax: Int, - val crossAxisMin: Int, - val crossAxisMax: Int -) { - constructor( - c: Constraints, - orientation: LayoutOrientation - ) : this( - if (orientation === LayoutOrientation.Horizontal) c.minWidth else c.minHeight, - if (orientation === LayoutOrientation.Horizontal) c.maxWidth else c.maxHeight, - if (orientation === LayoutOrientation.Horizontal) c.minHeight else c.minWidth, - if (orientation === LayoutOrientation.Horizontal) c.maxHeight else c.maxWidth - ) -} diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt b/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt deleted file mode 100644 index fc97ff9f..00000000 --- a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt +++ /dev/null @@ -1,11 +0,0 @@ -package dev.msfjarvis.claw.common.ui - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier - -@Composable -expect fun NetworkImage( - url: String, - contentDescription: String, - modifier: Modifier, -) diff --git a/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt b/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt deleted file mode 100644 index 5a68080b..00000000 --- a/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:JvmName("DesktopType") - -package dev.msfjarvis.claw.common.theme - -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.platform.Font - -actual fun createFontFamily() = - FontFamily( - Font("font/manrope_bold.ttf", FontWeight.Bold), - Font("font/manrope_extrabold.ttf", FontWeight.ExtraBold), - Font("font/manrope_extralight.ttf", FontWeight.ExtraLight), - Font("font/manrope_light.ttf", FontWeight.Light), - Font("font/manrope_medium.ttf", FontWeight.Medium), - Font("font/manrope_regular.ttf", FontWeight.Normal), - Font("font/manrope_semibold.ttf", FontWeight.SemiBold), - ) diff --git a/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt b/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt deleted file mode 100644 index 594ca3f0..00000000 --- a/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt +++ /dev/null @@ -1,19 +0,0 @@ -package dev.msfjarvis.claw.common.ui - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import io.kamel.image.KamelImage -import io.kamel.image.lazyPainterResource - -@Composable -actual fun NetworkImage( - url: String, - contentDescription: String, - modifier: Modifier, -) { - KamelImage( - resource = lazyPainterResource(url), - contentDescription = contentDescription, - modifier = modifier, - ) -} diff --git a/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/urllauncher/UrlLauncher.kt b/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/urllauncher/UrlLauncher.kt deleted file mode 100644 index 272ce080..00000000 --- a/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/urllauncher/UrlLauncher.kt +++ /dev/null @@ -1,22 +0,0 @@ -package dev.msfjarvis.claw.common.urllauncher - -import androidx.compose.ui.platform.UriHandler -import io.github.aakira.napier.Napier -import java.awt.Desktop -import java.io.IOException -import java.net.URI - -class UrlLauncher : UriHandler { - override fun openUri(uri: String) { - if (Desktop.isDesktopSupported()) { - val desktop = Desktop.getDesktop() - if (desktop.isSupported(Desktop.Action.BROWSE)) { - try { - desktop.browse(URI(uri)) - } catch (e: IOException) { - Napier.d(tag = "UrlLauncher") { "Failed to open URL: $uri" } - } - } - } - } -} diff --git a/common/src/desktopMain/resources/font/manrope_bold.ttf b/common/src/desktopMain/resources/font/manrope_bold.ttf deleted file mode 100644 index 8bbf0bd1..00000000 Binary files a/common/src/desktopMain/resources/font/manrope_bold.ttf and /dev/null differ diff --git a/common/src/desktopMain/resources/font/manrope_extrabold.ttf b/common/src/desktopMain/resources/font/manrope_extrabold.ttf deleted file mode 100644 index 3f68dffc..00000000 Binary files a/common/src/desktopMain/resources/font/manrope_extrabold.ttf and /dev/null differ diff --git a/common/src/desktopMain/resources/font/manrope_extralight.ttf b/common/src/desktopMain/resources/font/manrope_extralight.ttf deleted file mode 100644 index 9d21d775..00000000 Binary files a/common/src/desktopMain/resources/font/manrope_extralight.ttf and /dev/null differ diff --git a/common/src/desktopMain/resources/font/manrope_light.ttf b/common/src/desktopMain/resources/font/manrope_light.ttf deleted file mode 100644 index f255257a..00000000 Binary files a/common/src/desktopMain/resources/font/manrope_light.ttf and /dev/null differ diff --git a/common/src/desktopMain/resources/font/manrope_medium.ttf b/common/src/desktopMain/resources/font/manrope_medium.ttf deleted file mode 100644 index c73d7741..00000000 Binary files a/common/src/desktopMain/resources/font/manrope_medium.ttf and /dev/null differ diff --git a/common/src/desktopMain/resources/font/manrope_regular.ttf b/common/src/desktopMain/resources/font/manrope_regular.ttf deleted file mode 100644 index c02b01be..00000000 Binary files a/common/src/desktopMain/resources/font/manrope_regular.ttf and /dev/null differ diff --git a/common/src/desktopMain/resources/font/manrope_semibold.ttf b/common/src/desktopMain/resources/font/manrope_semibold.ttf deleted file mode 100644 index 30ee0310..00000000 Binary files a/common/src/desktopMain/resources/font/manrope_semibold.ttf and /dev/null differ diff --git a/common/src/androidMain/AndroidManifest.xml b/common/src/main/AndroidManifest.xml similarity index 100% rename from common/src/androidMain/AndroidManifest.xml rename to common/src/main/AndroidManifest.xml diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/NetworkState.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/NetworkState.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/NetworkState.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/NetworkState.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentEntry.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/comments/HTMLConverter.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/HTMLConverter.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/comments/HTMLConverter.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/comments/HTMLConverter.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/posts/LobstersCard.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/PostActions.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/posts/PostActions.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/PostActions.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/posts/PostActions.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/ext.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/posts/ext.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/posts/ext.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/posts/ext.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/res/ClawIcons.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/res/ClawIcons.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/res/ClawIcons.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/res/ClawIcons.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Color.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/theme/Color.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Color.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/theme/Color.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/theme/Type.kt similarity index 86% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/theme/Type.kt index fe512bab..37202ae1 100644 --- a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Type.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/theme/Type.kt @@ -2,13 +2,22 @@ package dev.msfjarvis.claw.common.theme import androidx.compose.material3.Typography import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp +import dev.msfjarvis.claw.common.R -expect fun createFontFamily(): FontFamily - -private val Manrope = createFontFamily() +private val Manrope = + FontFamily( + Font(R.font.manrope_bold, FontWeight.Bold), + Font(R.font.manrope_extrabold, FontWeight.ExtraBold), + Font(R.font.manrope_extralight, FontWeight.ExtraLight), + Font(R.font.manrope_light, FontWeight.Light), + Font(R.font.manrope_medium, FontWeight.Medium), + Font(R.font.manrope_regular, FontWeight.Normal), + Font(R.font.manrope_semibold, FontWeight.SemiBold), + ) val AppTypography = Typography( diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/Divider.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Divider.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/Divider.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Divider.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/Markdown.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkError.kt diff --git a/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkImage.kt similarity index 94% rename from common/src/androidMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkImage.kt index ded14377..6cff0196 100644 --- a/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/ui/composables.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/NetworkImage.kt @@ -7,7 +7,7 @@ import androidx.compose.ui.draw.clip import coil.compose.AsyncImage @Composable -actual fun NetworkImage( +fun NetworkImage( url: String, contentDescription: String, modifier: Modifier, diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/ProgressBar.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/ProgressBar.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/ProgressBar.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/ProgressBar.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/decorations/ClawAppBar.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/ClawAppBar.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/decorations/ClawAppBar.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/ClawAppBar.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/decorations/MonthHeader.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/ext.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/ui/ext.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/ui/ext.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/ui/ext.kt diff --git a/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/urllauncher/UrlLauncher.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/urllauncher/UrlLauncher.kt similarity index 100% rename from common/src/androidMain/kotlin/dev/msfjarvis/claw/common/urllauncher/UrlLauncher.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/urllauncher/UrlLauncher.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/util.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/util.kt similarity index 100% rename from common/src/commonMain/kotlin/dev/msfjarvis/claw/common/util.kt rename to common/src/main/kotlin/dev/msfjarvis/claw/common/util.kt diff --git a/common/src/androidMain/res/font/manrope_bold.ttf b/common/src/main/res/font/manrope_bold.ttf similarity index 100% rename from common/src/androidMain/res/font/manrope_bold.ttf rename to common/src/main/res/font/manrope_bold.ttf diff --git a/common/src/androidMain/res/font/manrope_extrabold.ttf b/common/src/main/res/font/manrope_extrabold.ttf similarity index 100% rename from common/src/androidMain/res/font/manrope_extrabold.ttf rename to common/src/main/res/font/manrope_extrabold.ttf diff --git a/common/src/androidMain/res/font/manrope_extralight.ttf b/common/src/main/res/font/manrope_extralight.ttf similarity index 100% rename from common/src/androidMain/res/font/manrope_extralight.ttf rename to common/src/main/res/font/manrope_extralight.ttf diff --git a/common/src/androidMain/res/font/manrope_light.ttf b/common/src/main/res/font/manrope_light.ttf similarity index 100% rename from common/src/androidMain/res/font/manrope_light.ttf rename to common/src/main/res/font/manrope_light.ttf diff --git a/common/src/androidMain/res/font/manrope_medium.ttf b/common/src/main/res/font/manrope_medium.ttf similarity index 100% rename from common/src/androidMain/res/font/manrope_medium.ttf rename to common/src/main/res/font/manrope_medium.ttf diff --git a/common/src/androidMain/res/font/manrope_regular.ttf b/common/src/main/res/font/manrope_regular.ttf similarity index 100% rename from common/src/androidMain/res/font/manrope_regular.ttf rename to common/src/main/res/font/manrope_regular.ttf diff --git a/common/src/androidMain/res/font/manrope_semibold.ttf b/common/src/main/res/font/manrope_semibold.ttf similarity index 100% rename from common/src/androidMain/res/font/manrope_semibold.ttf rename to common/src/main/res/font/manrope_semibold.ttf diff --git a/common/src/commonMain/svgs/arrow_back_black_24dp.svg b/common/svgs/arrow_back_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/arrow_back_black_24dp.svg rename to common/svgs/arrow_back_black_24dp.svg diff --git a/common/src/commonMain/svgs/comment_black_24dp.svg b/common/svgs/comment_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/comment_black_24dp.svg rename to common/svgs/comment_black_24dp.svg diff --git a/common/src/commonMain/svgs/favorite_black_24dp.svg b/common/svgs/favorite_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/favorite_black_24dp.svg rename to common/svgs/favorite_black_24dp.svg diff --git a/common/src/commonMain/svgs/favorite_border_black_24dp.svg b/common/svgs/favorite_border_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/favorite_border_black_24dp.svg rename to common/svgs/favorite_border_black_24dp.svg diff --git a/common/src/commonMain/svgs/new_releases_black_24dp.svg b/common/svgs/new_releases_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/new_releases_black_24dp.svg rename to common/svgs/new_releases_black_24dp.svg diff --git a/common/src/commonMain/svgs/new_releases_filled_black_24dp.svg b/common/svgs/new_releases_filled_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/new_releases_filled_black_24dp.svg rename to common/svgs/new_releases_filled_black_24dp.svg diff --git a/common/src/commonMain/svgs/public_black_24dp.svg b/common/svgs/public_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/public_black_24dp.svg rename to common/svgs/public_black_24dp.svg diff --git a/common/src/commonMain/svgs/whatshot_black_24dp.svg b/common/svgs/whatshot_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/whatshot_black_24dp.svg rename to common/svgs/whatshot_black_24dp.svg diff --git a/common/src/commonMain/svgs/whatshot_filled_black_24dp.svg b/common/svgs/whatshot_filled_black_24dp.svg similarity index 100% rename from common/src/commonMain/svgs/whatshot_filled_black_24dp.svg rename to common/svgs/whatshot_filled_black_24dp.svg diff --git a/settings.gradle.kts b/settings.gradle.kts index c8aa6f27..c3fe5232 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -98,6 +98,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") include( "api", + "common", "database", "model", )