Add bankroll & location for Session details

dev_raz_wip
Aurelien Hubert 7 years ago
parent e244e7a561
commit a71f49b657
  1. 6
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt
  2. 14
      app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicRowInterface.kt

@ -156,6 +156,12 @@ open class Session : RealmObject(), SessionInterface, DynamicRowDelegate, Displa
SessionRow.GAME -> {
data.add(BottomSheetData(game, "", 0, SettingRow.GAME.items(realm)))
}
SessionRow.LOCATION -> {
data.add(BottomSheetData(location, "", 0, SettingRow.LOCATION.items(realm)))
}
SessionRow.BANKROLL -> {
data.add(BottomSheetData(bankroll, "", 0, SettingRow.BANKROLL.items(realm)))
}
SessionRow.DATE -> {
data.add(BottomSheetData(timeFrame?.startDate, "Start date"))
data.add(BottomSheetData(timeFrame?.endDate, "End date"))

@ -17,9 +17,9 @@ interface DynamicRowInterface {
}
interface DynamicValues {
fun items(realm: Realm): RealmResults<*>
var sortingFieldName: String
var sorting: Sort
fun items(realm: Realm): RealmResults<*>
var sortingFieldName: String
var sorting: Sort
fun clazz(): Class<out RealmObject>
}
@ -36,8 +36,10 @@ class SectionRow(stringRes: Int) : DynamicRowInterface {
}
enum class SessionRow(val resId: Int) : DynamicRowInterface {
BLINDS(R.string.blinds),
GAME(R.string.game),
BLINDS(R.string.blinds),
LOCATION(R.string.location),
BANKROLL(R.string.bankroll),
DATE(R.string.date);
override fun localizedTitle(context: Context): String {
@ -47,7 +49,7 @@ enum class SessionRow(val resId: Int) : DynamicRowInterface {
override var viewType: Int = RowViewType.HEADER.ordinal
get() {
return when (this) {
BLINDS, GAME, DATE -> RowViewType.TITLE_VALUE.ordinal
BLINDS, GAME, DATE, BANKROLL, LOCATION -> RowViewType.TITLE_VALUE.ordinal
}
}
@ -56,6 +58,8 @@ enum class SessionRow(val resId: Int) : DynamicRowInterface {
return when (this) {
BLINDS -> BottomSheetType.DOUBLE_EDIT_TEXT
GAME -> BottomSheetType.LIST
LOCATION -> BottomSheetType.LIST
BANKROLL -> BottomSheetType.LIST
DATE -> BottomSheetType.DATE
}
}

Loading…
Cancel
Save