StatsActivity fix

This commit is contained in:
Milos Kozak 2021-08-11 19:01:19 +02:00
parent 24fc69c26b
commit c5857da42f
2 changed files with 19 additions and 3 deletions

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.activities package info.nightscout.androidaps.activities
import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Action
@ -21,14 +22,28 @@ class StatsActivity : NoSplashAppCompatActivity() {
private lateinit var binding: ActivityStatsBinding private lateinit var binding: ActivityStatsBinding
@SuppressLint("SetTextI18n")
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
binding = ActivityStatsBinding.inflate(layoutInflater) binding = ActivityStatsBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
binding.tdds.text = tddCalculator.stats() binding.tdds.text = getString(R.string.tdd) + ": " + getString(R.string.calculation_in_progress)
binding.tir.text = tirCalculator.stats() binding.tir.text = getString(R.string.tir) + ": " + getString(R.string.calculation_in_progress)
binding.activity.text = activityMonitor.stats() binding.activity.text = getString(R.string.activitymonitor) + ": " + getString(R.string.calculation_in_progress)
Thread {
val tdds = tddCalculator.stats()
runOnUiThread { binding.tdds.text = tdds }
}.start()
Thread {
val tir = tirCalculator.stats()
runOnUiThread { binding.tir.text = tir }
}.start()
Thread {
val activity = activityMonitor.stats()
runOnUiThread { binding.activity.text = activity }
}.start()
binding.ok.setOnClickListener { finish() } binding.ok.setOnClickListener { finish() }
binding.reset.setOnClickListener { binding.reset.setOnClickListener {

View file

@ -1155,5 +1155,6 @@
<string name="ns_receive_cgm_summary">Accept CGM data from NS</string> <string name="ns_receive_cgm_summary">Accept CGM data from NS</string>
<string name="sms_timeout_while_wating">Timeout while waiting for finish of previous pump communication</string> <string name="sms_timeout_while_wating">Timeout while waiting for finish of previous pump communication</string>
<string name="smscommunicator_another_bolus_in_queue">There is another bolus in queue. Try again later.</string> <string name="smscommunicator_another_bolus_in_queue">There is another bolus in queue. Try again later.</string>
<string name="calculation_in_progress">Calculation in progress</string>
</resources> </resources>