Default temp unit and weather provider based on locale
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user