|
|
|
@ -14,7 +14,6 @@ import kotlinx.android.synthetic.main.fragment_settings.recyclerView |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
import net.pokeranalytics.android.model.LiveData |
|
|
|
import net.pokeranalytics.android.model.LiveData |
|
|
|
import net.pokeranalytics.android.model.handhistory.HandSetup |
|
|
|
|
|
|
|
import net.pokeranalytics.android.model.handhistory.Position |
|
|
|
import net.pokeranalytics.android.model.handhistory.Position |
|
|
|
import net.pokeranalytics.android.model.realm.Player |
|
|
|
import net.pokeranalytics.android.model.realm.Player |
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Action |
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Action |
|
|
|
@ -54,11 +53,11 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
companion object { |
|
|
|
|
|
|
|
|
|
|
|
fun newInstance(id: String? = null): HandHistoryFragment { |
|
|
|
fun newInstance(id: String? = null, configurationId: String? = null): HandHistoryFragment { |
|
|
|
val fragment = |
|
|
|
val fragment = HandHistoryFragment() |
|
|
|
HandHistoryFragment() |
|
|
|
|
|
|
|
val bundle = Bundle() |
|
|
|
val bundle = Bundle() |
|
|
|
bundle.putSerializable(BundleKey.PRIMARY_KEY.value, id) |
|
|
|
bundle.putSerializable(BundleKey.PRIMARY_KEY.value, id) |
|
|
|
|
|
|
|
bundle.putSerializable(BundleKey.SECONDARY_KEY.value, configurationId) |
|
|
|
fragment.arguments = bundle |
|
|
|
fragment.arguments = bundle |
|
|
|
return fragment |
|
|
|
return fragment |
|
|
|
} |
|
|
|
} |
|
|
|
@ -100,8 +99,10 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
this.model.setHandHistory(handHistory) |
|
|
|
this.model.setHandHistory(handHistory) |
|
|
|
this.setEditing(false) |
|
|
|
this.setEditing(false) |
|
|
|
} ?: run { |
|
|
|
} ?: run { |
|
|
|
|
|
|
|
val configurationId= this.arguments?.getString(BundleKey.SECONDARY_KEY.value) |
|
|
|
|
|
|
|
|
|
|
|
getRealm().executeTransaction { |
|
|
|
getRealm().executeTransaction { |
|
|
|
this.model.createNewHandHistory(it, HandSetup()) |
|
|
|
this.model.createNewHandHistory(it, configurationId) |
|
|
|
} |
|
|
|
} |
|
|
|
this.setEditing(true) |
|
|
|
this.setEditing(true) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -128,8 +129,6 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL |
|
|
|
|
|
|
|
|
|
|
|
val row = this.model.rowRepresentableForPosition(it.index) as HandHistoryRow |
|
|
|
val row = this.model.rowRepresentableForPosition(it.index) as HandHistoryRow |
|
|
|
|
|
|
|
|
|
|
|
// row.performActionForTag(it.tag) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
row.keyboardForTag(it.tag)?.let { keyboard -> |
|
|
|
row.keyboardForTag(it.tag)?.let { keyboard -> |
|
|
|
|
|
|
|
|
|
|
|
when (keyboard) { |
|
|
|
when (keyboard) { |
|
|
|
|