diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt index 7969fdaf..218e447e 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt @@ -29,7 +29,7 @@ fun List.compact(positions: LinkedHashSet): List): ActionReadRow { val pos = positions.elementAt(this.position) - return ActionReadRow(mutableListOf(pos), this.type, this.amount) + return ActionReadRow(mutableListOf(pos), this.position, this.type, this.amount) } open class Action : RealmObject() { diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt index 18f4279c..55daa8cc 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt @@ -161,13 +161,13 @@ class HandHistoryAdapter( return itemView.context.getColor(color) } - fun editTextSelected(editText: EditText, selected: Boolean, tag: Int) { + fun editTextSelected(editText: EditText, selected: Boolean) { editText.setBackgroundColor(color(selected)) val row = dataSource.rowRepresentableForPosition(this.currentPosition) ?: throw PAIllegalStateException("Row Representable not found at index: $currentPosition") - delegate?.onRowSelected(this.currentPosition, row, tag) + delegate?.onRowSelected(this.currentPosition, row, editText.tag as Int) } @@ -231,7 +231,7 @@ class HandHistoryAdapter( editText.requestFocus() - editTextSelected(editText, true, editText.tag as Int) + editTextSelected(editText, true) } return@setOnTouchListener true } @@ -295,7 +295,6 @@ class HandHistoryAdapter( dataSource.rowRepresentableForPosition(this.currentPosition)?.let { row -> val focused = dataSource.isSelected(this.currentPosition, row, layout.tag as Int) -// layout.setBackgroundColor(color(focused)) val drawableId = if (focused) R.drawable.rounded_highlighted_board_background else R.drawable.rounded_board_background layout.background = itemView.resources.getDrawable(drawableId, null) @@ -394,7 +393,7 @@ class HandHistoryAdapter( amountEditText.requestFocus() - editTextSelected(amountEditText, true, HHKeyboard.AMOUNT.ordinal) + editTextSelected(amountEditText, true) } return@setOnTouchListener true } @@ -472,7 +471,7 @@ class HandHistoryAdapter( // Position itemView.findViewById