|
|
|
@ -38,6 +38,7 @@ import timber.log.Timber |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable, HandHistoryRow { |
|
|
|
enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable, HandHistoryRow { |
|
|
|
|
|
|
|
DEFAULT(R.layout.row_title_value), |
|
|
|
HEADER(R.layout.row_header_value), |
|
|
|
HEADER(R.layout.row_header_value), |
|
|
|
ACTION(R.layout.row_hand_action), |
|
|
|
ACTION(R.layout.row_hand_action), |
|
|
|
PLAYER_SUMMARY(R.layout.row_hand_player_summary), |
|
|
|
PLAYER_SUMMARY(R.layout.row_hand_player_summary), |
|
|
|
@ -45,6 +46,7 @@ enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable, H |
|
|
|
BLINDS(R.layout.row_hhsettings_blinds), |
|
|
|
BLINDS(R.layout.row_hhsettings_blinds), |
|
|
|
STRADDLE(R.layout.row_hhsettings_straddle), |
|
|
|
STRADDLE(R.layout.row_hhsettings_straddle), |
|
|
|
COMMENT(R.layout.row_hhsettings_comments), |
|
|
|
COMMENT(R.layout.row_hhsettings_comments), |
|
|
|
|
|
|
|
PLAYER_NUMBER(R.layout.row_title_value), |
|
|
|
PLAYER_SETUP(R.layout.row_hhsettings_player_setup) |
|
|
|
PLAYER_SETUP(R.layout.row_hhsettings_player_setup) |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
@ -89,6 +91,7 @@ enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable, H |
|
|
|
override val bottomSheetType: BottomSheetType |
|
|
|
override val bottomSheetType: BottomSheetType |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
return when(this) { |
|
|
|
return when(this) { |
|
|
|
|
|
|
|
PLAYER_NUMBER -> BottomSheetType.GRID |
|
|
|
COMMENT -> BottomSheetType.EDIT_TEXT_MULTI_LINES |
|
|
|
COMMENT -> BottomSheetType.EDIT_TEXT_MULTI_LINES |
|
|
|
else -> BottomSheetType.NONE |
|
|
|
else -> BottomSheetType.NONE |
|
|
|
} |
|
|
|
} |
|
|
|
@ -97,6 +100,7 @@ enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable, H |
|
|
|
override val resId: Int? |
|
|
|
override val resId: Int? |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
return when(this) { |
|
|
|
return when(this) { |
|
|
|
|
|
|
|
PLAYER_NUMBER -> R.string.number_of_players |
|
|
|
COMMENT -> R.string.comment |
|
|
|
COMMENT -> R.string.comment |
|
|
|
else -> null |
|
|
|
else -> null |
|
|
|
} |
|
|
|
} |
|
|
|
@ -129,6 +133,7 @@ class HandHistoryAdapter( |
|
|
|
val rowType: HandRowType = HandRowType.values()[viewType] |
|
|
|
val rowType: HandRowType = HandRowType.values()[viewType] |
|
|
|
val layout = LayoutInflater.from(parent.context).inflate(rowType.layoutRes, parent, false) |
|
|
|
val layout = LayoutInflater.from(parent.context).inflate(rowType.layoutRes, parent, false) |
|
|
|
return when (rowType) { |
|
|
|
return when (rowType) { |
|
|
|
|
|
|
|
HandRowType.DEFAULT -> RowViewHolder(layout) |
|
|
|
HandRowType.HEADER -> RowViewHolder(layout) |
|
|
|
HandRowType.HEADER -> RowViewHolder(layout) |
|
|
|
HandRowType.ACTION -> RowHandAction(layout) |
|
|
|
HandRowType.ACTION -> RowHandAction(layout) |
|
|
|
HandRowType.STREET -> RowHandStreet(layout) |
|
|
|
HandRowType.STREET -> RowHandStreet(layout) |
|
|
|
@ -137,6 +142,7 @@ class HandHistoryAdapter( |
|
|
|
HandRowType.STRADDLE -> RowHandStraddle(layout) |
|
|
|
HandRowType.STRADDLE -> RowHandStraddle(layout) |
|
|
|
HandRowType.PLAYER_SETUP -> RowHandPlayerSetup(layout) |
|
|
|
HandRowType.PLAYER_SETUP -> RowHandPlayerSetup(layout) |
|
|
|
HandRowType.COMMENT -> RowViewHolder(layout) |
|
|
|
HandRowType.COMMENT -> RowViewHolder(layout) |
|
|
|
|
|
|
|
HandRowType.PLAYER_NUMBER -> RowViewHolder(layout) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|