|
|
|
|
@ -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<Button>(R.id.positionButton)?.let { positionButton -> |
|
|
|
|
positionButton.text = playerCardView.position?.value ?: throw PAIllegalStateException("Should not happen") |
|
|
|
|
positionButton.text = playerCardView.position.value |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
configureCardsLayout(itemView.handLayout) |
|
|
|
|
|