Laurent 6 years ago
parent 8d2a6a4033
commit edc9b5d6b4
  1. 23
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt
  2. 6
      app/src/main/res/layout/row_edit_text.xml

@ -84,7 +84,7 @@ class HandHistoryAdapter(
var currentPosition = 0
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)
}
@ -111,7 +111,11 @@ class HandHistoryAdapter(
// Action
itemView.findViewById<Button>(R.id.actionButton)?.let { actionButton ->
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) {
Timber.d("onbind @position = $position")
@ -299,9 +291,6 @@ class HandHistoryAdapter(
inner class RowHandPlayerSummary(itemView: View) : RowHandHolder(itemView),
BindableHolder {
// private var actionCanBeEdited = true
// private var amountCanBeEdited = true
init {
// Cards

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
Loading…
Cancel
Save