Restore LastRun results with click on LastRun date
This commit is contained in:
parent
02d8e9928e
commit
e89e5102f7
2 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
package info.nightscout.androidaps.plugins.general.autotune
|
package info.nightscout.androidaps.plugins.general.autotune
|
||||||
|
|
||||||
|
import android.graphics.Paint
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.Editable
|
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
|
@Synchronized
|
||||||
|
@ -265,7 +272,6 @@ class AutotuneFragment : DaggerFragment() {
|
||||||
updateGui()
|
updateGui()
|
||||||
}, { fabricPrivacy.logException(it) })
|
}, { fabricPrivacy.logException(it) })
|
||||||
checkNewDay()
|
checkNewDay()
|
||||||
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
|
|
||||||
updateGui()
|
updateGui()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,6 +284,7 @@ class AutotuneFragment : DaggerFragment() {
|
||||||
@Synchronized
|
@Synchronized
|
||||||
private fun updateGui() {
|
private fun updateGui() {
|
||||||
_binding ?: return
|
_binding ?: return
|
||||||
|
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
|
||||||
profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil)
|
profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil)
|
||||||
profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString()
|
profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString()
|
||||||
profileFunction.getProfile()?.let { currentProfile ->
|
profileFunction.getProfile()?.let { currentProfile ->
|
||||||
|
|
|
@ -140,7 +140,8 @@
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:paddingStart="5dp"
|
android:paddingStart="5dp"
|
||||||
android:paddingEnd="5dp"
|
android:paddingEnd="5dp"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp"
|
||||||
|
android:textColor="@color/colorCalculatorButton"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue