|
|
|
|
@ -15,6 +15,7 @@ import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowViewType |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.HeaderRowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.SeparatorRowRepresentable |
|
|
|
|
import net.pokeranalytics.android.util.Preferences |
|
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
@ -69,7 +70,7 @@ class CurrenciesFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataS |
|
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
|
rows.addAll(mostUsedCurrencies) |
|
|
|
|
rows.add(HeaderRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.currency)) |
|
|
|
|
rows.add(SeparatorRowRepresentable()) |
|
|
|
|
rows.addAll(availableCurrencies) |
|
|
|
|
return rows |
|
|
|
|
|
|
|
|
|
@ -82,6 +83,7 @@ class CurrenciesFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataS |
|
|
|
|
// RowRepresentableDelegate |
|
|
|
|
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { |
|
|
|
|
Preferences.setCurrencyCode((row as CurrencyRow).currency.currencyCode, this.context!!) |
|
|
|
|
this.activity?.finish() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun initData() { |
|
|
|
|
|