make sure we update the timers on the proper thread
This commit is contained in:
parent
fe08a533a8
commit
3baf841211
1 changed files with 2 additions and 2 deletions
|
@ -92,8 +92,8 @@ class TimerFragment : Fragment() {
|
||||||
|
|
||||||
private fun refreshTimers(scrollToLatest: Boolean = false) {
|
private fun refreshTimers(scrollToLatest: Boolean = false) {
|
||||||
activity?.timerHelper?.getTimers { timers ->
|
activity?.timerHelper?.getTimers { timers ->
|
||||||
|
activity?.runOnUiThread {
|
||||||
timerAdapter.submitList(timers) {
|
timerAdapter.submitList(timers) {
|
||||||
view.timers_list.post {
|
|
||||||
if (getView() != null) {
|
if (getView() != null) {
|
||||||
if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) {
|
if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) {
|
||||||
view.timers_list.scrollToPosition(timerPositionToScrollTo)
|
view.timers_list.scrollToPosition(timerPositionToScrollTo)
|
||||||
|
|
Loading…
Reference in a new issue