Introduce simplePluralStringResource methods, as Composable and in StringProvider.
This commit is contained in:
parent
1195499eb7
commit
8c02d873d8
8 changed files with 104 additions and 10 deletions
|
|
@ -28,4 +28,14 @@ class AndroidStringProvider(private val resources: Resources) : StringProvider {
|
|||
override fun getQuantityString(@PluralsRes resId: Int, quantity: Int, vararg formatArgs: Any?): String {
|
||||
return resources.getQuantityString(resId, quantity, *formatArgs)
|
||||
}
|
||||
|
||||
override fun getSimpleQuantityString(
|
||||
resIdForOne: Int,
|
||||
resIdForOthers: Int,
|
||||
quantity: Int,
|
||||
vararg formatArgs: Any?,
|
||||
): String {
|
||||
val resId = if (quantity == 1) resIdForOne else resIdForOthers
|
||||
return resources.getString(resId, *formatArgs)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue