diff --git a/myExpenses/src/main/java/org/totschnig/myexpenses/fragment/PlannerFragment.kt b/myExpenses/src/main/java/org/totschnig/myexpenses/fragment/PlannerFragment.kt index bbc2b5f253..750844de55 100644 --- a/myExpenses/src/main/java/org/totschnig/myexpenses/fragment/PlannerFragment.kt +++ b/myExpenses/src/main/java/org/totschnig/myexpenses/fragment/PlannerFragment.kt @@ -259,7 +259,7 @@ class PlannerFragment : DialogViewBinding() { if (planInstance.sealed) { warnSealed(templatesList) true - } else onSelection(planInstance, position) + } else onSelection(planInstance, bindingAdapterPosition) } templatesList.configureOnClickPopup(root, planInstance.let { @@ -276,7 +276,7 @@ class PlannerFragment : DialogViewBinding() { warnSealed(templatesList) return@configureOnClickPopup true } else if (selectedInstances.size > 0) { - if (onSelection(planInstance, position)) + if (onSelection(planInstance, bindingAdapterPosition)) return@configureOnClickPopup true } false diff --git a/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/data/PlanInstance.kt b/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/data/PlanInstance.kt index 2de2b116d5..b4d662d1bb 100644 --- a/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/data/PlanInstance.kt +++ b/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/data/PlanInstance.kt @@ -19,7 +19,16 @@ enum class PlanInstanceState { } @Parcelize -data class PlanInstance(val templateId: Long, val transactionId: Long?, val title: String, val date: Long, val color: Int, val amount: Money, val state: PlanInstanceState, val sealed: Boolean) : Parcelable { +data class PlanInstance( + val templateId: Long, + val transactionId: Long?, + val title: String, + val date: Long, + val color: Int, + val amount: Money, + val state: PlanInstanceState, + val sealed: Boolean, +) : Parcelable { constructor(templateId: Long, instanceId: Long?, transactionId: Long?, title: String, date: Long, color: Int, amount: Money, sealed: Boolean) : this(templateId, transactionId, title, date, color, amount, when {