Fix blinds & format code

feature/top10
Aurelien Hubert 7 years ago
parent 7a839db397
commit dbb71b3362
  1. 33
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -322,7 +322,8 @@ open class Session : RealmObject(), SessionInterface, Savable,
rows.add( rows.add(
HeaderRowRepresentable( HeaderRowRepresentable(
RowViewType.HEADER_TITLE_AMOUNT, RowViewType.HEADER_TITLE_AMOUNT,
resId = R.string.hour_rate_without_pauses, value = this.sessionSet?.hourlyRate.toString() resId = R.string.hour_rate_without_pauses,
value = this.sessionSet?.hourlyRate.toString()
) )
) )
@ -330,12 +331,14 @@ open class Session : RealmObject(), SessionInterface, Savable,
rows.add( rows.add(
HeaderRowRepresentable( HeaderRowRepresentable(
RowViewType.HEADER_TITLE_VALUE, RowViewType.HEADER_TITLE_VALUE,
resId = R.string.bankroll_variation, value = result?.net.toString() resId = R.string.bankroll_variation,
value = result?.net.toString()
) )
) )
} }
} }
else -> {} else -> {
}
} }
// Rows // Rows
@ -372,7 +375,7 @@ open class Session : RealmObject(), SessionInterface, Savable,
override fun actionIconForRow(row: RowRepresentable): Int? { override fun actionIconForRow(row: RowRepresentable): Int? {
return when (row) { return when (row) {
SessionRow.START_DATE, SessionRow.END_DATE -> { SessionRow.START_DATE, SessionRow.END_DATE -> {
R.drawable.ic_close net.pokeranalytics.android.R.drawable.ic_close
} }
else -> null else -> null
} }
@ -390,19 +393,25 @@ open class Session : RealmObject(), SessionInterface, Savable,
SessionRow.BLINDS -> { SessionRow.BLINDS -> {
data.add( data.add(
RowRepresentableEditDescriptor( RowRepresentableEditDescriptor(
cgSmallBlind?.round(), R.string.smallblind, InputType.TYPE_CLASS_NUMBER cgSmallBlind?.round(),
R.string.smallblind,
InputType.TYPE_CLASS_NUMBER
or InputType.TYPE_NUMBER_FLAG_DECIMAL
) )
) )
data.add( data.add(
RowRepresentableEditDescriptor( RowRepresentableEditDescriptor(
cgBigBlind?.round(), R.string.bigblind, InputType.TYPE_CLASS_NUMBER cgBigBlind?.round(), R.string.bigblind, InputType.TYPE_CLASS_NUMBER
or InputType.TYPE_NUMBER_FLAG_DECIMAL
) )
) )
} }
SessionRow.BREAK_TIME -> { SessionRow.BREAK_TIME -> {
data.add( data.add(
RowRepresentableEditDescriptor("", RowRepresentableEditDescriptor(
hint = R.string.in_minutes, inputType = InputType.TYPE_CLASS_NUMBER) "",
hint = R.string.in_minutes, inputType = InputType.TYPE_CLASS_NUMBER
)
) )
} }
SessionRow.BUY_IN -> { SessionRow.BUY_IN -> {
@ -434,7 +443,10 @@ open class Session : RealmObject(), SessionInterface, Savable,
} }
SessionRow.CASHED_OUT, SessionRow.PRIZE -> { SessionRow.CASHED_OUT, SessionRow.PRIZE -> {
data.add( data.add(
RowRepresentableEditDescriptor(result?.cashout?.round(), inputType = InputType.TYPE_CLASS_NUMBER) RowRepresentableEditDescriptor(
result?.cashout?.round(),
inputType = InputType.TYPE_NUMBER_FLAG_SIGNED
)
) )
} }
SessionRow.COMMENT -> { SessionRow.COMMENT -> {
@ -456,7 +468,10 @@ open class Session : RealmObject(), SessionInterface, Savable,
} }
SessionRow.PLAYERS -> { SessionRow.PLAYERS -> {
data.add( data.add(
RowRepresentableEditDescriptor(tournamentNumberOfPlayers?.toString(), inputType = InputType.TYPE_CLASS_NUMBER) RowRepresentableEditDescriptor(
tournamentNumberOfPlayers?.toString(),
inputType = InputType.TYPE_NUMBER_FLAG_SIGNED
)
) )
} }
SessionRow.POSITION -> { SessionRow.POSITION -> {

Loading…
Cancel
Save