|
|
|
|
@ -37,6 +37,7 @@ import net.pokeranalytics.android.ui.view.rowrepresentable.SeparatorRowRepresent |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow |
|
|
|
|
import net.pokeranalytics.android.util.CurrencyUtils |
|
|
|
|
import net.pokeranalytics.android.util.NULL_TEXT |
|
|
|
|
import net.pokeranalytics.android.util.Preferences |
|
|
|
|
import net.pokeranalytics.android.util.extensions.* |
|
|
|
|
import java.util.* |
|
|
|
|
import java.util.Currency |
|
|
|
|
@ -485,9 +486,9 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat |
|
|
|
|
/** |
|
|
|
|
* Return the formatted blinds |
|
|
|
|
*/ |
|
|
|
|
fun getBlinds(): String { |
|
|
|
|
fun getBlinds(context: Context): String { |
|
|
|
|
val currencyCode = bankroll?.currency?.code ?: CurrencyUtils.getLocaleCurrency().currencyCode |
|
|
|
|
val currencySymbol = Currency.getInstance(currencyCode).symbol |
|
|
|
|
val currencySymbol = Currency.getInstance(currencyCode).getSymbol(Preferences.getCurrencyLocale(context)) |
|
|
|
|
return if (cgSmallBlind == null) NULL_TEXT else "$currencySymbol ${cgSmallBlind?.formatted()}/${cgBigBlind?.round()}" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -624,7 +625,7 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat |
|
|
|
|
override fun stringForRow(row: RowRepresentable, context: Context): String { |
|
|
|
|
return when (row) { |
|
|
|
|
SessionRow.BANKROLL -> bankroll?.name ?: NULL_TEXT |
|
|
|
|
SessionRow.BLINDS -> getBlinds() |
|
|
|
|
SessionRow.BLINDS -> getBlinds(context) |
|
|
|
|
SessionRow.BREAK_TIME -> if (this.breakDuration > 0.0) this.breakDuration.toMinutes() else NULL_TEXT |
|
|
|
|
SessionRow.BUY_IN -> this.result?.buyin?.toCurrency(CurrencyUtils.getCurrency(bankroll)) ?: NULL_TEXT |
|
|
|
|
SessionRow.CASHED_OUT, SessionRow.PRIZE -> this.result?.cashout?.toCurrency(CurrencyUtils.getCurrency(bankroll)) ?: NULL_TEXT |
|
|
|
|
|