|
|
|
|
@ -21,8 +21,18 @@ import java.util.* |
|
|
|
|
|
|
|
|
|
class CurrenciesFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, RowRepresentableDelegate { |
|
|
|
|
|
|
|
|
|
private val mostUsedCurrencyCodes = arrayListOf("EUR", "USD", "CAD", "GBP", "AUD", "CNY") |
|
|
|
|
private val systemCurrencies = Currency.getAvailableCurrencies() |
|
|
|
|
companion object { |
|
|
|
|
val rowRepresentation : List<RowRepresentable> by lazy { |
|
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
|
rows.addAll(mostUsedCurrencies) |
|
|
|
|
rows.add(SeparatorRowRepresentable()) |
|
|
|
|
rows.addAll(availableCurrencies) |
|
|
|
|
rows |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val mostUsedCurrencyCodes = arrayListOf("EUR", "USD", "CAD", "GBP", "AUD", "CNY") |
|
|
|
|
val systemCurrencies = Currency.getAvailableCurrencies() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private val mostUsedCurrencies = this.mostUsedCurrencyCodes.map { code -> |
|
|
|
|
CurrencyRow( |
|
|
|
|
@ -39,6 +49,7 @@ class CurrenciesFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataS |
|
|
|
|
}.map { |
|
|
|
|
CurrencyRow(it) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class CurrencyRow(var currency:Currency) : RowRepresentable { |
|
|
|
|
|
|
|
|
|
@ -68,11 +79,7 @@ class CurrenciesFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataS |
|
|
|
|
// StaticRowRepresentableDataSource |
|
|
|
|
|
|
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
|
rows.addAll(mostUsedCurrencies) |
|
|
|
|
rows.add(SeparatorRowRepresentable()) |
|
|
|
|
rows.addAll(availableCurrencies) |
|
|
|
|
return rows |
|
|
|
|
return CurrenciesFragment.rowRepresentation |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|