|
|
|
#Gradle
|
|
|
|
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
|
|
|
|
org.gradle.caching=true
|
|
|
|
org.gradle.configuration-cache=true
|
|
|
|
|
|
|
|
#Android
|
|
|
|
android.useAndroidX=true
|
|
|
|
|
|
|
|
#Versions
|
Add a new experimental web-specific API to preload fonts and images resources (#5159)
## Release Notes
### Features - Resources
- Add new API to preload and cache font and image resources on web
targets: `preloadFont`, `preloadImageBitmap`, `preloadImageVector`
____
Add a new experimental web-specific API to preload fonts and images:
```kotlin
@Composable
fun preloadFont(
resource: FontResource,
weight: FontWeight = FontWeight.Normal,
style: FontStyle = FontStyle.Normal
): State<Font?>
@Composable
fun preloadImageBitmap(
resource: DrawableResource,
): State<ImageBitmap?>
@Composable
fun preloadImageVector(
resource: DrawableResource,
): State<ImageVector?>
```
Using this methods in advance, it's possible to avoid FOUT (flash of
unstyled text), or flickering of images/icons.
Usage example:
```kotlin
val font1 by preloadFont(Res.font.Workbench_Regular)
val font2 by preloadFont(Res.font.font_awesome, FontWeight.Normal, FontStyle.Normal)
UseResources() // Main App that uses the above fonts
if (font1 != null && font2 != null) {
println("Fonts are ready")
} else {
Box(modifier = Modifier.fillMaxSize().background(Color.White.copy(alpha = 0.8f)).clickable { }) {
CircularProgressIndicator(modifier = Modifier.align(Alignment.Center))
}
println("Fonts are not ready yet")
}
```
2 months ago
|
|
|
kotlin.version=1.9.24
|
|
|
|
agp.version=8.2.2
|
Add a new experimental web-specific API to preload fonts and images resources (#5159)
## Release Notes
### Features - Resources
- Add new API to preload and cache font and image resources on web
targets: `preloadFont`, `preloadImageBitmap`, `preloadImageVector`
____
Add a new experimental web-specific API to preload fonts and images:
```kotlin
@Composable
fun preloadFont(
resource: FontResource,
weight: FontWeight = FontWeight.Normal,
style: FontStyle = FontStyle.Normal
): State<Font?>
@Composable
fun preloadImageBitmap(
resource: DrawableResource,
): State<ImageBitmap?>
@Composable
fun preloadImageVector(
resource: DrawableResource,
): State<ImageVector?>
```
Using this methods in advance, it's possible to avoid FOUT (flash of
unstyled text), or flickering of images/icons.
Usage example:
```kotlin
val font1 by preloadFont(Res.font.Workbench_Regular)
val font2 by preloadFont(Res.font.font_awesome, FontWeight.Normal, FontStyle.Normal)
UseResources() // Main App that uses the above fonts
if (font1 != null && font2 != null) {
println("Fonts are ready")
} else {
Box(modifier = Modifier.fillMaxSize().background(Color.White.copy(alpha = 0.8f)).clickable { }) {
CircularProgressIndicator(modifier = Modifier.align(Alignment.Center))
}
println("Fonts are not ready yet")
}
```
2 months ago
|
|
|
compose.version=1.7.0
|
|
|
|
deploy.version=0.1.0-SNAPSHOT
|
|
|
|
|
|
|
|
#Compose
|
|
|
|
org.jetbrains.compose.experimental.jscanvas.enabled=true
|
|
|
|
org.jetbrains.compose.experimental.macos.enabled=true
|
|
|
|
compose.desktop.verbose=true
|
|
|
|
compose.useMavenLocal=false
|
|
|
|
|
|
|
|
#Kotlin
|
|
|
|
kotlin.code.style=official
|
|
|
|
kotlin.js.compiler=ir
|
|
|
|
kotlin.js.webpack.major.version=4
|
|
|
|
kotlin.native.useEmbeddableCompilerJar=true
|
|
|
|
xcodeproj=./resources/demo/iosApp
|