Improve Session management

feature/top10
Aurelien Hubert 7 years ago
parent 0f269ea0bb
commit 7912d1641a
  1. 11
      app/src/main/java/net/pokeranalytics/android/ui/view/SessionRowView.kt
  2. 2
      app/src/main/res/layout/row_header_title_amount.xml

@ -72,6 +72,10 @@ class SessionRowView : FrameLayout {
title += (if (title.isNotEmpty()) " " else "") + session.getGameTitle() title += (if (title.isNotEmpty()) " " else "") + session.getGameTitle()
} }
if (title.isEmpty()) {
title = context.getString(R.string.tournament).capitalize()
}
} else if (session.type == Session.TYPE_GAME) { } else if (session.type == Session.TYPE_GAME) {
if (session.cgSmallBlind != null && session.cgBigBlind != null) { if (session.cgSmallBlind != null && session.cgBigBlind != null) {
title += session.getBlinds() title += session.getBlinds()
@ -79,7 +83,10 @@ class SessionRowView : FrameLayout {
session.game?.let { session.game?.let {
title += (if (title.isNotEmpty()) " " else "") + session.getGameTitle() title += (if (title.isNotEmpty()) " " else "") + session.getGameTitle()
} }
title += if (title.isEmpty()) "--" else ""
if (title.isEmpty()) {
title = context.getString(R.string.cash_game).capitalize()
}
} }
rowHistorySession.sessionTitle.text = title rowHistorySession.sessionTitle.text = title
@ -115,7 +122,7 @@ class SessionRowView : FrameLayout {
rowHistorySession.playingIcon.isVisible = false rowHistorySession.playingIcon.isVisible = false
rowHistorySession.playingTitle.isVisible = false rowHistorySession.playingTitle.isVisible = false
val result = session.result?.netResult ?: 0.0 val result = session.result?.net ?: 0.0
rowHistorySession.gameResult.amount = result rowHistorySession.gameResult.amount = result
} }

@ -19,6 +19,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:fontFamily="@font/roboto_medium"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/guidelineStart" app:layout_constraintStart_toStartOf="@+id/guidelineStart"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -33,6 +34,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:ellipsize="end" android:ellipsize="end"
android:fontFamily="@font/roboto_medium"
android:gravity="end" android:gravity="end"
android:maxLines="1" android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"

Loading…
Cancel
Save