|
|
|
|
@ -114,9 +114,8 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS |
|
|
|
|
return when (row) { |
|
|
|
|
SimpleRow.NAME -> row.editingDescriptors(mapOf("defaultValue" to this.bankroll.name)) |
|
|
|
|
BankrollRow.RATE -> { |
|
|
|
|
val rate = this.bankroll.currency?.rate ?: 1.0 |
|
|
|
|
val rateFormatted = CurrencyUtils.getCurrencyRateFormatter().format(rate) |
|
|
|
|
row.editingDescriptors(mapOf("defaultValue" to rateFormatted)) |
|
|
|
|
val rate = this.bankroll.currency?.rate |
|
|
|
|
row.editingDescriptors(mapOf("defaultValue" to rate)) |
|
|
|
|
} |
|
|
|
|
else -> null |
|
|
|
|
} |
|
|
|
|
@ -205,7 +204,7 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS |
|
|
|
|
override fun onResponse(call: Call<Map<String, CurrencyConverterValue>>, response: Response<Map<String, CurrencyConverterValue>>) { |
|
|
|
|
response.body()?.let { |
|
|
|
|
it[currenciesConverterValue]?.value?.let { rate -> |
|
|
|
|
onRowValueChanged(rate.toString(), BankrollRow.RATE) |
|
|
|
|
onRowValueChanged(rate, BankrollRow.RATE) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|