merge cherry-picking

feature/top10
Laurent 7 years ago
parent 20a4cdf76e
commit a27745bcc7
  1. 4
      app/build.gradle
  2. 23
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt
  3. 4
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/bottomsheet/BottomSheetNumericTextFragment.kt

@ -28,7 +28,11 @@ android {
applicationId "net.pokeranalytics.android"
minSdkVersion 23
targetSdkVersion 28
<<<<<<< HEAD
versionCode 8
=======
versionCode 15
>>>>>>> f5b9190... Fixes more crashes
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

@ -649,14 +649,9 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat
SessionRow.BANKROLL -> bankroll?.name ?: NULL_TEXT
SessionRow.BLINDS -> getFormattedBlinds()
SessionRow.BREAK_TIME -> if (this.breakDuration > 0.0) this.breakDuration.toMinutes() else NULL_TEXT
<<<<<<< HEAD
SessionRow.BUY_IN -> this.result?.buyin?.toCurrency(currency) ?: NULL_TEXT
SessionRow.CASHED_OUT, SessionRow.PRIZE, SessionRow.NET_RESULT -> this.result?.cashout?.toCurrency(currency) ?: 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
SessionRow.NET_RESULT -> this.result?.netResult?.toCurrency(CurrencyUtils.getCurrency(bankroll)) ?: NULL_TEXT
>>>>>>> 0eba63f... Harmonizing number capture and management + fixing crashes
SessionRow.CASHED_OUT, SessionRow.PRIZE -> this.result?.cashout?.toCurrency(currency) ?: NULL_TEXT
SessionRow.NET_RESULT -> this.result?.netResult?.toCurrency(currency) ?: NULL_TEXT
SessionRow.COMMENT -> if (this.comment.isNotEmpty()) this.comment else NULL_TEXT
SessionRow.END_DATE -> this.endDate?.shortDateTime() ?: NULL_TEXT
SessionRow.GAME -> getFormattedGame()
@ -830,10 +825,20 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat
}
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee = if (value == null) null else (value as String).toDouble()
SessionRow.LOCATION -> location = value as Location?
SessionRow.PLAYERS -> tournamentNumberOfPlayers = if (value != null) (value as String).toInt() else null
SessionRow.PLAYERS -> {
if (value is Double) {
this.tournamentNumberOfPlayers = value.toInt()
} else {
this.tournamentNumberOfPlayers = null
}
}
SessionRow.POSITION -> {
val localResult = if (result != null) result as Result else realm.createObject(Result::class.java)
localResult.tournamentFinalPosition = if (value == null) null else (value as String).toInt()
if (value is Double) {
localResult.tournamentFinalPosition = value.toInt()
} else {
localResult.tournamentFinalPosition = null
}
result = localResult
}
SessionRow.START_DATE -> if (value is Date) {

@ -61,9 +61,13 @@ class BottomSheetNumericTextFragment : BottomSheetFragment() {
}
data[0].defaultValue?.let {
if (it is Double || it is Long) {
val formatter = NumberFormat.getNumberInstance()
formatter.isGroupingUsed = false
editText1.setText(formatter.format(it))
} else {
editText1.setText(it.toString())
}
}
editText1.setOnEditorActionListener { _, actionId, _ ->

Loading…
Cancel
Save