GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — - no need anymore to custom handle dialog for wasm · felex13/AboutLibraries@c6c7f7a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app-wasm/src/wasmJsMain/kotlin
    • Main.kt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app-wasm/src/wasmJsMain/kotlin/Main.kt‎

Copy file name to clipboardExpand all lines: app-wasm/src/wasmJsMain/kotlin/Main.kt
-34Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ import androidx.compose.material.Scaffold
44
import androidx.compose.material.Text
55
import androidx.compose.material.TopAppBar
66
import androidx.compose.runtime.getValue
7-
import androidx.compose.runtime.mutableStateOf
8-
import androidx.compose.runtime.remember
97
import androidx.compose.ui.ExperimentalComposeUiApi
108
import androidx.compose.ui.Modifier
11-
import androidx.compose.ui.platform.LocalUriHandler
129
import androidx.compose.ui.window.CanvasBasedWindow
13-
import com.mikepenz.aboutlibraries.entity.Library
1410
import com.mikepenz.aboutlibraries.ui.compose.LibrariesContainer
15-
import com.mikepenz.aboutlibraries.ui.compose.LicenseDialog
1611
import com.mikepenz.aboutlibraries.ui.compose.rememberLibraries
17-
import com.mikepenz.aboutlibraries.ui.compose.util.htmlReadyLicenseContent
1812
import org.jetbrains.compose.resources.ExperimentalResourceApi
1913

2014
@OptIn(ExperimentalComposeUiApi::class, ExperimentalResourceApi::class)
@@ -27,38 +21,10 @@ fun main() {
2721
val libraries by rememberLibraries {
2822
Res.readBytes("files/aboutlibraries.json").decodeToString()
2923
}
30-
val uriHandler = LocalUriHandler.current
31-
val openDialog = remember { mutableStateOf<Library?>(null) }
32-
3324
LibrariesContainer(
3425
libraries,
3526
Modifier.fillMaxSize(),
36-
onLibraryClick = { library ->
37-
val license = library.licenses.firstOrNull()
38-
if (!license?.url.isNullOrBlank()) {
39-
license?.url?.also {
40-
try {
41-
uriHandler.openUri(it)
42-
} catch (t: Throwable) {
43-
println("Failed to open url: ${it}")
44-
}
45-
}
46-
} else if (!license?.htmlReadyLicenseContent.isNullOrBlank()) {
47-
openDialog.value = library
48-
}
49-
},
5027
)
51-
52-
53-
val library = openDialog.value
54-
if (library != null) {
55-
// TODO use https://android-review.googlesource.com/c/platform/frameworks/support/+/3024604
56-
LicenseDialog(library, body = {
57-
Text(library.licenses.firstOrNull()?.htmlReadyLicenseContent ?: "")
58-
}) {
59-
openDialog.value = null
60-
}
61-
}
6228
}
6329
}
6430
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.