Remove additional thread and move binding check into runOnUiThread
This commit is contained in:
parent
31cb9a1156
commit
5db11a0b47
1 changed files with 4 additions and 5 deletions
|
@ -381,10 +381,9 @@ class AutotuneFragment : DaggerFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showResults() {
|
private fun showResults() {
|
||||||
_binding ?: return
|
context?.let { context ->
|
||||||
Thread {
|
runOnUiThread {
|
||||||
context?.let { context ->
|
_binding?.let {
|
||||||
runOnUiThread {
|
|
||||||
binding.autotuneResults.removeAllViews()
|
binding.autotuneResults.removeAllViews()
|
||||||
if (autotunePlugin.result.isNotBlank()) {
|
if (autotunePlugin.result.isNotBlank()) {
|
||||||
var toMgDl = 1.0
|
var toMgDl = 1.0
|
||||||
|
@ -455,7 +454,7 @@ class AutotuneFragment : DaggerFragment() {
|
||||||
binding.autotuneResultsCard.visibility = if (autotunePlugin.calculationRunning && autotunePlugin.result.isEmpty()) View.GONE else View.VISIBLE
|
binding.autotuneResultsCard.visibility = if (autotunePlugin.calculationRunning && autotunePlugin.result.isEmpty()) View.GONE else View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start()
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun toTableRowHeader(basal:Boolean = false): TableRow =
|
private fun toTableRowHeader(basal:Boolean = false): TableRow =
|
||||||
|
|
Loading…
Reference in a new issue