Default temp unit and weather provider based on locale

This commit is contained in:
Tommaso Berlose
2021-01-05 11:08:13 +01:00
parent 0aec34dcd2
commit 536ed64d41
4 changed files with 18 additions and 5 deletions

View File

@ -257,4 +257,11 @@ fun Intent.isDefaultSet(context: Context): Boolean {
} catch (ex: java.lang.Exception) {
false
}
}
fun Locale.isMetric(): Boolean {
return when (country.toUpperCase(this)) {
"US", "LR", "MM", "GB" -> false
else -> true
}
}