Clears selection when removing players

hh
Laurent 6 years ago
parent 29aaf89e99
commit 34b622d689
  1. 5
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryFragment.kt
  2. 4
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/HandHistoryViewModel.kt

@ -270,9 +270,6 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL
this.save() this.save()
} }
// if (this.model.isEdited && this.model.isNew) {
// this.findNextActionToEdit(0)
// }
this.handHistoryAdapter.notifyDataSetChanged() this.handHistoryAdapter.notifyDataSetChanged()
} }
@ -377,7 +374,6 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL
HandRowType.HERO_POSITION -> { HandRowType.HERO_POSITION -> {
this.model.setHeroPosition(value as Position) this.model.setHeroPosition(value as Position)
this.handHistoryAdapter.notifyDataSetChanged() this.handHistoryAdapter.notifyDataSetChanged()
// this.handHistoryAdapter.notifyItemChanged(this.indexOfRowRepresentable(row))
} }
HandRowType.PLAYER_POSITION -> { HandRowType.PLAYER_POSITION -> {
this.model.createPlayerSetupForPosition(value as Position) this.model.createPlayerSetupForPosition(value as Position)
@ -633,6 +629,7 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL
private fun removePlayer(positionIndex: Int) { private fun removePlayer(positionIndex: Int) {
this.model.removePlayerSetup(positionIndex) this.model.removePlayerSetup(positionIndex)
this.model.clearSelection()
} }
/*** /***

@ -1008,4 +1008,8 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra
this.createRowRepresentation() this.createRowRepresentation()
} }
fun clearSelection() {
this.selectionLiveData.value = null
}
} }
Loading…
Cancel
Save