Merge pull request #869 from dlvoy/fix/868_anr_in_tdd_profile_helper

Fix ANR in Profile Helper by moving slow TDD calc into separate thread
This commit is contained in:
Milos Kozak 2021-11-08 09:44:29 +01:00 committed by GitHub
commit 21d7f7c13b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,7 +168,11 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
binding.basalpctfromtdd.setParams(32.0, 32.0, 37.0, 1.0, DecimalFormat("0"), false, null)
binding.tdds.text = tddCalculator.stats()
binding.tdds.text = getString(R.string.tdd) + ": " + rh.gs(R.string.calculation_in_progress);
Thread {
val tdds = tddCalculator.stats()
runOnUiThread { binding.tdds.text = tdds }
}.start()
// Current profile
binding.currentProfileText.text = profileFunction.getProfileName()