Browse Source

Update README.md

pull/1738/head
xiaoshen 2 years ago committed by GitHub
parent
commit
5a690e892b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      experimental/lwjgl-integration/README.md

15
experimental/lwjgl-integration/README.md

@ -40,3 +40,18 @@ CompositionLocalProvider(
// Your App
}
```
`LocalLayerContainer` is internal, so you need to use a trick.
Create a package `androidx.compose.ui.awt` and create a file `LocalLayerContainer.desktop.kt`
Put following code inside
```kotlin
import androidx.compose.runtime.staticCompositionLocalOf
import your.package.yourFakeAwtContainer
val LocalLayerContainer: androidx.compose.runtime.ProvidableCompositionLocal<java.awt.Container> =
staticCompositionLocalOf { yourFakeAwtContainer }
```
Then you would be able to access the internal `LocalLayerContainer`

Loading…
Cancel
Save