Adds hint to card layouts

hh
Laurent 6 years ago
parent cae36ce9f7
commit 85660bf7bd
  1. 8
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt
  2. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/HandHistoryViewModel.kt

@ -10,6 +10,8 @@ import android.widget.Button
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.view.isEmpty
import androidx.core.view.size
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.chip.Chip
@ -302,6 +304,12 @@ class HandHistoryAdapter(
layout.addView(cardView)
}
if (layout.isEmpty()) {
val hintView = TextView(itemView.context)
hintView.text = itemView.context.getString(R.string.hand)
layout.addView(hintView)
}
layout.setOnClickListener {
delegate?.onRowSelected(this.currentPosition, row, layout.tag as Int)
}

@ -205,7 +205,7 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra
} else {
readRowRepresentation()
}
this.selectionLiveData.value = null // remove any possibly outdated selection
}
private fun readRowRepresentation(): MutableList<RowRepresentable> {

Loading…
Cancel
Save