Replace Skip implementation with Kotlin Multiplatform implementation
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package xyz.tyiu.satsprice
|
||||
|
||||
class JVMPlatform : Platform {
|
||||
override val name: String = "Java ${System.getProperty("java.version")}"
|
||||
}
|
||||
|
||||
actual fun getPlatform(): Platform = JVMPlatform()
|
||||
@@ -0,0 +1,21 @@
|
||||
package xyz.tyiu.satsprice
|
||||
|
||||
import java.util.Currency
|
||||
import java.util.Locale
|
||||
|
||||
actual fun systemCurrencies(): List<CurrencyInfo> =
|
||||
Currency.getAvailableCurrencies()
|
||||
.map { CurrencyInfo(it.currencyCode, it.getDisplayName(Locale.getDefault())) }
|
||||
.sortedBy { it.code }
|
||||
|
||||
actual fun localeCurrencyCode(): String? = try {
|
||||
Currency.getInstance(Locale.getDefault())?.currencyCode
|
||||
} catch (e: IllegalArgumentException) {
|
||||
null
|
||||
}
|
||||
|
||||
actual fun currencyDecimalDigits(code: String): Int = try {
|
||||
Currency.getInstance(code).defaultFractionDigits.takeIf { it >= 0 } ?: 2
|
||||
} catch (e: IllegalArgumentException) {
|
||||
2
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package xyz.tyiu.satsprice.ui
|
||||
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
actual val screenHorizontalPadding: Dp = 24.dp
|
||||
Reference in New Issue
Block a user