|
|
|
@ -176,12 +176,12 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
this.model.isEdited = false |
|
|
|
this.model.isEdited = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun findNextActionToEdit(index: Int? = null) { |
|
|
|
private fun findNextActionToEdit(index: Int? = null, userInitiated: Boolean = false) { |
|
|
|
|
|
|
|
|
|
|
|
val startIndex = index ?: this.model.currentSelection.index |
|
|
|
val startIndex = index ?: this.model.currentSelection.index |
|
|
|
val minTag = if (index != null) null else this.model.currentSelection.tag |
|
|
|
val minTag = if (index != null) null else this.model.currentSelection.tag |
|
|
|
|
|
|
|
|
|
|
|
this.model.findSelectionForEdition(startIndex, minTag)?.let { selection -> |
|
|
|
this.model.findSelectionForEdition(startIndex, minTag, userInitiated)?.let { selection -> |
|
|
|
|
|
|
|
|
|
|
|
this.scrollToPosition(selection.index) |
|
|
|
this.scrollToPosition(selection.index) |
|
|
|
|
|
|
|
|
|
|
|
@ -265,7 +265,7 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
this.handHistoryAdapter.notifyItemChanged(index) |
|
|
|
this.handHistoryAdapter.notifyItemChanged(index) |
|
|
|
|
|
|
|
|
|
|
|
// Change the focus only for the row, don't look elsewhere |
|
|
|
// Change the focus only for the row, don't look elsewhere |
|
|
|
val anyEmpty = row.tagsForCompletion().any { row.isFieldEmpty(it, this.model.handHistory) } |
|
|
|
val anyEmpty = row.tagsForCompletion().any { row.isFieldNeedsInput(it, this.model.handHistory) } |
|
|
|
if (anyEmpty) { |
|
|
|
if (anyEmpty) { |
|
|
|
this.findNextActionToEdit(index) |
|
|
|
this.findNextActionToEdit(index) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -300,7 +300,7 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
this.model.amountValidated() |
|
|
|
this.model.amountValidated() |
|
|
|
} |
|
|
|
} |
|
|
|
// this.handHistoryAdapter.notifyDataSetChanged() |
|
|
|
// this.handHistoryAdapter.notifyDataSetChanged() |
|
|
|
this.findNextActionToEdit() |
|
|
|
this.findNextActionToEdit(userInitiated = true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun amountChanged(amount: String?) { |
|
|
|
override fun amountChanged(amount: String?) { |
|
|
|
@ -338,7 +338,7 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
|
|
|
|
|
|
|
|
override fun cardSelectionEnded() { |
|
|
|
override fun cardSelectionEnded() { |
|
|
|
this.model.cardSelectionEnded() |
|
|
|
this.model.cardSelectionEnded() |
|
|
|
this.findNextActionToEdit() |
|
|
|
this.findNextActionToEdit(userInitiated = true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun cardBackSpaceSelected() { |
|
|
|
override fun cardBackSpaceSelected() { |
|
|
|
|