|
|
|
|
@ -43,12 +43,21 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
|
private val refreshTimer: Runnable = object : Runnable { |
|
|
|
|
override fun run() { |
|
|
|
|
// Refresh header each 30 seconds |
|
|
|
|
currentSession.updateRowRepresentation() |
|
|
|
|
sessionAdapter.notifyItemChanged(0) |
|
|
|
|
refreshTimer() |
|
|
|
|
handler.postDelayed(this, 60000) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onResume() { |
|
|
|
|
super.onResume() |
|
|
|
|
this.refreshTimer() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun refreshTimer() { |
|
|
|
|
currentSession.updateRowRepresentation() |
|
|
|
|
sessionAdapter.notifyItemChanged(0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
|
|
|
|
return inflater.inflate(R.layout.fragment_session, container, false) |
|
|
|
|
} |
|
|
|
|
@ -236,9 +245,9 @@ class SessionFragment : PokerAnalyticsFragment(), RowRepresentableDelegate { |
|
|
|
|
oldRows.clear() |
|
|
|
|
oldRows.addAll(it) |
|
|
|
|
|
|
|
|
|
if (scrollToTop) { |
|
|
|
|
recyclerView.smoothScrollToPosition(0) |
|
|
|
|
} |
|
|
|
|
// if (scrollToTop) { |
|
|
|
|
// recyclerView.smoothScrollToPosition(0) |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|