|
|
|
|
@ -72,9 +72,6 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr |
|
|
|
|
private var _binding: FragmentSessionBinding? = null |
|
|
|
|
private val binding get() = _binding!! |
|
|
|
|
|
|
|
|
|
// private val coroutineContext: CoroutineContext |
|
|
|
|
// get() = Dispatchers.Main |
|
|
|
|
|
|
|
|
|
override fun onResume() { |
|
|
|
|
super.onResume() |
|
|
|
|
|
|
|
|
|
@ -282,6 +279,9 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr |
|
|
|
|
*/ |
|
|
|
|
private fun updateSessionUI(firstDisplay: Boolean = false) { |
|
|
|
|
|
|
|
|
|
val state = currentSession.getState() |
|
|
|
|
CrashLogging.log("Update session UI: $state") |
|
|
|
|
|
|
|
|
|
this.updateRowRepresentation() |
|
|
|
|
|
|
|
|
|
handler.removeCallbacksAndMessages(null) |
|
|
|
|
@ -289,7 +289,7 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr |
|
|
|
|
val animationDuration = if (firstDisplay) 0L else 300L |
|
|
|
|
|
|
|
|
|
val floatingActionButton = binding.floatingActionButton |
|
|
|
|
when (currentSession.getState()) { |
|
|
|
|
when (state) { |
|
|
|
|
SessionState.PENDING, SessionState.PLANNED -> { |
|
|
|
|
sessionMenu?.findItem(R.id.restart)?.isVisible = false |
|
|
|
|
floatingActionButton.setImageResource(R.drawable.ic_outline_play) |
|
|
|
|
@ -334,7 +334,10 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr |
|
|
|
|
*/ |
|
|
|
|
private fun updateMenuUI() { |
|
|
|
|
|
|
|
|
|
when (currentSession.getState()) { |
|
|
|
|
val state = currentSession.getState() |
|
|
|
|
CrashLogging.log("Update menu UI: $state") |
|
|
|
|
|
|
|
|
|
when (state) { |
|
|
|
|
SessionState.PENDING, SessionState.PLANNED -> { |
|
|
|
|
sessionMenu?.findItem(R.id.restart)?.isVisible = false |
|
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = false |
|
|
|
|
|