diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneFragment.kt index 85e7d2fb87..5ab8cb1dcf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneFragment.kt @@ -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 -> diff --git a/app/src/main/res/layout/autotune_fragment.xml b/app/src/main/res/layout/autotune_fragment.xml index 003699e6ba..744b9a260e 100644 --- a/app/src/main/res/layout/autotune_fragment.xml +++ b/app/src/main/res/layout/autotune_fragment.xml @@ -140,7 +140,8 @@ android:gravity="start" android:paddingStart="5dp" android:paddingEnd="5dp" - android:textSize="14sp" /> + android:textSize="14sp" + android:textColor="@color/colorCalculatorButton"/>