|
|
|
|
@ -246,9 +246,11 @@ class HandHistoryAdapter( |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected fun setOnItemClickListener(button: Button) { |
|
|
|
|
protected fun setOnItemClickListener(button: Button, colorChange: Boolean = true) { |
|
|
|
|
button.setOnClickListener { |
|
|
|
|
button.backgroundTintList = ColorStateList.valueOf(color(true)) |
|
|
|
|
if (colorChange) { |
|
|
|
|
button.backgroundTintList = ColorStateList.valueOf(color(true)) |
|
|
|
|
} |
|
|
|
|
val row = dataSource.rowRepresentableForPosition(currentPosition) |
|
|
|
|
?: throw PAIllegalStateException("Row Representable not found at index: $currentPosition") |
|
|
|
|
delegate?.onItemClick(currentPosition, row, button.tag as Int) |
|
|
|
|
@ -536,7 +538,7 @@ class HandHistoryAdapter( |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
abstract inner class AbstractRowHandPlayerSetup(itemView: View) : RowHandHolder(itemView) { |
|
|
|
|
abstract inner class AbstractRowPlayerSetup(itemView: View) : RowHandHolder(itemView) { |
|
|
|
|
|
|
|
|
|
protected var delegate: RowRepresentableDelegate? = null |
|
|
|
|
|
|
|
|
|
@ -552,6 +554,7 @@ class HandHistoryAdapter( |
|
|
|
|
|
|
|
|
|
// Position Button |
|
|
|
|
itemView.position_button.text = adapter.dataSource.charSequenceForRow(row, itemView.context, PlayerSetupRow.Tag.POSITION.ordinal) |
|
|
|
|
|
|
|
|
|
// val positionSelected = adapter.dataSource.isSelected(position, row, PlayerSetupRow.Tag.POSITION.ordinal) |
|
|
|
|
// itemView.position_button.backgroundTintList = ColorStateList.valueOf(color(positionSelected)) |
|
|
|
|
|
|
|
|
|
@ -564,7 +567,7 @@ class HandHistoryAdapter( |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inner class RowReadOnlyPlayerSetupHolder(itemView: View) : AbstractRowHandPlayerSetup(itemView) { |
|
|
|
|
inner class RowReadOnlyPlayerSetupHolder(itemView: View) : AbstractRowPlayerSetup(itemView) { |
|
|
|
|
|
|
|
|
|
init { |
|
|
|
|
itemView.ps_player_image.tag = PlayerSetupRow.Tag.PLAYER.ordinal |
|
|
|
|
@ -582,16 +585,18 @@ class HandHistoryAdapter( |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inner class RowPlayerSetupHolder(itemView: View) : AbstractRowHandPlayerSetup(itemView) { |
|
|
|
|
inner class RowPlayerSetupHolder(itemView: View) : AbstractRowPlayerSetup(itemView) { |
|
|
|
|
|
|
|
|
|
init { |
|
|
|
|
|
|
|
|
|
itemView.player_image.tag = PlayerSetupRow.Tag.PLAYER.ordinal |
|
|
|
|
itemView.position_button.tag = PlayerSetupRow.Tag.POSITION.ordinal |
|
|
|
|
itemView.ps_hand_layout.tag = PlayerSetupRow.Tag.HAND.ordinal |
|
|
|
|
itemView.stack_edit_text.tag = PlayerSetupRow.Tag.STACK.ordinal |
|
|
|
|
|
|
|
|
|
itemView.stack_edit_text.inputType = InputType.TYPE_NUMBER_FLAG_DECIMAL |
|
|
|
|
setClickListener(itemView.stack_edit_text) |
|
|
|
|
setOnItemClickListener(itemView.position_button) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|