|
|
|
|
@ -201,12 +201,11 @@ class HandHistoryAdapter( |
|
|
|
|
fun editTextSelected(editText: EditText, selected: Boolean, tag: Int) { |
|
|
|
|
|
|
|
|
|
editText.setBackgroundColor(color(selected)) |
|
|
|
|
val row = dataSource.rowRepresentableForPosition(currentPosition) |
|
|
|
|
val row = dataSource.rowRepresentableForPosition(this.currentPosition) |
|
|
|
|
?: throw PAIllegalStateException("Row Representable not found at index: $currentPosition") |
|
|
|
|
val alreadySelected = dataSource.isSelected(currentPosition, row, tag) |
|
|
|
|
if (!alreadySelected && selected) { |
|
|
|
|
delegate?.onRowSelected(currentPosition, row, tag) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
delegate?.onRowSelected(currentPosition, row, tag) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
|
@ -266,13 +265,13 @@ class HandHistoryAdapter( |
|
|
|
|
editText.setText(string) |
|
|
|
|
|
|
|
|
|
// Focus |
|
|
|
|
val selected = adapter.dataSource.isSelected(position, row, tag) |
|
|
|
|
toggleFocus(editText, selected) |
|
|
|
|
val focused = adapter.dataSource.isSelected(position, row, tag) |
|
|
|
|
toggleFocus(editText, focused) |
|
|
|
|
editText.isFocusable = adapter.dataSource.isFocusable(position, row, tag) |
|
|
|
|
editText.isFocusableInTouchMode = adapter.dataSource.isFocusable(position, row, tag) |
|
|
|
|
|
|
|
|
|
// Background |
|
|
|
|
editText.setBackgroundColor(color(selected)) |
|
|
|
|
editText.setBackgroundColor(color(focused)) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -298,6 +297,11 @@ class HandHistoryAdapter( |
|
|
|
|
itemView.smallBlindEditText.tag = 0 |
|
|
|
|
itemView.bigBlindEditText.tag = 1 |
|
|
|
|
itemView.anteEditText.tag = 2 |
|
|
|
|
|
|
|
|
|
setClickListener(itemView.smallBlindEditText) |
|
|
|
|
setClickListener(itemView.bigBlindEditText) |
|
|
|
|
setClickListener(itemView.anteEditText) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// sb, bb, ante, bb ante |
|
|
|
|
|