Fixes BB ante in read mode

hh
Laurent 6 years ago
parent f32488bb64
commit be9bcc8ceb
  1. 7
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt
  2. 3
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/HandHistoryViewModel.kt

@ -54,6 +54,7 @@ enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable {
PLAYER_SETUP_READ(R.layout.row_hhsettings_player_setup_read), PLAYER_SETUP_READ(R.layout.row_hhsettings_player_setup_read),
ANTE(R.layout.row_title_value), ANTE(R.layout.row_title_value),
BIG_BLIND_ANTE(R.layout.row_title_switch), BIG_BLIND_ANTE(R.layout.row_title_switch),
BIG_BLIND_ANTE_READ(R.layout.row_title_value),
ACTION_READ(R.layout.row_hand_action_read), ACTION_READ(R.layout.row_hand_action_read),
HERO_POSITION(R.layout.row_recycler), HERO_POSITION(R.layout.row_recycler),
PLAYER_POSITION(R.layout.row_recycler) PLAYER_POSITION(R.layout.row_recycler)
@ -80,7 +81,7 @@ enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable {
PLAYER_NUMBER -> R.string.number_of_players PLAYER_NUMBER -> R.string.number_of_players
COMMENT -> R.string.comment COMMENT -> R.string.comment
ANTE -> R.string.ante ANTE -> R.string.ante
BIG_BLIND_ANTE -> R.string.bb_ante_option BIG_BLIND_ANTE, BIG_BLIND_ANTE_READ -> R.string.bb_ante_option
else -> null else -> null
} }
} }
@ -123,7 +124,9 @@ class HandHistoryAdapter(
HandRowType.COMMENT -> RowViewHolder(layout) HandRowType.COMMENT -> RowViewHolder(layout)
HandRowType.ACTION_READ -> RowActionReadHolder(layout) HandRowType.ACTION_READ -> RowActionReadHolder(layout)
HandRowType.HERO_POSITION, HandRowType.PLAYER_POSITION -> RowPositionHolder(layout) HandRowType.HERO_POSITION, HandRowType.PLAYER_POSITION -> RowPositionHolder(layout)
HandRowType.PLAYER_NUMBER, HandRowType.ANTE, HandRowType.BIG_BLIND_ANTE -> RowViewHolder(layout) HandRowType.PLAYER_NUMBER,
HandRowType.ANTE,
HandRowType.BIG_BLIND_ANTE, HandRowType.BIG_BLIND_ANTE_READ -> RowViewHolder(layout)
} }
} }

@ -223,7 +223,7 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra
} }
if (this.handHistory.bigBlindAnte) { if (this.handHistory.bigBlindAnte) {
rows.add(HandRowType.BIG_BLIND_ANTE) rows.add(HandRowType.BIG_BLIND_ANTE_READ)
} }
rows.add(CustomizableRowRepresentable(customViewType = HandRowType.HEADER, resId = R.string.players, value = "")) rows.add(CustomizableRowRepresentable(customViewType = HandRowType.HEADER, resId = R.string.players, value = ""))
@ -719,6 +719,7 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra
HandRowType.PLAYER_NUMBER -> this.handHistory.numberOfPlayers.toString() HandRowType.PLAYER_NUMBER -> this.handHistory.numberOfPlayers.toString()
HandRowType.COMMENT -> this.handHistory.comment ?: context.getString(R.string.comment) HandRowType.COMMENT -> this.handHistory.comment ?: context.getString(R.string.comment)
HandRowType.ANTE -> this.handHistory.ante.formatted() HandRowType.ANTE -> this.handHistory.ante.formatted()
HandRowType.BIG_BLIND_ANTE_READ -> context.getString(R.string.yes)
// HandRowType.HERO_POSITION -> context.getString(R.string.set_hero_position) // HandRowType.HERO_POSITION -> context.getString(R.string.set_hero_position)
// HandRowType.PLAYER_POSITION -> context.getString(R.string.set_position_details) // HandRowType.PLAYER_POSITION -> context.getString(R.string.set_position_details)
is ComputedAction -> row.action.formattedAmount is ComputedAction -> row.action.formattedAmount

Loading…
Cancel
Save