|
|
|
|
@ -395,8 +395,13 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra |
|
|
|
|
* Sets the typed amount in the relevant ComputedAction |
|
|
|
|
*/ |
|
|
|
|
fun amountValidated() { |
|
|
|
|
try { |
|
|
|
|
this.currentAmount?.toDouble()?.let { amount -> |
|
|
|
|
|
|
|
|
|
val amount = try { |
|
|
|
|
this.currentAmount?.toDouble() |
|
|
|
|
} catch (e: NumberFormatException) { |
|
|
|
|
Timber.w("Parsing exception: ${e.message}") |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val row = this.rowRepresentables[this.currentSelection.index] |
|
|
|
|
when (row) { |
|
|
|
|
@ -410,12 +415,14 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra |
|
|
|
|
this.handHistory.bigBlind = amount |
|
|
|
|
this.sortedActions.updateBlinds() |
|
|
|
|
} |
|
|
|
|
2 -> this.handHistory.ante = amount |
|
|
|
|
2 -> this.handHistory.ante = amount ?: 0.0 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
is ComputedAction -> { |
|
|
|
|
amount?.let { |
|
|
|
|
this.sortedActions.setAmount(this.actionIndexForSelection, amount) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
is PlayerSetupRow -> { |
|
|
|
|
row.setStack(amount) |
|
|
|
|
} |
|
|
|
|
@ -423,10 +430,7 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.currentAmount = null |
|
|
|
|
} |
|
|
|
|
} catch (e: NumberFormatException) { |
|
|
|
|
Timber.w("Parsing exception: ${e.message}") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
|