Restore LastRun results with click on LastRun date

This commit is contained in:
Philoul 2022-06-06 18:30:01 +02:00
parent 02d8e9928e
commit e89e5102f7
2 changed files with 10 additions and 2 deletions

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.general.autotune
import android.graphics.Paint
import android.graphics.Typeface
import android.os.Bundle
import android.text.Editable
@ -253,6 +254,12 @@ class AutotuneFragment : DaggerFragment() {
}
}
}
binding.tuneLastrun.setOnClickListener {
autotunePlugin.loadLastRun()
updateGui()
}
binding.tuneLastrun.paintFlags = binding.tuneLastrun.paintFlags or Paint.UNDERLINE_TEXT_FLAG
}
@Synchronized
@ -265,7 +272,6 @@ class AutotuneFragment : DaggerFragment() {
updateGui()
}, { fabricPrivacy.logException(it) })
checkNewDay()
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
updateGui()
}
@ -278,6 +284,7 @@ class AutotuneFragment : DaggerFragment() {
@Synchronized
private fun updateGui() {
_binding ?: return
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil)
profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString()
profileFunction.getProfile()?.let { currentProfile ->

View file

@ -140,7 +140,8 @@
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textSize="14sp" />
android:textSize="14sp"
android:textColor="@color/colorCalculatorButton"/>
</LinearLayout>