diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt index c5cb7929..83bf9459 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt @@ -281,6 +281,9 @@ class HandHistoryAdapter( dataSource.rowRepresentableForPosition(this.currentPosition)?.let { row -> + val focused = dataSource.isSelected(this.currentPosition, row, layout.tag as Int) + layout.setBackgroundColor(color(focused)) + dataSource.contentForRow(row, itemView.context, Card::class).forEach { card -> val cardView = card.view(itemView.context, inflater, layout) layout.addView(cardView) @@ -434,9 +437,16 @@ class HandHistoryAdapter( */ inner class RowHandStreet(itemView: View) : RowHandHolder(itemView) { + init { +// itemView.cardsLayout.tag = 0 + } + override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { super.onBind(position, row, adapter) + val streetCardsRow = row as StreetCardsRow + itemView.cardsLayout.tag = streetCardsRow.street.ordinal + configureCardsLayout(itemView.cardsLayout) // itemView.cardsLayout.removeAllViews() @@ -461,6 +471,9 @@ class HandHistoryAdapter( inner class RowHandPlayerSummary(itemView: View) : RowHandHolder(itemView) { init { + + itemView.handLayout.tag = PlayerCardsRow.Tag.CARDS.ordinal + // itemView.cardsEditText.tag = PlayerCardsRow.Tag.CARDS.ordinal // Cards @@ -509,6 +522,7 @@ class HandHistoryAdapter( init { + itemView.psHandLayout.tag = PlayerSetupRow.Tag.HAND.ordinal itemView.stackEditText.tag = PlayerSetupRow.Tag.STACK.ordinal setClickListener(itemView.stackEditText) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/StreetCardsRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/StreetCardsRow.kt index cd5fa139..15139ab8 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/StreetCardsRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/StreetCardsRow.kt @@ -20,12 +20,13 @@ class StreetCardsRow(var street: Street, var handHistory: HandHistory) : CardsRo } override fun tagsForCompletion(): List { - return when (this.street) { - Street.PREFLOP -> listOf() - Street.FLOP -> listOf(Street.FLOP.ordinal) - Street.TURN -> listOf(Street.FLOP.ordinal, Street.TURN.ordinal) - Street.RIVER, Street.SUMMARY -> listOf(Street.FLOP.ordinal, Street.TURN.ordinal, Street.RIVER.ordinal) - } + return listOf(this.street.ordinal) +// return when (this.street) { +// Street.PREFLOP -> listOf() +// Street.FLOP -> listOf(Street.FLOP.ordinal) +// Street.TURN -> listOf(Street.FLOP.ordinal, Street.TURN.ordinal) +// Street.RIVER, Street.SUMMARY -> listOf(Street.FLOP.ordinal, Street.TURN.ordinal, Street.RIVER.ordinal) +// } } override fun cardLimit() : Int {