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
|
|
||||||
Thread {
|
|
||||||
context?.let { context ->
|
context?.let { context ->
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
_binding?.let {
|
||||||
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