mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 17:37:05 +05:30
all: override LocalUriHandler
with UrlLauncher
This commit is contained in:
parent
26a96d9116
commit
9d538b4600
2 changed files with 10 additions and 2 deletions
|
@ -19,6 +19,7 @@ import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||||
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
|
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
|
||||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||||
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
|
@ -89,7 +90,10 @@ fun LobstersApp(
|
||||||
navController.addOnDestinationChangedListener { _, destination, _ ->
|
navController.addOnDestinationChangedListener { _, destination, _ ->
|
||||||
currentDestination = destination.route ?: Destinations.Hottest
|
currentDestination = destination.route ?: Destinations.Hottest
|
||||||
}
|
}
|
||||||
LobstersTheme(darkTheme = isSystemInDarkTheme()) {
|
LobstersTheme(
|
||||||
|
darkTheme = isSystemInDarkTheme(),
|
||||||
|
providedValues = arrayOf(LocalUriHandler provides urlLauncher),
|
||||||
|
) {
|
||||||
ProvideWindowInsets {
|
ProvideWindowInsets {
|
||||||
val useDarkIcons = MaterialTheme.colors.isLight
|
val useDarkIcons = MaterialTheme.colors.isLight
|
||||||
val statusBarColor = MaterialTheme.colors.primarySurface
|
val statusBarColor = MaterialTheme.colors.primarySurface
|
||||||
|
|
|
@ -9,6 +9,7 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.WindowPlacement
|
import androidx.compose.ui.window.WindowPlacement
|
||||||
import androidx.compose.ui.window.WindowPosition
|
import androidx.compose.ui.window.WindowPosition
|
||||||
|
@ -58,7 +59,10 @@ fun main() = application {
|
||||||
undecorated = true,
|
undecorated = true,
|
||||||
onCloseRequest = ::exitApplication,
|
onCloseRequest = ::exitApplication,
|
||||||
) {
|
) {
|
||||||
LobstersTheme(darkTheme = false) {
|
LobstersTheme(
|
||||||
|
darkTheme = false,
|
||||||
|
providedValues = arrayOf(LocalUriHandler provides urlLauncher),
|
||||||
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue