Improve Session UI

feature/top10
Aurelien Hubert 7 years ago
parent e9639ee81c
commit 87dbc2efb7
  1. 4
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt
  2. 2
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/bottomsheet/BottomSheetTableSizeGridFragment.kt
  3. 4
      app/src/main/java/net/pokeranalytics/android/ui/view/SessionRowView.kt

@ -284,11 +284,11 @@ open class Session : RealmObject(), SessionInterface, Savable,
override fun stringForRow(row: RowRepresentable): String {
return when (row) {
SessionRow.BUY_IN -> buyin.toCurrency()
SessionRow.BLINDS -> if (cgSmallBlind != null && cgBigBlind != null) "$cgSmallBlind / $cgBigBlind" else "--"
SessionRow.BLINDS -> getBlinds()
SessionRow.GAME -> getGameTitle()
SessionRow.LOCATION -> location?.name ?: "--"
SessionRow.BANKROLL -> bankroll?.name ?: "--"
SessionRow.TABLE_SIZE -> tableSize?.toString() ?: "--"
SessionRow.TABLE_SIZE -> tableSize?.toString() ?: "--" // if (tableSize != null) TableSize(tableSize ?: 0).localizedTitle(context) else "--"
SessionRow.START_DATE -> if (timeFrame != null) timeFrame?.startDate?.shortDateTime() ?: "--" else "--"
SessionRow.END_DATE -> if (timeFrame != null) timeFrame?.endDate?.shortDateTime() ?: "--" else "--"
SessionRow.COMMENT -> if (comment.isNotEmpty()) comment else "--"

@ -85,7 +85,7 @@ class BottomSheetTableSizeGridFragment : BottomSheetFragment(),
}
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) {
this.delegate.onRowValueChanged((this.row as TableSize).numberOfPlayer, row)
this.delegate.onRowValueChanged((row as TableSize).numberOfPlayer, this.row)
dismiss()
}

@ -68,7 +68,7 @@ class SessionRowView : FrameLayout {
title += session.getBlinds()
}
session.game?.let {
title += session.getGameTitle()
title += (if (title.isNotEmpty()) " " else "") + session.getGameTitle()
}
title += if (title.isEmpty()) "--" else ""
@ -92,7 +92,7 @@ class SessionRowView : FrameLayout {
rowHistorySession.sessionInfoTableIcon.isVisible = session.tableSize != null
rowHistorySession.sessionInfoTableValue.isVisible = session.tableSize != null
session.tableSize?.let {
rowHistorySession.sessionInfoTableValue.text = TableSize.all[it].localizedTitle(context)
rowHistorySession.sessionInfoTableValue.text = TableSize(it).localizedTitle(context)
}
// State

Loading…
Cancel
Save