Ports a part of Unicode's ICU in pure Kotlin and implements
Android-style plural string resource support. Fixes
JetBrains/compose-multiplatform#425.
# Changes
- Added `org.jetbrains.compose.resources.intl.{PluralCategory,
PluralRule, PluralRuleList}`, which parses and evaluates scripts in
Unicode's Locale Data Markup Langauge.
- Copied `plurals.xml` from Unicode's
[CLDR](https://github.com/unicode-org/cldr/blob/release-44-1/common/supplemental/plurals.xml).
- Added `GeneratePluralRuleListsTask`, which parses `plurals.xml` and
generates required Kotlin source codes.
- Added `PluralStringResource`, `pluralStringResource`, or
`getPluralString`, corresponding to `StringResource`, `stringResource`,
or `getString`.
- Modified `ResourcesSpec.kt` so the generated `Res` class exposes
`Res.plurals`.
# Potential Further Improvements
- [ ] Allow configuring the default language in the `compose.resources
{}` block (#4482) to determine the default pluralization rule (or just
presume English as default)
- [ ] Move the parser logic to the Gradle plugin and generate
pluralization rules in `Res` only for languages used in
`composeResources`
---------
Co-authored-by: Konstantin Tskhovrebov <konstantin.tskhovrebov@jetbrains.com>
Changes:
- added k/wasm target to library and demo
- added libs.versions.toml with coroutines version
Tested:
- using demo project
- publishToMavenLocal
I'll setup the test separately.
---------
Co-authored-by: Oleksandr.Karpovich <oleksandr.karpovich@jetbrains.com>
There was a problem with an android publication. Android artifactId has
name "module_name"-"android" even though we explicitly renamed
artifactId inside the configureMavenPublication block. It means that
"components-ui-tooling-preview" android library rewrites
"components-resources" android library on the maven. Because they have
the same name "library-android".
Dowgrading to Kotlin 1.8 will allow to use `components` in Kotlin 1.8 and Kotlin 1.9 projects (iOS, JS targets). Now it is supported only in Kotlin 1.9 projects.
* Added animated image component
* Simplified network request
* Resource load is now done in the IO Dispatchers
* Renamed constant to express better its use
* Refactored animated image component to use the default Image component instead of creating our own component
* Added missing keys
* Created new module resources & adapted AnimatedImage to it
SplitPane by design, shouldn't have default visual representation, because it mostly depends on the design system (material, material3, etc)
Fixes https://github.com/JetBrains/compose-jb/issues/1975
RelNote:
SplitPane no longer depends on compose.material. Now, by default, SplitPane has invisible 0px splitter, not 1px black/white splitter as it was before. If you want to preserve the previous behaviour, specify a splitter explicitly:
```
HorizontalSplitPane(splitterState) {
splitter {
visiblePart {
Box(
Modifier
.height(1.dp)
.fillMaxHeight()
.background(MaterialTheme.colors.background)
)
}
}
}
```