mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
make sure we show the initial timer created asynchronously
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
package com.simplemobiletools.clock.fragments
|
package com.simplemobiletools.clock.fragments
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@ -18,9 +20,8 @@ import com.simplemobiletools.clock.models.TimerEvent
|
|||||||
import com.simplemobiletools.commons.extensions.hideKeyboard
|
import com.simplemobiletools.commons.extensions.hideKeyboard
|
||||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
import com.simplemobiletools.commons.models.AlarmSound
|
import com.simplemobiletools.commons.models.AlarmSound
|
||||||
import kotlinx.android.synthetic.main.fragment_timer.timer_fragment
|
import kotlinx.android.synthetic.main.fragment_timer.*
|
||||||
import kotlinx.android.synthetic.main.fragment_timer.view.timer_add
|
import kotlinx.android.synthetic.main.fragment_timer.view.*
|
||||||
import kotlinx.android.synthetic.main.fragment_timer.view.timers_list
|
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.greenrobot.eventbus.Subscribe
|
import org.greenrobot.eventbus.Subscribe
|
||||||
import org.greenrobot.eventbus.ThreadMode
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
@ -54,8 +55,17 @@ class TimerFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initAdapter()
|
initAdapter()
|
||||||
refreshTimers()
|
refreshTimers()
|
||||||
|
|
||||||
|
// the initial timer is created asynchronously at first launch, make sure we show it once created
|
||||||
|
if (context?.config?.appRunCount == 1) {
|
||||||
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
|
refreshTimers()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user