|
|
|
|
@ -10,7 +10,9 @@ import kotlinx.android.synthetic.main.fragment_hand_history.* |
|
|
|
|
import kotlinx.android.synthetic.main.fragment_settings.recyclerView |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.model.handhistory.* |
|
|
|
|
import net.pokeranalytics.android.model.handhistory.ComputedAction |
|
|
|
|
import net.pokeranalytics.android.model.handhistory.HandSetup |
|
|
|
|
import net.pokeranalytics.android.model.handhistory.Position |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Action |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Card |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
|
@ -94,8 +96,6 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
|
|
|
|
|
|
setDisplayHomeAsUpEnabled(true) |
|
|
|
|
|
|
|
|
|
// SmoothScrollLinearLayoutManager(requireContext()) |
|
|
|
|
// val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
|
this.handHistoryAdapter = HandHistoryAdapter(this.model,this) |
|
|
|
|
|
|
|
|
|
recyclerView.apply { |
|
|
|
|
@ -150,20 +150,13 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
|
|
|
|
|
|
private fun edit() { |
|
|
|
|
this.model.isEdited = true |
|
|
|
|
findNextActionToEdit(0) |
|
|
|
|
// this.handHistoryAdapter.notifyDataSetChanged() |
|
|
|
|
this.findNextActionToEdit(0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun closeEdition() { |
|
|
|
|
this.model.isEdited = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// private fun findNextActionToEdit() { |
|
|
|
|
// val selection = this.model.selectionLiveData.value |
|
|
|
|
// val index = selection?.index ?: throw PAIllegalStateException("Request next with no selection") |
|
|
|
|
// this.findNextActionToEdit(index, selection.keyboard) |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
private fun findNextActionToEdit(index: Int? = null) { |
|
|
|
|
val startIndex = index ?: this.model.currentSelection.index |
|
|
|
|
this.model.findIndexForEdition(startIndex)?.let { selection -> |
|
|
|
|
|