run response on UI thread
This commit is contained in:
parent
f399f8bb1f
commit
6c4a6fac18
1 changed files with 10 additions and 10 deletions
|
@ -240,14 +240,14 @@ class ObjectivesFragment : Fragment() {
|
|||
holder.start.setOnClickListener {
|
||||
holder.start.visibility = View.INVISIBLE
|
||||
NetworkChangeReceiver.fetch()
|
||||
SntpClient.ntpTime(object : SntpClient.Callback() {
|
||||
override fun run() {
|
||||
if (objectives_fake.isChecked) {
|
||||
objective.startedOn = time
|
||||
scrollToCurrentObjective()
|
||||
startUpdateTimer()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
} else
|
||||
if (objectives_fake.isChecked) {
|
||||
objective.startedOn = DateUtil.now()
|
||||
scrollToCurrentObjective()
|
||||
startUpdateTimer()
|
||||
RxBus.send(EventObjectivesUpdateGui())
|
||||
} else
|
||||
SntpClient.ntpTime(object : SntpClient.Callback() {
|
||||
override fun run() {
|
||||
activity?.runOnUiThread {
|
||||
holder.start.visibility = View.VISIBLE
|
||||
log.debug("NTP time: $time System time: ${DateUtil.now()}")
|
||||
|
@ -262,8 +262,8 @@ class ObjectivesFragment : Fragment() {
|
|||
ToastUtils.showToastInUiThread(context, R.string.failedretrievetime)
|
||||
}
|
||||
}
|
||||
}
|
||||
}, NetworkChangeReceiver.isConnected())
|
||||
}
|
||||
}, NetworkChangeReceiver.isConnected())
|
||||
}
|
||||
holder.revert.setOnClickListener {
|
||||
objective.accomplishedOn = 0
|
||||
|
|
Loading…
Reference in a new issue