Update bankroll live settings

feature/top10
Aurelien Hubert 7 years ago
parent 83fa8a4f92
commit 78d4277b61
  1. 7
      app/src/main/java/net/pokeranalytics/android/model/realm/Bankroll.kt
  2. 2
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollRow.kt

@ -63,7 +63,7 @@ open class Bankroll(name: String = "") : RealmObject(), Savable,
override fun boolForRow(row: RowRepresentable): Boolean {
when (row) {
BankrollRow.LIVE -> return this.live
BankrollRow.LIVE -> return !this.live
else -> return super.boolForRow(row)
}
}
@ -84,8 +84,9 @@ open class Bankroll(name: String = "") : RealmObject(), Savable,
override fun updateValue(value: Any?, row: RowRepresentable) {
when (row) {
SimpleRow.NAME -> this.name = value as String? ?: ""
BankrollRow.LIVE -> this.live = value as Boolean? ?: false
BankrollRow.LIVE -> {
this.live = if (value is Boolean) !value else false
}
}
}

@ -12,7 +12,7 @@ enum class BankrollRow : RowRepresentable {
override val resId: Int?
get() {
return when (this) {
LIVE -> R.string.live
LIVE -> R.string.online
}
}

Loading…
Cancel
Save