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 88d5a680..b5808e3e 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 @@ -288,11 +288,18 @@ class HandHistoryAdapter( val inflater = LayoutInflater.from(itemView.context) + val isEdited = (dataSource as HandHistoryViewModel).isEdited + dataSource.rowRepresentableForPosition(this.currentPosition)?.let { row -> val focused = dataSource.isSelected(this.currentPosition, row, layout.tag as Int) - val drawableId = if (focused) R.drawable.rounded_highlighted_board_background else R.drawable.rounded_board_background + val drawableId = when { + focused -> R.drawable.rounded_highlighted_board_background + isBoard || isEdited -> R.drawable.rounded_board_background + else -> R.drawable.transparent + } + layout.background = itemView.resources.getDrawable(drawableId, null) dataSource.contentForRow(row, itemView.context, Card::class).forEach { card -> @@ -489,6 +496,7 @@ class HandHistoryAdapter( itemView.cardsLayout.tag = streetCardsRow.street.ordinal configureCardsLayout(itemView.cardsLayout, true) + } } @@ -536,7 +544,7 @@ class HandHistoryAdapter( // Position Button itemView.position_button.text = adapter.dataSource.charSequenceForRow(row, itemView.context, PlayerSetupRow.Tag.POSITION.ordinal) - val positionSelected = adapter.dataSource.isSelected(position, row, PlayerSetupRow.Tag.POSITION.ordinal) +// val positionSelected = adapter.dataSource.isSelected(position, row, PlayerSetupRow.Tag.POSITION.ordinal) // itemView.position_button.backgroundTintList = ColorStateList.valueOf(color(positionSelected)) val positionalRow = row as PositionalRow diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt index 95f8c01a..688856f0 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt @@ -232,8 +232,7 @@ class ComputedAction(var manager: ActionManager, val significantAction = getStreetLastSignificantAction() ?: throw PAIllegalStateException("There must be a previously set significant action for a call to be set") - val significantAmount = significantAction.action.amount - ?: throw PAIllegalStateException("There must be a set amount on the action for the call to be set") + val significantAmount = significantAction.action.amount ?: 0.0 val committedAmount = getPreviouslyCommittedAmount() this.setEffectiveAmount(significantAmount - committedAmount) 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 15139ab8..6332c9fa 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 @@ -43,13 +43,6 @@ class StreetCardsRow(var street: Street, var handHistory: HandHistory) : CardsRo } } - override fun clear() { - when (this.street) { - Street.SUMMARY -> this.cardHolder?.cards?.clear() - else -> this.handHistory.cards.removeAll { it.street == this.street } - } - } - override fun isFieldNeedsInput(tag: Int, handHistory: HandHistory): Boolean { val street = Street.values()[tag] return this.cardCount < street.totalBoardCards || this.handHistory.cards.elementAtOrNull(street.totalBoardCards - 1)?.suit == null diff --git a/app/src/main/res/drawable/transparent.xml b/app/src/main/res/drawable/transparent.xml new file mode 100644 index 00000000..e68e03fb --- /dev/null +++ b/app/src/main/res/drawable/transparent.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/row_hand_player_summary.xml b/app/src/main/res/layout/row_hand_player_summary.xml index 32080da4..c2dc6a1b 100644 --- a/app/src/main/res/layout/row_hand_player_summary.xml +++ b/app/src/main/res/layout/row_hand_player_summary.xml @@ -20,17 +20,23 @@ android:layout_height="44dp" android:layout_marginStart="8dp"/> - + android:layout_height="50dp" + android:layout_width="0dp" /> + + + + + + + + + + + + diff --git a/app/src/main/res/layout/row_hhsettings_player_setup.xml b/app/src/main/res/layout/row_hhsettings_player_setup.xml index 8948b8c1..970cf775 100644 --- a/app/src/main/res/layout/row_hhsettings_player_setup.xml +++ b/app/src/main/res/layout/row_hhsettings_player_setup.xml @@ -20,16 +20,21 @@ android:layout_height="44dp" android:layout_marginStart="8dp" /> - + android:layout_width="144dp" /> + + + + + + + + + + + - + android:layout_width="144dp" /> + + + + + + + + + + + + + + + + + + \ No newline at end of file