|
|
|
@ -88,7 +88,7 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
|
|
|
|
|
|
|
|
val data = currentSession.editDescriptors(row) |
|
|
|
val data = currentSession.editDescriptors(row) |
|
|
|
when (row) { |
|
|
|
when (row) { |
|
|
|
SessionRow.START_DATE -> DateTimePickerManager.create(requireContext(),row,this,currentSession.startDate) |
|
|
|
SessionRow.START_DATE -> DateTimePickerManager.create(requireContext(), row, this, currentSession.startDate) |
|
|
|
SessionRow.END_DATE -> DateTimePickerManager.create( |
|
|
|
SessionRow.END_DATE -> DateTimePickerManager.create( |
|
|
|
requireContext(), |
|
|
|
requireContext(), |
|
|
|
row, |
|
|
|
row, |
|
|
|
@ -151,12 +151,14 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
* Update the UI with the session data |
|
|
|
* Update the UI with the session data |
|
|
|
* Should be called after the initialization of the session |
|
|
|
* Should be called after the initialization of the session |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun updateSessionUI() { |
|
|
|
private fun updateSessionUI(firstDisplay: Boolean = false) { |
|
|
|
|
|
|
|
|
|
|
|
this.currentSession.updateRowRepresentation() |
|
|
|
this.currentSession.updateRowRepresentation() |
|
|
|
|
|
|
|
|
|
|
|
handler.removeCallbacksAndMessages(null) |
|
|
|
handler.removeCallbacksAndMessages(null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val animationDuration = if (firstDisplay) 0L else 300L |
|
|
|
|
|
|
|
|
|
|
|
when (currentSession.getState()) { |
|
|
|
when (currentSession.getState()) { |
|
|
|
SessionState.PENDING, SessionState.PLANNED -> { |
|
|
|
SessionState.PENDING, SessionState.PLANNED -> { |
|
|
|
state.setTextColor(ContextCompat.getColor(requireContext(), R.color.white)) |
|
|
|
state.setTextColor(ContextCompat.getColor(requireContext(), R.color.white)) |
|
|
|
@ -164,6 +166,7 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
floatingActionButton.setImageResource(R.drawable.ic_outline_play) |
|
|
|
floatingActionButton.setImageResource(R.drawable.ic_outline_play) |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = false |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = false |
|
|
|
floatingActionButton.animate().scaleX(1f).scaleY(1f).alpha(1f) |
|
|
|
floatingActionButton.animate().scaleX(1f).scaleY(1f).alpha(1f) |
|
|
|
|
|
|
|
.setDuration(animationDuration) |
|
|
|
.setInterpolator(OvershootInterpolator()).start() |
|
|
|
.setInterpolator(OvershootInterpolator()).start() |
|
|
|
} |
|
|
|
} |
|
|
|
SessionState.STARTED -> { |
|
|
|
SessionState.STARTED -> { |
|
|
|
@ -172,6 +175,7 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
floatingActionButton.setImageResource(R.drawable.ic_outline_pause) |
|
|
|
floatingActionButton.setImageResource(R.drawable.ic_outline_pause) |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = true |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = true |
|
|
|
floatingActionButton.animate().scaleX(1f).scaleY(1f).alpha(1f) |
|
|
|
floatingActionButton.animate().scaleX(1f).scaleY(1f).alpha(1f) |
|
|
|
|
|
|
|
.setDuration(animationDuration) |
|
|
|
.setInterpolator(OvershootInterpolator()).start() |
|
|
|
.setInterpolator(OvershootInterpolator()).start() |
|
|
|
handler.postDelayed(refreshTimer, 30000) |
|
|
|
handler.postDelayed(refreshTimer, 30000) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -181,6 +185,7 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
floatingActionButton.setImageResource(R.drawable.ic_outline_play) |
|
|
|
floatingActionButton.setImageResource(R.drawable.ic_outline_play) |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = true |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = true |
|
|
|
floatingActionButton.animate().scaleX(1f).scaleY(1f).alpha(1f) |
|
|
|
floatingActionButton.animate().scaleX(1f).scaleY(1f).alpha(1f) |
|
|
|
|
|
|
|
.setDuration(animationDuration) |
|
|
|
.setInterpolator(OvershootInterpolator()).start() |
|
|
|
.setInterpolator(OvershootInterpolator()).start() |
|
|
|
} |
|
|
|
} |
|
|
|
SessionState.FINISHED -> { |
|
|
|
SessionState.FINISHED -> { |
|
|
|
@ -188,6 +193,7 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
sessionMenu?.findItem(R.id.restart)?.isVisible = true |
|
|
|
sessionMenu?.findItem(R.id.restart)?.isVisible = true |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = false |
|
|
|
sessionMenu?.findItem(R.id.stop)?.isVisible = false |
|
|
|
floatingActionButton.animate().scaleX(0f).scaleY(0f).alpha(0f) |
|
|
|
floatingActionButton.animate().scaleX(0f).scaleY(0f).alpha(0f) |
|
|
|
|
|
|
|
.setDuration(animationDuration) |
|
|
|
.setInterpolator(FastOutSlowInInterpolator()).start() |
|
|
|
.setInterpolator(FastOutSlowInInterpolator()).start() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -299,7 +305,7 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
|
|
|
|
|
|
|
|
currentSession.location = location |
|
|
|
currentSession.location = location |
|
|
|
realm.commitTransaction() |
|
|
|
realm.commitTransaction() |
|
|
|
updateSessionUI() |
|
|
|
updateSessionUI(true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
sessionHasBeenCustomized = false |
|
|
|
sessionHasBeenCustomized = false |
|
|
|
@ -312,7 +318,7 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
sessionAdapter = RowRepresentableAdapter(currentSession, this) |
|
|
|
sessionAdapter = RowRepresentableAdapter(currentSession, this) |
|
|
|
recyclerView.adapter = sessionAdapter |
|
|
|
recyclerView.adapter = sessionAdapter |
|
|
|
|
|
|
|
|
|
|
|
updateSessionUI() |
|
|
|
updateSessionUI(true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|