|
|
|
@ -214,7 +214,7 @@ open class Session : RealmObject(), SessionInterface, Savable, |
|
|
|
* Return the formatted blinds |
|
|
|
* Return the formatted blinds |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun getBlinds(): String { |
|
|
|
fun getBlinds(): String { |
|
|
|
return if (cgSmallBlind == null) "--" else "${cgSmallBlind?.toCurrency()}/${cgBigBlind?.round()}" |
|
|
|
return if (cgSmallBlind == null) NULL_TEXT else "${cgSmallBlind?.toCurrency()}/${cgBigBlind?.round()}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -228,7 +228,7 @@ open class Session : RealmObject(), SessionInterface, Savable, |
|
|
|
if (game != null) { |
|
|
|
if (game != null) { |
|
|
|
gameTitle += game?.name |
|
|
|
gameTitle += game?.name |
|
|
|
} |
|
|
|
} |
|
|
|
return if (gameTitle.isNotBlank()) gameTitle else "--" |
|
|
|
return if (gameTitle.isNotBlank()) gameTitle else NULL_TEXT |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -383,23 +383,23 @@ open class Session : RealmObject(), SessionInterface, Savable, |
|
|
|
|
|
|
|
|
|
|
|
override fun stringForRow(row: RowRepresentable, context: Context): String { |
|
|
|
override fun stringForRow(row: RowRepresentable, context: Context): String { |
|
|
|
return when (row) { |
|
|
|
return when (row) { |
|
|
|
SessionRow.BANKROLL -> bankroll?.name ?: "--" |
|
|
|
SessionRow.BANKROLL -> bankroll?.name ?: NULL_TEXT |
|
|
|
SessionRow.BLINDS -> getBlinds() |
|
|
|
SessionRow.BLINDS -> getBlinds() |
|
|
|
SessionRow.BREAK_TIME -> timeFrame?.breakDuration?.toMinutes() ?: "--" |
|
|
|
SessionRow.BREAK_TIME -> timeFrame?.breakDuration?.toMinutes() ?: NULL_TEXT |
|
|
|
SessionRow.BUY_IN -> buyin.toCurrency() |
|
|
|
SessionRow.BUY_IN -> buyin.toCurrency() |
|
|
|
SessionRow.CASHED_OUT, SessionRow.PRIZE, SessionRow.NET_RESULT -> result?.cashout?.toCurrency() ?: "--" |
|
|
|
SessionRow.CASHED_OUT, SessionRow.PRIZE, SessionRow.NET_RESULT -> result?.cashout?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.COMMENT -> if (comment.isNotEmpty()) comment else "--" |
|
|
|
SessionRow.COMMENT -> if (comment.isNotEmpty()) comment else NULL_TEXT |
|
|
|
SessionRow.END_DATE -> if (timeFrame != null) timeFrame?.endDate?.shortDateTime() ?: "--" else "--" |
|
|
|
SessionRow.END_DATE -> if (timeFrame != null) timeFrame?.endDate?.shortDateTime() ?: NULL_TEXT else NULL_TEXT |
|
|
|
SessionRow.GAME -> getGameTitle() |
|
|
|
SessionRow.GAME -> getGameTitle() |
|
|
|
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee?.toCurrency() ?: "--" |
|
|
|
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.LOCATION -> location?.name ?: "--" |
|
|
|
SessionRow.LOCATION -> location?.name ?: NULL_TEXT |
|
|
|
SessionRow.PLAYERS -> tournamentNumberOfPlayers?.toString() ?: "--" |
|
|
|
SessionRow.PLAYERS -> tournamentNumberOfPlayers?.toString() ?: NULL_TEXT |
|
|
|
SessionRow.POSITION -> result?.tournamentFinalPosition?.toString() ?: "--" |
|
|
|
SessionRow.POSITION -> result?.tournamentFinalPosition?.toString() ?: NULL_TEXT |
|
|
|
SessionRow.START_DATE -> if (timeFrame != null) timeFrame?.startDate?.shortDateTime() ?: "--" else "--" |
|
|
|
SessionRow.START_DATE -> if (timeFrame != null) timeFrame?.startDate?.shortDateTime() ?: NULL_TEXT else NULL_TEXT |
|
|
|
SessionRow.TABLE_SIZE -> this.tableSize?.let { TableSize(it).localizedTitle(context) } ?: "--" |
|
|
|
SessionRow.TABLE_SIZE -> this.tableSize?.let { TableSize(it).localizedTitle(context) } ?: NULL_TEXT |
|
|
|
SessionRow.TIPS -> result?.tips?.toCurrency() ?: "--" |
|
|
|
SessionRow.TIPS -> result?.tips?.toCurrency() ?: NULL_TEXT |
|
|
|
SessionRow.TOURNAMENT_TYPE -> tournamentType?.name ?: "--" |
|
|
|
SessionRow.TOURNAMENT_TYPE -> tournamentType?.name ?: NULL_TEXT |
|
|
|
else -> "--" |
|
|
|
else -> NULL_TEXT |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|