-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from icerockdev/develop
Release 0.18.0
- Loading branch information
Showing
102 changed files
with
1,794 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="dev.icerock.moko.resources.compose" /> |
31 changes: 31 additions & 0 deletions
31
...urces-compose/src/androidMain/kotlin/dev/icerock/moko/resources/compose/StringResource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.moko.resources.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalContext | ||
import dev.icerock.moko.resources.PluralsResource | ||
import dev.icerock.moko.resources.StringResource | ||
import dev.icerock.moko.resources.desc.Plural | ||
import dev.icerock.moko.resources.desc.PluralFormatted | ||
import dev.icerock.moko.resources.desc.Resource | ||
import dev.icerock.moko.resources.desc.ResourceFormatted | ||
import dev.icerock.moko.resources.desc.StringDesc | ||
|
||
@Composable | ||
actual fun stringResource(resource: StringResource): String = | ||
StringDesc.Resource(resource).toString(LocalContext.current) | ||
|
||
@Composable | ||
actual fun stringResource(resource: StringResource, vararg args: Any): String = | ||
StringDesc.ResourceFormatted(resource, args).toString(LocalContext.current) | ||
|
||
@Composable | ||
actual fun stringResource(resource: PluralsResource, quantity: Int): String = | ||
StringDesc.Plural(resource, quantity).toString(LocalContext.current) | ||
|
||
@Composable | ||
actual fun stringResource(resource: PluralsResource, quantity: Int, vararg args: Any): String = | ||
StringDesc.PluralFormatted(resource, quantity, args).toString(LocalContext.current) |
20 changes: 20 additions & 0 deletions
20
resources-compose/src/commonMain/kotlin/dev/icerock/moko/resources/compose/StringResource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
package dev.icerock.moko.resources.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import dev.icerock.moko.resources.PluralsResource | ||
import dev.icerock.moko.resources.StringResource | ||
|
||
@Composable | ||
expect fun stringResource(resource: StringResource): String | ||
|
||
@Composable | ||
expect fun stringResource(resource: StringResource, vararg args: Any): String | ||
|
||
@Composable | ||
expect fun stringResource(resource: PluralsResource, quantity: Int): String | ||
|
||
@Composable | ||
expect fun stringResource(resource: PluralsResource, quantity: Int, vararg args: Any): String |
Oops, something went wrong.