--- a/ui/material3/src/commonMain/kotlin/com/geekorum/aboutoss/ui/material3/AdaptiveOpenSourceDependenciesScreen.kt Mon May 05 03:37:00 2025 -0400
+++ b/ui/material3/src/commonMain/kotlin/com/geekorum/aboutoss/ui/material3/AdaptiveOpenSourceDependenciesScreen.kt Mon May 05 11:45:00 2025 -0400
@@ -76,6 +76,7 @@
import androidx.compose.ui.backhandler.BackHandler
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.text.ExperimentalTextApi
+import androidx.compose.ui.text.LinkAnnotation
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -88,6 +89,9 @@
import com.geekorum.aboutoss.common.generated.resources.Res as CommonRes
+/**
+ * Display opensource licences in an adaptive screen
+ */
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
@Composable
fun AdaptiveOpenSourceDependenciesScreen(
@@ -139,6 +143,13 @@
)
}
+/**
+ * Display opensource licences in an adaptive screen
+ *
+ * @param dependenciesListPane the pane that display dependencies list
+ * @param dependencyLicensePane the pane that display license of dependency
+ * @param modifier Modifier of the screen
+ */
@OptIn(ExperimentalMaterial3AdaptiveApi::class, ExperimentalComposeUiApi::class)
@Composable
fun AdaptiveOpenSourceDependenciesScreen(
@@ -321,7 +332,9 @@
val linkifiedLicense = linkifyText(text = license, onUrlClick = onUrlClick)
LaunchedEffect(linkifiedLicense) {
val uris =
- linkifiedLicense.getUrlAnnotations(0, linkifiedLicense.length).map { it.item.url }
+ linkifiedLicense.getLinkAnnotations(0, linkifiedLicense.length).map { it.item }
+ .filterIsInstance<LinkAnnotation.Url>()
+ .map { it.url }
onUrlsFound(uris)
}
@@ -359,11 +372,18 @@
}
}
+/**
+ * Scope for the children of [AdaptiveOpenSourceDependenciesScreen]
+ */
@Stable
interface OpenSourcePaneScope {
+
val isSinglePane: Boolean
val selectedDependency: String?
+ /**
+ * Navigate to display the license details of [dependency]
+ */
suspend fun showLicenseDetails(dependency: String)
suspend fun navigateBack()
--- a/ui/material3/src/commonMain/kotlin/com/geekorum/aboutoss/ui/material3/OpenSourceDependenciesNavHost.kt Mon May 05 03:37:00 2025 -0400
+++ b/ui/material3/src/commonMain/kotlin/com/geekorum/aboutoss/ui/material3/OpenSourceDependenciesNavHost.kt Mon May 05 11:45:00 2025 -0400
@@ -37,6 +37,9 @@
val dependency: String
)
+/**
+ * Display opensource licences using [androidx.navigation.NavHost]
+ */
@Composable
fun OpenSourceDependenciesNavHost(
openSourceLicensesViewModel: OpenSourceLicensesViewModel,
--- a/ui/material3/src/desktopMain/kotlin/OpenSourceLicensesWindow.kt Mon May 05 03:37:00 2025 -0400
+++ b/ui/material3/src/desktopMain/kotlin/OpenSourceLicensesWindow.kt Mon May 05 11:45:00 2025 -0400
@@ -34,6 +34,9 @@
import com.geekorum.aboutoss.ui.common.OpenSourceLicensesViewModel
import org.jetbrains.compose.resources.stringResource
+/**
+ * Display opensource licences in a new window
+ */
@Composable
fun OpenSourceLicensesWindow(
onCloseRequest: () -> Unit,
@@ -46,6 +49,9 @@
OpenSourceLicensesWindow(onCloseRequest, state, viewModel)
}
+/**
+ * Display opensource licences in a new window
+ */
@Composable
fun OpenSourceLicensesWindow(
onCloseRequest: () -> Unit,