Fixes hand created multiple times when going back and forth between editor and replayer

bs
Laurent 5 years ago
parent 115e375434
commit 5891de3677
  1. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/editor/EditorAdapter.kt
  2. 4
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/editor/EditorFragment.kt

@ -346,9 +346,11 @@ class EditorAdapter(
// Listener
layout.setOnClickListener {
if ((dataSource as EditorViewModel).isEdited) {
delegate?.onRowSelected(this.currentPosition, row, layout.tag as Int)
setViewBackground(layout, true, true)
}
}
}

@ -72,8 +72,7 @@ class EditorFragment : RealmFragment(), RowRepresentableDelegate, KeyboardListen
companion object {
fun newInstance(id: String? = null, configurationId: String? = null, attached: Boolean = false): EditorFragment {
val fragment =
EditorFragment()
val fragment = EditorFragment()
val bundle = Bundle()
bundle.putSerializable(BundleKey.HAND_HISTORY_ID.value, id)
bundle.putSerializable(BundleKey.CONFIGURATION_ID.value, configurationId)
@ -329,6 +328,7 @@ class EditorFragment : RealmFragment(), RowRepresentableDelegate, KeyboardListen
*/
private fun save() {
this.model.save(getRealm())
this.arguments?.putSerializable(BundleKey.HAND_HISTORY_ID.value, this.model.handHistory.id)
}
/***

Loading…
Cancel
Save