| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Update Kotlin version in components, tutorials and examples to 2.1.0 (#5205) | 1 年前 | |
Fix typo errors in SplitPane.kt (#5200) This PR addresses typographical errors in the comments of the splitpane package. The corrections are as follows: 1. **VerticalSplitPane function comment**: - **Original**: "Pane that place it parts **vertically** from top to bottom and allows to change items **heights**." - **Correction**: "Pane that places its parts **vertically** from top to bottom and allows changing items' **heights**." 2. **HorizontalSplitPane function comment**: - **Original**: "Pane that place it parts **horizontally** from left to right and allows to change items **width**." - **Correction**: "Pane that places its parts **horizontally** from left to right and allows changing items' **widths**." 3. **SplitPane function comment**: - **Original**: "@param isHorizontal describes is it horizontal of vertical split pane" - **Correction**: "@param isHorizontal describes whether it is a horizontal or vertical split pane" These changes enhance the clarity and grammatical accuracy of the code comments. **Fixes** N/A **Testing** As these changes are limited to comments and do not affect the executable code, no additional testing is required. **Release Notes** N/A Since the changes are non-functional and pertain only to code comments, they do not necessitate an entry in the release notes. | 1 年前 | |
Support plural string resource (#4519) 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> | 2 年前 | |
Bump versions (Kotlin, AGP, Gradle) (#5399) ## Release Notes N/A | 1 年前 | |
Fix getSystemEnvironment crash on web when a locale region is undefined (#5447) Handle a case when Int.Locale('...') is created without a region - then use an empty string for region. Fixes https://youtrack.jetbrains.com/issue/CMP-6930 ## Testing - Added a test - This should be tested by QA ## Release Notes ### Fixes - Resources - Fix a crash when calling getString and the Locale has no region specified | 11 个月前 | |
Bump versions (Kotlin, AGP, Gradle) (#5399) ## Release Notes N/A | 1 年前 | |
[components/resources] add resource("img.png"). rememberImageBitmap() (#2483) | 3 年前 | |
[resources] Add functions to retrieve bytes from drawable or font resources. (#4651) Implemented two new experimental functions: kotlin /** * Retrieves the byte array of the drawable resource. * * @param environment The resource environment, which can be obtained from [rememberResourceEnvironment] or [getSystemResourceEnvironment]. * @param resource The drawable resource. * @return The byte array representing the drawable resource. */ @ExperimentalResourceApi suspend fun getDrawableResourceBytes( environment: ResourceEnvironment, resource: DrawableResource ): ByteArray {...} /** * Retrieves the byte array of the font resource. * * @param environment The resource environment, which can be obtained from [rememberResourceEnvironment] or [getSystemResourceEnvironment]. * @param resource The font resource. * @return The byte array representing the font resource. */ @ExperimentalResourceApi suspend fun getFontResourceBytes( environment: ResourceEnvironment, resource: FontResource ): ByteArray {...} fixes https://github.com/JetBrains/compose-multiplatform/issues/4360 | 2 年前 | |
Bump versions (Kotlin, AGP, Gradle) (#5399) ## Release Notes N/A | 1 年前 | |
Bump versions (Kotlin, AGP, Gradle) (#5399) ## Release Notes N/A | 1 年前 | |
Custom components template. (#206) | 5 年前 | |
Custom components template. (#206) | 5 年前 | |
Update Kotlin version in components, tutorials and examples to 2.1.0 (#5205) | 1 年前 | |
Add a blocking resources loading for web tests (#5248) For compose resource tests it's acceptable to use blocking http requests. This way we can run the tests right now, without waiting for https://android-review.googlesource.com/c/platform/frameworks/support/+/3509670 to land on our fork. <!-- Optional --> Fixes https://youtrack.jetbrains.com/issue/CMP-7711/Add-blocking-compose-resources-loader-for-web-tests ## Release Notes N/A | 1 年前 |
Libraries for Compose Multiplatform
Resources
Library to load resources, like images.
How to run demo project:
Prerequisites: to run on iOS and Android, you should have "Kotlin Multiplatform Mobile" plugin installed either in Android Studio or in AppCode with installed CocoaPods.
Run on desktop via Gradle:
./gradlew :resources:demo:desktopApp:run
Run JS in browser with WebAssembly Skia via Gradle:
./gradlew :resources:demo:shared:jsBrowserDevelopmentRun
Tests
Run script:
./test.sh