Show additional info for unit and currency converter (#720)

* Now for conversion patterns such as "TO > FROM" and "TO - FROM" are accepted

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>

* Added help URL for unit converter

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>

* Localized supported units are now shown on a screen that can be invoked from unit converter settings

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>

* Made localizable titles for dimensions and preferences

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>

* Show currency units on list if enabled.

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>

* Supported units are now listed inline instead of a separate screen.

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>

---------

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>
This commit is contained in:
Guillermo Villafuerte
2024-08-12 15:13:02 +02:00
committed by GitHub
parent 1a4f4d5e96
commit 827eb08908
11 changed files with 169 additions and 31 deletions
@@ -161,6 +161,12 @@ class CurrencyRepository(
}
}
suspend fun getKnownUnits(): List<String> {
return withContext(Dispatchers.IO) {
AppDatabase.getInstance(context).currencyDao().getAllCurrencies().map { it.symbol }
}
}
suspend fun isValidCurrency(symbol: String): Boolean {
val isoSymbol = currencySymbolAliases[symbol] ?: symbol
return withContext(Dispatchers.IO) {