|
|
|
|
@ -3,9 +3,10 @@ package net.pokeranalytics.android.model.handhistory |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Action |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowViewType |
|
|
|
|
import net.pokeranalytics.android.ui.view.handhistory.HandHistoryKeyboard |
|
|
|
|
|
|
|
|
|
interface HandHistoryRow : RowRepresentable { |
|
|
|
|
fun isValid() : Boolean |
|
|
|
|
fun keyboardForCompletion() : HandHistoryKeyboard? |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class ComputedAction(var action: Action, |
|
|
|
|
@ -38,15 +39,15 @@ class ComputedAction(var action: Action, |
|
|
|
|
|
|
|
|
|
override val viewType: Int = RowViewType.ROW_HAND_ACTION.ordinal |
|
|
|
|
|
|
|
|
|
override fun isValid() : Boolean { |
|
|
|
|
return action.type?.let { type -> |
|
|
|
|
if (this.requireAmount) { |
|
|
|
|
return this.action.amount != null |
|
|
|
|
override fun keyboardForCompletion() : HandHistoryKeyboard? { |
|
|
|
|
this.action.type?.let { type -> |
|
|
|
|
if (this.requireAmount && this.action.amount == null) { |
|
|
|
|
return HandHistoryKeyboard.ACTION |
|
|
|
|
} else { |
|
|
|
|
return true |
|
|
|
|
return null |
|
|
|
|
} |
|
|
|
|
} ?: run { |
|
|
|
|
false |
|
|
|
|
return HandHistoryKeyboard.ACTION |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|