Merge branch 'master' of gitlab.com:stax-river/poker-analytics

feature/top10
Aurelien Hubert 7 years ago
commit 0f5b15e32e
  1. 5
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -165,6 +165,7 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
var cgBigBlind: Double? = null
set(value) {
this.hasBigBlind = if (value != null) 1 else 0
field = value
}
// Tournament
@ -414,7 +415,7 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
fun getBlinds(): String {
val currencyCode = bankroll?.currency?.code ?: Currency.getInstance(Locale.getDefault()).currencyCode
val currencySymbol = Currency.getInstance(currencyCode).symbol
return if (cgSmallBlind == null) NULL_TEXT else "$currencySymbol ${cgSmallBlind?.formatted()}/${cgBigBlind?.formatted()}"
return if (cgSmallBlind == null) NULL_TEXT else "$currencySymbol ${cgSmallBlind?.formatted()}/${cgBigBlind?.round()}"
}
/**
@ -652,12 +653,12 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
when (row) {
SessionRow.BANKROLL -> bankroll = value as Bankroll?
SessionRow.BLINDS -> if (value is ArrayList<*>) {
cgSmallBlind = try {
(value[0] as String? ?: "0").toDouble()
} catch (e: Exception) {
null
}
cgBigBlind = try {
(value[1] as String? ?: "0").toDouble()
} catch (e: Exception) {

Loading…
Cancel
Save