|
|
|
@ -84,7 +84,7 @@ class HandHistoryAdapter( |
|
|
|
var currentPosition = 0 |
|
|
|
var currentPosition = 0 |
|
|
|
|
|
|
|
|
|
|
|
fun color(isFocused: Boolean) : Int { |
|
|
|
fun color(isFocused: Boolean) : Int { |
|
|
|
val color = if (isFocused) R.color.kaki else R.color.kaki_medium |
|
|
|
val color = if (isFocused) R.color.kaki_medium else R.color.kaki |
|
|
|
return itemView.context.getColor(color) |
|
|
|
return itemView.context.getColor(color) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -111,7 +111,11 @@ class HandHistoryAdapter( |
|
|
|
// Action |
|
|
|
// Action |
|
|
|
itemView.findViewById<Button>(R.id.actionButton)?.let { actionButton -> |
|
|
|
itemView.findViewById<Button>(R.id.actionButton)?.let { actionButton -> |
|
|
|
actionButton.setOnClickListener { |
|
|
|
actionButton.setOnClickListener { |
|
|
|
buttonClicked(actionButton, true, HHKeyboard.ACTION.ordinal) |
|
|
|
actionButton.backgroundTintList = ColorStateList.valueOf(color(true)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val row = dataSource.rowRepresentableForPosition(currentPosition) |
|
|
|
|
|
|
|
?: throw PAIllegalStateException("Row Representable not found at index: $currentPosition") |
|
|
|
|
|
|
|
delegate?.onRowSelected(currentPosition, row, HHKeyboard.ACTION.ordinal) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -138,18 +142,6 @@ class HandHistoryAdapter( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun buttonClicked(button: Button, selected: Boolean, tag: Int) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
button.backgroundTintList = ColorStateList.valueOf(color(selected)) |
|
|
|
|
|
|
|
// (itemView.context as Activity).hideKeyboard() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selected) { |
|
|
|
|
|
|
|
val row = dataSource.rowRepresentableForPosition(currentPosition) |
|
|
|
|
|
|
|
?: throw PAIllegalStateException("Row Representable not found at index: $currentPosition") |
|
|
|
|
|
|
|
delegate?.onRowSelected(currentPosition, row, tag) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
|
|
|
|
|
|
|
|
Timber.d("onbind @position = $position") |
|
|
|
Timber.d("onbind @position = $position") |
|
|
|
@ -299,9 +291,6 @@ class HandHistoryAdapter( |
|
|
|
inner class RowHandPlayerSummary(itemView: View) : RowHandHolder(itemView), |
|
|
|
inner class RowHandPlayerSummary(itemView: View) : RowHandHolder(itemView), |
|
|
|
BindableHolder { |
|
|
|
BindableHolder { |
|
|
|
|
|
|
|
|
|
|
|
// private var actionCanBeEdited = true |
|
|
|
|
|
|
|
// private var amountCanBeEdited = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
init { |
|
|
|
|
|
|
|
|
|
|
|
// Cards |
|
|
|
// Cards |
|
|
|
|