|
|
|
@ -39,6 +39,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
import net.pokeranalytics.android.ui.view.holder.RowViewHolder |
|
|
|
import net.pokeranalytics.android.ui.view.holder.RowViewHolder |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.ViewIdentifier |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.ViewIdentifier |
|
|
|
import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
|
|
|
|
import timber.log.Timber |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable { |
|
|
|
enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable { |
|
|
|
@ -166,13 +167,18 @@ class HandHistoryAdapter( |
|
|
|
|
|
|
|
|
|
|
|
fun editTextSelected(editText: EditText) { |
|
|
|
fun editTextSelected(editText: EditText) { |
|
|
|
|
|
|
|
|
|
|
|
// editText.setBackgroundColor(color(selected)) |
|
|
|
|
|
|
|
val row = dataSource.rowRepresentableForPosition(this.currentPosition) |
|
|
|
val row = dataSource.rowRepresentableForPosition(this.currentPosition) |
|
|
|
?: throw PAIllegalStateException("Row Representable not found at index: $currentPosition") |
|
|
|
?: throw PAIllegalStateException("Row Representable not found at index: $currentPosition") |
|
|
|
|
|
|
|
|
|
|
|
delegate?.onRowSelected(this.currentPosition, row, editText.tag as Int) |
|
|
|
val tag = editText.tag as Int |
|
|
|
|
|
|
|
|
|
|
|
setEditTextBackground(editText, true, true) |
|
|
|
delegate?.onRowSelected(this.currentPosition, row, tag) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// val text = dataSource.charSequenceForRow(row, itemView.context, tag) |
|
|
|
|
|
|
|
// editText.hint = text |
|
|
|
|
|
|
|
// editText.text = null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setEditTextBackground(editText = editText, isEnabled = true, isFocused = true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
@ -435,10 +441,6 @@ class HandHistoryAdapter( |
|
|
|
itemView.action_container.background = background |
|
|
|
itemView.action_container.background = background |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// actionReadRow.action?.let { type -> |
|
|
|
|
|
|
|
// itemView.actionText.setTextColor(itemView.context.getColor(type.color)) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
itemView.amountText.text = actionReadRow.amount?.formatted |
|
|
|
itemView.amountText.text = actionReadRow.amount?.formatted |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -466,6 +468,7 @@ class HandHistoryAdapter( |
|
|
|
|
|
|
|
|
|
|
|
amountEditText.setOnTouchListener { _, event -> |
|
|
|
amountEditText.setOnTouchListener { _, event -> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Timber.d("=== event.action = ${event.action}") |
|
|
|
if (event.action == MotionEvent.ACTION_UP) { |
|
|
|
if (event.action == MotionEvent.ACTION_UP) { |
|
|
|
// Both are required, otherwise requestFocus() fails |
|
|
|
// Both are required, otherwise requestFocus() fails |
|
|
|
amountEditText.isFocusable = true |
|
|
|
amountEditText.isFocusable = true |
|
|
|
|