2019-12-09 19:03:26 +01:00
|
|
|
package info.nightscout.androidaps.activities
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
|
|
import info.nightscout.androidaps.R
|
|
|
|
import info.nightscout.androidaps.utils.ActivityMonitor
|
|
|
|
import info.nightscout.androidaps.utils.OKDialog
|
|
|
|
import info.nightscout.androidaps.utils.TddCalculator
|
|
|
|
import info.nightscout.androidaps.utils.TirCalculator
|
2019-12-30 00:53:44 +01:00
|
|
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
2019-12-09 19:03:26 +01:00
|
|
|
import kotlinx.android.synthetic.main.stats_activity.*
|
2019-12-28 22:51:04 +01:00
|
|
|
import javax.inject.Inject
|
2019-12-09 19:03:26 +01:00
|
|
|
|
|
|
|
class StatsActivity : NoSplashAppCompatActivity() {
|
2019-12-30 00:53:44 +01:00
|
|
|
@Inject lateinit var tddCalculator: TddCalculator
|
|
|
|
@Inject lateinit var resourceHelper: ResourceHelper
|
2019-12-28 22:51:04 +01:00
|
|
|
|
2019-12-09 19:03:26 +01:00
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
setContentView(R.layout.stats_activity)
|
|
|
|
|
2019-12-28 22:51:04 +01:00
|
|
|
stats_tdds.text = tddCalculator.stats()
|
2019-12-09 19:03:26 +01:00
|
|
|
stats_tir.text = TirCalculator.stats()
|
|
|
|
stats_activity.text = ActivityMonitor.stats()
|
|
|
|
|
|
|
|
ok.setOnClickListener { finish() }
|
|
|
|
stats_reset.setOnClickListener {
|
2019-12-30 00:53:44 +01:00
|
|
|
OKDialog.showConfirmation(this, resourceHelper.gs(R.string.doyouwantresetstats), Runnable {
|
2019-12-09 19:03:26 +01:00
|
|
|
ActivityMonitor.reset()
|
|
|
|
recreate()
|
2019-12-22 21:37:26 +01:00
|
|
|
})
|
2019-12-09 19:03:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|