# HG changeset patch # User Da Risk # Date 1745532860 14400 # Node ID 90083049bcb8ce7dddb9ddc1570b06759bd3e33b # Parent 4e2dd3a58b748a4e70166ee1f10f8a51ff7caefc ui:material3 use BrowserLauncher diff -r 4e2dd3a58b74 -r 90083049bcb8 ui/material3/build.gradle.kts --- a/ui/material3/build.gradle.kts Thu Apr 24 18:12:44 2025 -0400 +++ b/ui/material3/build.gradle.kts Thu Apr 24 18:14:20 2025 -0400 @@ -58,6 +58,7 @@ api(project(":ui:common")) implementation(project(":core")) implementation(compose.material3) + implementation(libs.org.jetbrains.compose.material.icons.core) implementation(compose.components.resources) implementation(libs.org.jetbrains.androidx.navigation.compose) } diff -r 4e2dd3a58b74 -r 90083049bcb8 ui/material3/src/commonMain/kotlin/com/geekorum/aboutoss/ui/material3/OpenSourceLicenseScreen.kt --- a/ui/material3/src/commonMain/kotlin/com/geekorum/aboutoss/ui/material3/OpenSourceLicenseScreen.kt Thu Apr 24 18:12:44 2025 -0400 +++ b/ui/material3/src/commonMain/kotlin/com/geekorum/aboutoss/ui/material3/OpenSourceLicenseScreen.kt Thu Apr 24 18:14:20 2025 -0400 @@ -59,7 +59,9 @@ import androidx.compose.ui.text.withAnnotation import androidx.compose.ui.text.withStyle import androidx.compose.ui.unit.dp +import com.geekorum.aboutoss.ui.common.BrowserLauncher import com.geekorum.aboutoss.ui.common.OpenSourceLicensesViewModel +import com.geekorum.aboutoss.ui.common.rememberBrowserLauncher /** * Display the opensource license of a dependency @@ -73,6 +75,7 @@ viewModel: OpenSourceLicensesViewModel, dependency: String, onUpClick: () -> Unit, + browserLauncher: BrowserLauncher = rememberBrowserLauncher() ) { val license by viewModel.getLicenseDependency(dependency).collectAsState("") OpenSourceLicenseScreen( @@ -80,10 +83,10 @@ license = license, onUpClick = onUpClick, onUrlClick = { - viewModel.openLinkInBrowser(it) + browserLauncher.launchUrl(it) }, onUrlsFound = { - viewModel.mayLaunchUrl(*it.toTypedArray()) + browserLauncher.mayLaunchUrl(*it.toTypedArray()) } ) }