|
|
|
|
@ -100,7 +100,6 @@ class SessionRowView : FrameLayout { |
|
|
|
|
// session.timeFrame?.let { |
|
|
|
|
// rowHistorySession.sessionInfoDurationValue.text = session.getFormattedDuration() |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
rowHistorySession.sessionInfoDurationValue.text = session.getFormattedDuration() |
|
|
|
|
|
|
|
|
|
// Location |
|
|
|
|
@ -117,19 +116,28 @@ class SessionRowView : FrameLayout { |
|
|
|
|
rowHistorySession.sessionInfoTableValue.text = TableSize(it).localizedTitle(context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val state = session.getState() |
|
|
|
|
rowHistorySession.sessionInfoDurationIcon.isVisible = state.hasStarted |
|
|
|
|
rowHistorySession.sessionInfoDurationValue.isVisible = state.hasStarted |
|
|
|
|
|
|
|
|
|
// State |
|
|
|
|
if (session.getState() == SessionState.STARTED) { |
|
|
|
|
if (state == SessionState.STARTED) { |
|
|
|
|
rowHistorySession.gameResult.isVisible = false |
|
|
|
|
rowHistorySession.infoIcon.isVisible = true |
|
|
|
|
rowHistorySession.infoIcon.setImageResource(R.drawable.chip) |
|
|
|
|
rowHistorySession.infoTitle.isVisible = true |
|
|
|
|
rowHistorySession.infoTitle.text = context.getString(R.string.running_session_state) |
|
|
|
|
} else if (session.getState() == SessionState.PLANNED) { |
|
|
|
|
} else if (state == SessionState.PLANNED) { |
|
|
|
|
rowHistorySession.gameResult.isVisible = false |
|
|
|
|
rowHistorySession.infoIcon.isVisible = true |
|
|
|
|
rowHistorySession.infoIcon.setImageResource(R.drawable.ic_planned) |
|
|
|
|
rowHistorySession.infoTitle.isVisible = true |
|
|
|
|
rowHistorySession.infoTitle.text = session.startDate!!.shortTime() |
|
|
|
|
} else if (state == SessionState.PENDING) { |
|
|
|
|
rowHistorySession.gameResult.isVisible = false |
|
|
|
|
rowHistorySession.infoIcon.isVisible = false |
|
|
|
|
rowHistorySession.infoTitle.isVisible = false |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
rowHistorySession.gameResult.isVisible = true |
|
|
|
|
rowHistorySession.infoIcon.isVisible = false |
|
|
|
|
|