|
|
|
@ -484,18 +484,38 @@ class HandHistoryAdapter( |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected fun configurePlayerImage(playerImageView: PlayerImageView, position: Int, row: PlayerSetupRow) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Player |
|
|
|
|
|
|
|
val listener = View.OnClickListener { |
|
|
|
|
|
|
|
delegate?.onItemClick(position, row, playerImageView.tag as Int) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
playerImageView.setOnImageClickListener(listener) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val size = PlayerImageView.Size.SMALL |
|
|
|
|
|
|
|
row.playerSetup?.player?.let { player -> |
|
|
|
|
|
|
|
playerImageView.setPlayer(player, size) |
|
|
|
|
|
|
|
} ?: run { |
|
|
|
|
|
|
|
playerImageView.clear(size) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inner class RowHandReadOnlyPlayerSetup(itemView: View) : AbstractRowHandPlayerSetup(itemView) { |
|
|
|
inner class RowHandReadOnlyPlayerSetup(itemView: View) : AbstractRowHandPlayerSetup(itemView) { |
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
init { |
|
|
|
itemView.stackTextView.tag = PlayerSetupRow.Tag.STACK.ordinal |
|
|
|
itemView.ps_player_image.tag = PlayerSetupRow.Tag.PLAYER.ordinal |
|
|
|
|
|
|
|
itemView.stack_text_view.tag = PlayerSetupRow.Tag.STACK.ordinal |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
super.onBind(position, row, adapter) |
|
|
|
super.onBind(position, row, adapter) |
|
|
|
|
|
|
|
|
|
|
|
configureTextView(PlayerSetupRow.Tag.STACK.ordinal, row, adapter) |
|
|
|
configureTextView(PlayerSetupRow.Tag.STACK.ordinal, row, adapter) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Player |
|
|
|
|
|
|
|
configurePlayerImage(itemView.ps_player_image, position, row as PlayerSetupRow) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -507,14 +527,10 @@ class HandHistoryAdapter( |
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
init { |
|
|
|
|
|
|
|
|
|
|
|
itemView.playerImage.tag = PlayerSetupRow.Tag.PLAYER.ordinal |
|
|
|
itemView.player_image.tag = PlayerSetupRow.Tag.PLAYER.ordinal |
|
|
|
itemView.ps_hand_layout.tag = PlayerSetupRow.Tag.HAND.ordinal |
|
|
|
itemView.ps_hand_layout.tag = PlayerSetupRow.Tag.HAND.ordinal |
|
|
|
|
|
|
|
|
|
|
|
// itemView.ps_player_button.pointerIcon = |
|
|
|
|
|
|
|
// itemView.ps_player_button.ti = itemView.resources.getDrawable(R.drawable.circle, null) |
|
|
|
|
|
|
|
// setOnItemClickListener(itemView.playerImage) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
itemView.stack_edit_text.tag = PlayerSetupRow.Tag.STACK.ordinal |
|
|
|
itemView.stack_edit_text.tag = PlayerSetupRow.Tag.STACK.ordinal |
|
|
|
|
|
|
|
|
|
|
|
itemView.stack_edit_text.inputType = InputType.TYPE_NUMBER_FLAG_DECIMAL |
|
|
|
itemView.stack_edit_text.inputType = InputType.TYPE_NUMBER_FLAG_DECIMAL |
|
|
|
setClickListener(itemView.stack_edit_text) |
|
|
|
setClickListener(itemView.stack_edit_text) |
|
|
|
|
|
|
|
|
|
|
|
@ -534,17 +550,7 @@ class HandHistoryAdapter( |
|
|
|
val state = setupRow.state |
|
|
|
val state = setupRow.state |
|
|
|
|
|
|
|
|
|
|
|
// Player |
|
|
|
// Player |
|
|
|
val listener = View.OnClickListener { |
|
|
|
configurePlayerImage(itemView.player_image, position, setupRow) |
|
|
|
delegate?.onItemClick(position, row, itemView.playerImage.tag as Int) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
itemView.playerImage.setOnImageClickListener(listener) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val size = PlayerImageView.Size.SMALL |
|
|
|
|
|
|
|
row.playerSetup?.player?.let { player -> |
|
|
|
|
|
|
|
itemView.playerImage.setPlayer(player, size) |
|
|
|
|
|
|
|
} ?: run { |
|
|
|
|
|
|
|
itemView.playerImage.clear(size) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Title |
|
|
|
// Title |
|
|
|
itemView.title.text = setupRow.title(itemView.context) |
|
|
|
itemView.title.text = setupRow.title(itemView.context) |
|
|
|
|