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.setOnClickListener {
|
||||||
holder.start.visibility = View.INVISIBLE
|
holder.start.visibility = View.INVISIBLE
|
||||||
NetworkChangeReceiver.fetch()
|
NetworkChangeReceiver.fetch()
|
||||||
SntpClient.ntpTime(object : SntpClient.Callback() {
|
if (objectives_fake.isChecked) {
|
||||||
override fun run() {
|
objective.startedOn = DateUtil.now()
|
||||||
if (objectives_fake.isChecked) {
|
scrollToCurrentObjective()
|
||||||
objective.startedOn = time
|
startUpdateTimer()
|
||||||
scrollToCurrentObjective()
|
RxBus.send(EventObjectivesUpdateGui())
|
||||||
startUpdateTimer()
|
} else
|
||||||
RxBus.send(EventObjectivesUpdateGui())
|
SntpClient.ntpTime(object : SntpClient.Callback() {
|
||||||
} else
|
override fun run() {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
holder.start.visibility = View.VISIBLE
|
holder.start.visibility = View.VISIBLE
|
||||||
log.debug("NTP time: $time System time: ${DateUtil.now()}")
|
log.debug("NTP time: $time System time: ${DateUtil.now()}")
|
||||||
|
@ -262,8 +262,8 @@ class ObjectivesFragment : Fragment() {
|
||||||
ToastUtils.showToastInUiThread(context, R.string.failedretrievetime)
|
ToastUtils.showToastInUiThread(context, R.string.failedretrievetime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, NetworkChangeReceiver.isConnected())
|
}, NetworkChangeReceiver.isConnected())
|
||||||
}
|
}
|
||||||
holder.revert.setOnClickListener {
|
holder.revert.setOnClickListener {
|
||||||
objective.accomplishedOn = 0
|
objective.accomplishedOn = 0
|
||||||
|
|
Loading…
Reference in a new issue