Merge remote-tracking branch 'Nightscout/dev' into IncreaseHeightUpperRows

This commit is contained in:
Philoul 2020-12-25 16:48:23 +01:00
commit 33e13748ca
27 changed files with 259 additions and 319 deletions

View file

@ -85,23 +85,11 @@ class TempTargetDialog : DialogFragmentWithDate() {
val adapterReason = ArrayAdapter(context, R.layout.spinner_centered, reasonList) val adapterReason = ArrayAdapter(context, R.layout.spinner_centered, reasonList)
overview_temptarget_reason.adapter = adapterReason overview_temptarget_reason.adapter = adapterReason
overview_temptarget_custom?.setOnClickListener {
overview_temptarget_temptarget.value = savedInstanceState?.getDouble("overview_temptarget_temptarget") ?: if (profileFunction.getUnits() == Constants.MMOL) Constants.MIN_TT_MMOL else Constants.MIN_TT_MGDL
overview_temptarget_duration.value = savedInstanceState?.getDouble("overview_temptarget_duration") ?: 0.0
overview_temptarget_reason.setSelection(reasonList.indexOf(resourceHelper.gs(R.string.manual)));
}
overview_temptarget_cancel?.setOnClickListener { shortClick(it) } overview_temptarget_cancel?.setOnClickListener { shortClick(it) }
overview_temptarget_eating_soon?.setOnClickListener { shortClick(it) } overview_temptarget_eating_soon?.setOnClickListener { shortClick(it) }
overview_temptarget_activity?.setOnClickListener { shortClick(it) } overview_temptarget_activity?.setOnClickListener { shortClick(it) }
overview_temptarget_hypo?.setOnClickListener { shortClick(it) } overview_temptarget_hypo?.setOnClickListener { shortClick(it) }
/*
overview_temptarget_cancel?.setOnLongClickListener {
longClick(it)
return@setOnLongClickListener true
}
*/
overview_temptarget_eating_soon?.setOnLongClickListener { overview_temptarget_eating_soon?.setOnLongClickListener {
longClick(it) longClick(it)
return@setOnLongClickListener true return@setOnLongClickListener true
@ -124,11 +112,6 @@ class TempTargetDialog : DialogFragmentWithDate() {
private fun longClick(v:View) { private fun longClick(v:View) {
when (v.id) { when (v.id) {
R.id.overview_temptarget_cancel -> {
overview_temptarget_temptarget.value = 0.0
overview_temptarget_duration.value = 0.0
overview_temptarget_reason.setSelection(reasonList.indexOf(resourceHelper.gs(R.string.cancel)))
}
R.id.overview_temptarget_eating_soon -> { R.id.overview_temptarget_eating_soon -> {
overview_temptarget_temptarget.value = defaultValueHelper.determineEatingSoonTT() overview_temptarget_temptarget.value = defaultValueHelper.determineEatingSoonTT()
overview_temptarget_duration.value = defaultValueHelper.determineEatingSoonTTDuration().toDouble() overview_temptarget_duration.value = defaultValueHelper.determineEatingSoonTTDuration().toDouble()

View file

@ -146,7 +146,7 @@ class WizardDialog : DaggerDialogFragment() {
treatments_wizard_bgtrendcheckbox.setOnCheckedChangeListener(::onCheckedChanged) treatments_wizard_bgtrendcheckbox.setOnCheckedChangeListener(::onCheckedChanged)
treatments_wizard_sbcheckbox.setOnCheckedChangeListener(::onCheckedChanged) treatments_wizard_sbcheckbox.setOnCheckedChangeListener(::onCheckedChanged)
val showCalc = sp.getBoolean(resourceHelper.gs(R.string.key_wizard_calculation_visible), false) val showCalc = sp.getBoolean(R.string.key_wizard_calculation_visible, false)
treatments_wizard_delimiter.visibility = showCalc.toVisibility() treatments_wizard_delimiter.visibility = showCalc.toVisibility()
treatments_wizard_resulttable.visibility = showCalc.toVisibility() treatments_wizard_resulttable.visibility = showCalc.toVisibility()
treatments_wizard_calculationcheckbox.isChecked = showCalc treatments_wizard_calculationcheckbox.isChecked = showCalc
@ -211,8 +211,8 @@ class WizardDialog : DaggerDialogFragment() {
} }
private fun loadCheckedStates() { private fun loadCheckedStates() {
treatments_wizard_bgtrendcheckbox.isChecked = sp.getBoolean(resourceHelper.gs(R.string.key_wizard_include_trend_bg), false) treatments_wizard_bgtrendcheckbox.isChecked = sp.getBoolean(R.string.key_wizard_include_trend_bg, false)
treatments_wizard_cobcheckbox.isChecked = sp.getBoolean(resourceHelper.gs(R.string.key_wizard_include_cob), false) treatments_wizard_cobcheckbox.isChecked = sp.getBoolean(R.string.key_wizard_include_cob, false)
} }
private fun initDialog() { private fun initDialog() {

View file

@ -267,8 +267,8 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("low_temptarget_lowers_sensitivity", false); mProfile.put("low_temptarget_lowers_sensitivity", false);
mProfile.put("sensitivity_raises_target", sp.getBoolean(resourceHelper.gs(R.string.key_sensitivity_raises_target),SMBDefaults.sensitivity_raises_target)); mProfile.put("sensitivity_raises_target", sp.getBoolean(R.string.key_sensitivity_raises_target,SMBDefaults.sensitivity_raises_target));
mProfile.put("resistance_lowers_target", sp.getBoolean(resourceHelper.gs(R.string.key_resistance_lowers_target),SMBDefaults.resistance_lowers_target)); mProfile.put("resistance_lowers_target", sp.getBoolean(R.string.key_resistance_lowers_target,SMBDefaults.resistance_lowers_target));
mProfile.put("adv_target_adjustments", SMBDefaults.adv_target_adjustments); mProfile.put("adv_target_adjustments", SMBDefaults.adv_target_adjustments);
mProfile.put("exercise_mode", SMBDefaults.exercise_mode); mProfile.put("exercise_mode", SMBDefaults.exercise_mode);
mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target); mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target);
@ -284,7 +284,7 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("enableUAM", uamAllowed); mProfile.put("enableUAM", uamAllowed);
mProfile.put("A52_risk_enable", SMBDefaults.A52_risk_enable); mProfile.put("A52_risk_enable", SMBDefaults.A52_risk_enable);
boolean smbEnabled = sp.getBoolean(resourceHelper.gs(R.string.key_use_smb), false); boolean smbEnabled = sp.getBoolean(R.string.key_use_smb, false);
mProfile.put("SMBInterval", sp.getInt(R.string.key_smbinterval, SMBDefaults.SMBInterval)); mProfile.put("SMBInterval", sp.getInt(R.string.key_smbinterval, SMBDefaults.SMBInterval));
mProfile.put("enableSMB_with_COB", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_COB, false)); mProfile.put("enableSMB_with_COB", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_COB, false));
mProfile.put("enableSMB_with_temptarget", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_temptarget, false)); mProfile.put("enableSMB_with_temptarget", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_temptarget, false));

View file

@ -123,7 +123,7 @@ class ImportExportPrefs @Inject constructor(
} }
private fun prefsEncryptionIsDisabled() = private fun prefsEncryptionIsDisabled() =
buildHelper.isEngineeringMode() && !sp.getBoolean(resourceHelper.gs(R.string.key_maintenance_encrypt_exported_prefs), true) buildHelper.isEngineeringMode() && !sp.getBoolean(R.string.key_maintenance_encrypt_exported_prefs, true)
private fun askForMasterPass(activity: FragmentActivity, @StringRes canceledMsg: Int, then: ((password: String) -> Unit)) { private fun askForMasterPass(activity: FragmentActivity, @StringRes canceledMsg: Int, then: ((password: String) -> Unit)) {
passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { password -> passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { password ->

View file

@ -31,11 +31,7 @@ import info.nightscout.androidaps.Config
import info.nightscout.androidaps.Constants import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.Profile import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.dialogs.CalibrationDialog import info.nightscout.androidaps.dialogs.*
import info.nightscout.androidaps.dialogs.CarbsDialog
import info.nightscout.androidaps.dialogs.InsulinDialog
import info.nightscout.androidaps.dialogs.TreatmentDialog
import info.nightscout.androidaps.dialogs.WizardDialog
import info.nightscout.androidaps.events.* import info.nightscout.androidaps.events.*
import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.AAPSLogger
@ -187,6 +183,12 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
overviewMenus.setupChartMenu(overview_chartMenuButton) overviewMenus.setupChartMenu(overview_chartMenuButton)
prepareGraphs() prepareGraphs()
overviewMenus.setupPopupMenu(overview_apsmode, requireContext(), childFragmentManager)
//overviewMenus.setupPopupMenu(overview_activeprofile, requireContext(), childFragmentManager)
overview_activeprofile?.setOnClickListener(this)
overview_activeprofile?.setOnLongClickListener(this)
overview_temptarget?.setOnClickListener(this)
overview_temptarget?.setOnLongClickListener(this)
overview_accepttempbutton?.setOnClickListener(this) overview_accepttempbutton?.setOnClickListener(this)
overview_treatmentbutton?.setOnClickListener(this) overview_treatmentbutton?.setOnClickListener(this)
overview_wizardbutton?.setOnClickListener(this) overview_wizardbutton?.setOnClickListener(this)
@ -196,15 +198,14 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
overview_carbsbutton?.setOnClickListener(this) overview_carbsbutton?.setOnClickListener(this)
overview_quickwizardbutton?.setOnClickListener(this) overview_quickwizardbutton?.setOnClickListener(this)
overview_quickwizardbutton?.setOnLongClickListener(this) overview_quickwizardbutton?.setOnLongClickListener(this)
overview_apsmode?.setOnLongClickListener(this)
overview_activeprofile?.setOnLongClickListener(this)
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
disposable.clear() disposable.clear()
loopHandler.removeCallbacksAndMessages(null) loopHandler.removeCallbacksAndMessages(null)
overview_apsmode_llayout?.let { unregisterForContextMenu(it) }
overview_activeprofile?.let { unregisterForContextMenu(it) }
overview_temptarget?.let { unregisterForContextMenu(it) }
} }
override fun onResume() { override fun onResume() {
@ -276,20 +277,9 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
} }
loopHandler.postDelayed(refreshLoop, 60 * 1000L) loopHandler.postDelayed(refreshLoop, 60 * 1000L)
overview_apsmode_llayout?.let { registerForContextMenu(overview_apsmode) }
overview_activeprofile?.let { registerForContextMenu(it) }
overview_temptarget?.let { registerForContextMenu(it) }
updateGUI("onResume") updateGUI("onResume")
} }
override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenuInfo?) {
super.onCreateContextMenu(menu, v, menuInfo)
overviewMenus.createContextMenu(menu, v)
}
override fun onContextItemSelected(item: MenuItem): Boolean {
return if (overviewMenus.onContextItemSelected(item, childFragmentManager)) true else super.onContextItemSelected(item)
}
override fun onClick(v: View) { override fun onClick(v: View) {
// try to fix https://fabric.io/nightscout3/android/apps/info.nightscout.androidaps/issues/5aca7a1536c7b23527eb4be7?time=last-seven-days // try to fix https://fabric.io/nightscout3/android/apps/info.nightscout.androidaps/issues/5aca7a1536c7b23527eb4be7?time=last-seven-days
@ -297,12 +287,20 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
if (childFragmentManager.isStateSaved) return if (childFragmentManager.isStateSaved) return
activity?.let { activity -> activity?.let { activity ->
when (v.id) { when (v.id) {
R.id.overview_treatmentbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { TreatmentDialog().show(childFragmentManager, "Overview") }) R.id.overview_treatmentbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { TreatmentDialog().show(childFragmentManager, "Overview") })
R.id.overview_wizardbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { WizardDialog().show(childFragmentManager, "Overview") }) R.id.overview_wizardbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { WizardDialog().show(childFragmentManager, "Overview") })
R.id.overview_insulinbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { InsulinDialog().show(childFragmentManager, "Overview") }) R.id.overview_insulinbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { InsulinDialog().show(childFragmentManager, "Overview") })
R.id.overview_quickwizardbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { onClickQuickWizard() }) R.id.overview_quickwizardbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { onClickQuickWizard() })
R.id.overview_carbsbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { CarbsDialog().show(childFragmentManager, "Overview") }) R.id.overview_carbsbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { CarbsDialog().show(childFragmentManager, "Overview") })
R.id.overview_temptarget -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { TempTargetDialog().show(childFragmentManager, "Overview") })
R.id.overview_activeprofile -> {
val args = Bundle()
args.putLong("time", DateUtil.now())
args.putInt("mode", ProfileViewerDialog.Mode.RUNNING_PROFILE.ordinal)
val pvd = ProfileViewerDialog()
pvd.arguments = args
pvd.show(childFragmentManager, "ProfileViewDialog")
}
R.id.overview_cgmbutton -> { R.id.overview_cgmbutton -> {
if (xdripPlugin.isEnabled(PluginType.BGSOURCE)) if (xdripPlugin.isEnabled(PluginType.BGSOURCE))
openCgmApp("com.eveningoutpost.dexdrip") openCgmApp("com.eveningoutpost.dexdrip")
@ -370,6 +368,13 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
startActivity(Intent(v.context, QuickWizardListActivity::class.java)) startActivity(Intent(v.context, QuickWizardListActivity::class.java))
return true return true
} }
R.id.overview_apsmode -> {
OverviewMenus.showOKCancel = false
v.performClick()
}
R.id.overview_temptarget -> v.performClick()
R.id.overview_activeprofile -> activity?.let { activity -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { ProfileSwitchDialog().show(childFragmentManager, "Overview") })}
} }
return false return false
} }

View file

@ -5,7 +5,6 @@ import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.SpannableString import android.text.SpannableString
import android.text.style.ForegroundColorSpan import android.text.style.ForegroundColorSpan
import android.view.ContextMenu
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
@ -38,6 +37,7 @@ import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.buildHelper.BuildHelper
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP import info.nightscout.androidaps.utils.sharedPreferences.SP
@ -75,6 +75,7 @@ class OverviewMenus @Inject constructor(
companion object { companion object {
const val MAX_GRAPHS = 5 // including main const val MAX_GRAPHS = 5 // including main
var showOKCancel = true
} }
fun enabledTypes(graph: Int): String { fun enabledTypes(graph: Int): String {
@ -175,65 +176,83 @@ class OverviewMenus @Inject constructor(
} }
} }
fun createContextMenu(menu: ContextMenu, v: View) { fun setupPopupMenu(v: View, context: Context, manager: FragmentManager) {
when (v.id) { v.setOnClickListener {
R.id.overview_apsmode -> { val popup = PopupMenu(v.context, v)
val pumpDescription: PumpDescription = activePlugin.activePump.pumpDescription when (v.id) {
if (!profileFunction.isProfileValid("ContextMenuCreation")) return R.id.overview_apsmode -> {
menu.setHeaderTitle(resourceHelper.gs(R.string.loop)) val pumpDescription: PumpDescription = activePlugin.activePump.pumpDescription
if (loopPlugin.isEnabled(PluginType.LOOP)) { if (profileFunction.isProfileValid("ContextMenuCreation")) {
menu.add(resourceHelper.gs(R.string.disableloop)) val item = popup.menu.add(Menu.NONE,1,Menu.NONE,resourceHelper.gs(R.string.loop)) // title
if (!loopPlugin.isSuspended) { val title = item.title
menu.add(resourceHelper.gs(R.string.suspendloopfor1h)) val s = SpannableString(title)
menu.add(resourceHelper.gs(R.string.suspendloopfor2h)) s.setSpan( ForegroundColorSpan(resourceHelper.gc(R.color.colorAccent)), 0, s.length, 0)
menu.add(resourceHelper.gs(R.string.suspendloopfor3h)) item.setTitle(s)
menu.add(resourceHelper.gs(R.string.suspendloopfor10h)) if (loopPlugin.isEnabled(PluginType.LOOP)) {
} else { popup.menu.add(resourceHelper.gs(R.string.disableloop))
if (!loopPlugin.isSuspended) {
popup.menu.add(resourceHelper.gs(R.string.suspendloopfor1h))
popup.menu.add(resourceHelper.gs(R.string.suspendloopfor2h))
popup.menu.add(resourceHelper.gs(R.string.suspendloopfor3h))
popup.menu.add(resourceHelper.gs(R.string.suspendloopfor10h))
} else {
if (!loopPlugin.isDisconnected) {
popup.menu.add(resourceHelper.gs(R.string.resume))
}
}
}
if (!loopPlugin.isEnabled(PluginType.LOOP)) {
popup.menu.add(resourceHelper.gs(R.string.enableloop))
}
if (!loopPlugin.isDisconnected) { if (!loopPlugin.isDisconnected) {
menu.add(resourceHelper.gs(R.string.resume)) if (pumpDescription.tempDurationStep15mAllowed) popup.menu.add(resourceHelper.gs(R.string.disconnectpumpfor15m))
if (pumpDescription.tempDurationStep30mAllowed) popup.menu.add(resourceHelper.gs(R.string.disconnectpumpfor30m))
popup.menu.add(resourceHelper.gs(R.string.disconnectpumpfor1h))
popup.menu.add(resourceHelper.gs(R.string.disconnectpumpfor2h))
popup.menu.add(resourceHelper.gs(R.string.disconnectpumpfor3h))
} else {
popup.menu.add(resourceHelper.gs(R.string.reconnect))
} }
} }
} }
if (!loopPlugin.isEnabled(PluginType.LOOP)) { R.id.overview_activeprofile -> {
menu.add(resourceHelper.gs(R.string.enableloop)) val item = popup.menu.add(Menu.NONE,1,Menu.NONE,resourceHelper.gs(R.string.profile)) // title
} val title = item.title
if (!loopPlugin.isDisconnected) { val s = SpannableString(title)
showSuspendPump(menu, pumpDescription) s.setSpan(ForegroundColorSpan(resourceHelper.gc(R.color.colorAccent)), 0, s.length, 0)
} else { item.setTitle(s)
menu.add(resourceHelper.gs(R.string.reconnect)) popup.menu.add(resourceHelper.gs(R.string.viewprofile))
if (activePlugin.activeProfileInterface.profile != null) {
popup.menu.add(resourceHelper.gs(R.string.careportal_profileswitch))
}
} }
} }
popup.setOnMenuItemClickListener {
if (it.itemId != 1) {
if (showOKCancel) {
when (it.title) {
resourceHelper.gs(R.string.careportal_profileswitch),
resourceHelper.gs(R.string.viewprofile) -> onItemSelected(it, manager)
R.id.overview_activeprofile -> { else -> {
menu.setHeaderTitle(resourceHelper.gs(R.string.profile)) OKDialog.showConfirmation(context, resourceHelper.gs(R.string.confirm), it.title.toString(),
menu.add(resourceHelper.gs(R.string.viewprofile)) Runnable {
if (activePlugin.activeProfileInterface.profile != null) { onItemSelected(it, manager)
menu.add(resourceHelper.gs(R.string.careportal_profileswitch)) })
} }
} }
} else {
R.id.overview_temptarget -> { onItemSelected(it, manager)
menu.setHeaderTitle(resourceHelper.gs(R.string.careportal_temporarytarget)) }
menu.add(resourceHelper.gs(R.string.custom))
menu.add(resourceHelper.gs(R.string.eatingsoon))
menu.add(resourceHelper.gs(R.string.activity))
menu.add(resourceHelper.gs(R.string.hypo))
if (activePlugin.activeTreatments.tempTargetFromHistory != null) {
menu.add(resourceHelper.gs(R.string.cancel))
} }
return@setOnMenuItemClickListener true
} }
popup.setOnDismissListener { showOKCancel = true }
popup.show()
} }
} }
private fun showSuspendPump(menu: ContextMenu, pumpDescription: PumpDescription) { fun onItemSelected(item: MenuItem, manager: FragmentManager): Boolean {
if (pumpDescription.tempDurationStep15mAllowed) menu.add(resourceHelper.gs(R.string.disconnectpumpfor15m))
if (pumpDescription.tempDurationStep30mAllowed) menu.add(resourceHelper.gs(R.string.disconnectpumpfor30m))
menu.add(resourceHelper.gs(R.string.disconnectpumpfor1h))
menu.add(resourceHelper.gs(R.string.disconnectpumpfor2h))
menu.add(resourceHelper.gs(R.string.disconnectpumpfor3h))
}
fun onContextItemSelected(item: MenuItem, manager: FragmentManager): Boolean {
val profile = profileFunction.getProfile() ?: return true val profile = profileFunction.getProfile() ?: return true
when (item.title) { when (item.title) {
resourceHelper.gs(R.string.disableloop) -> { resourceHelper.gs(R.string.disableloop) -> {
@ -360,60 +379,6 @@ class OverviewMenus @Inject constructor(
pvd.arguments = args pvd.arguments = args
pvd.show(manager, "ProfileViewDialog") pvd.show(manager, "ProfileViewDialog")
} }
resourceHelper.gs(R.string.eatingsoon) -> {
aapsLogger.debug("USER ENTRY: TEMP TARGET EATING SOON")
val target = Profile.toMgdl(defaultValueHelper.determineEatingSoonTT(), profileFunction.getUnits())
val tempTarget = TempTarget()
.date(System.currentTimeMillis())
.duration(defaultValueHelper.determineEatingSoonTTDuration())
.reason(resourceHelper.gs(R.string.eatingsoon))
.source(Source.USER)
.low(target)
.high(target)
activePlugin.activeTreatments.addToHistoryTempTarget(tempTarget)
}
resourceHelper.gs(R.string.activity) -> {
aapsLogger.debug("USER ENTRY: TEMP TARGET ACTIVITY")
val target = Profile.toMgdl(defaultValueHelper.determineActivityTT(), profileFunction.getUnits())
val tempTarget = TempTarget()
.date(DateUtil.now())
.duration(defaultValueHelper.determineActivityTTDuration())
.reason(resourceHelper.gs(R.string.activity))
.source(Source.USER)
.low(target)
.high(target)
activePlugin.activeTreatments.addToHistoryTempTarget(tempTarget)
}
resourceHelper.gs(R.string.hypo) -> {
aapsLogger.debug("USER ENTRY: TEMP TARGET HYPO")
val target = Profile.toMgdl(defaultValueHelper.determineHypoTT(), profileFunction.getUnits())
val tempTarget = TempTarget()
.date(DateUtil.now())
.duration(defaultValueHelper.determineHypoTTDuration())
.reason(resourceHelper.gs(R.string.hypo))
.source(Source.USER)
.low(target)
.high(target)
activePlugin.activeTreatments.addToHistoryTempTarget(tempTarget)
}
resourceHelper.gs(R.string.custom) -> {
TempTargetDialog().show(manager, "Overview")
}
resourceHelper.gs(R.string.cancel) -> {
aapsLogger.debug("USER ENTRY: TEMP TARGET CANCEL")
val tempTarget = TempTarget()
.source(Source.USER)
.date(DateUtil.now())
.duration(0)
.low(0.0)
.high(0.0)
activePlugin.activeTreatments.addToHistoryTempTarget(tempTarget)
}
} }
return false return false
} }

View file

@ -77,7 +77,7 @@ class KeepAliveReceiver : DaggerBroadcastReceiver() {
aapsLogger.debug(LTag.CORE, "KeepAlive scheduled") aapsLogger.debug(LTag.CORE, "KeepAlive scheduled")
SystemClock.sleep(5000) // wait for app initialization SystemClock.sleep(5000) // wait for app initialization
localAlertUtils.shortenSnoozeInterval() localAlertUtils.shortenSnoozeInterval()
localAlertUtils.presnoozeAlarms() localAlertUtils.preSnoozeAlarms()
val am = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager val am = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
val i = Intent(context, KeepAliveReceiver::class.java) val i = Intent(context, KeepAliveReceiver::class.java)
val pi = PendingIntent.getBroadcast(context, 0, i, 0) val pi = PendingIntent.getBroadcast(context, 0, i, 0)

View file

@ -5,19 +5,21 @@ import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.db.BgReading import info.nightscout.androidaps.db.BgReading
import info.nightscout.androidaps.interfaces.ActivePluginProvider import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
import info.nightscout.androidaps.plugins.general.smsCommunicator.SmsCommunicatorPlugin
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP import info.nightscout.androidaps.utils.sharedPreferences.SP
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
import kotlin.math.min
/** /**
* Created by adrian on 17/12/17. * Created by adrian on 17/12/17.
@ -31,48 +33,49 @@ class LocalAlertUtils @Inject constructor(
private val activePlugin: ActivePluginProvider, private val activePlugin: ActivePluginProvider,
private val profileFunction: ProfileFunction, private val profileFunction: ProfileFunction,
private val iobCobCalculatorPlugin: IobCobCalculatorPlugin, private val iobCobCalculatorPlugin: IobCobCalculatorPlugin,
private val smsCommunicatorPlugin: SmsCommunicatorPlugin,
private val config: Config, private val config: Config,
private val nsUpload: NSUpload, private val nsUpload: NSUpload,
private val dateUtil: DateUtil private val dateUtil: DateUtil
) { ) {
fun missedReadingsThreshold(): Long { private fun missedReadingsThreshold(): Long {
return T.mins(sp.getInt(resourceHelper.gs(R.string.key_missed_bg_readings_threshold_minutes), Constants.DEFAULT_MISSED_BG_READINGS_THRESHOLD_MINUTES).toLong()).msecs() return T.mins(sp.getInt(R.string.key_missed_bg_readings_threshold_minutes, Constants.DEFAULT_MISSED_BG_READINGS_THRESHOLD_MINUTES).toLong()).msecs()
} }
fun pumpUnreachableThreshold(): Long { private fun pumpUnreachableThreshold(): Long {
return T.mins(sp.getInt(resourceHelper.gs(R.string.key_pump_unreachable_threshold_minutes), Constants.DEFAULT_PUMP_UNREACHABLE_THRESHOLD_MINUTES).toLong()).msecs() return T.mins(sp.getInt(R.string.key_pump_unreachable_threshold_minutes, Constants.DEFAULT_PUMP_UNREACHABLE_THRESHOLD_MINUTES).toLong()).msecs()
} }
fun checkPumpUnreachableAlarm(lastConnection: Long, isStatusOutdated: Boolean, isDisconnected: Boolean) { fun checkPumpUnreachableAlarm(lastConnection: Long, isStatusOutdated: Boolean, isDisconnected: Boolean) {
val alarmTimeoutExpired = isAlarmTimeoutExpired(lastConnection, pumpUnreachableThreshold()) val alarmTimeoutExpired = isAlarmTimeoutExpired(lastConnection, pumpUnreachableThreshold())
val nextAlarmOccurrenceReached = sp.getLong("nextPumpDisconnectedAlarm", 0L) < System.currentTimeMillis() val nextAlarmOccurrenceReached = sp.getLong("nextPumpDisconnectedAlarm", 0L) < System.currentTimeMillis()
if (config.APS && sp.getBoolean(resourceHelper.gs(R.string.key_enable_pump_unreachable_alert), true) if (config.APS && isStatusOutdated && alarmTimeoutExpired && nextAlarmOccurrenceReached && !isDisconnected) {
&& isStatusOutdated && alarmTimeoutExpired && nextAlarmOccurrenceReached && !isDisconnected) { if (sp.getBoolean(R.string.key_enable_pump_unreachable_alert, true)) {
aapsLogger.debug(LTag.CORE, "Generating pump unreachable alarm. lastConnection: " + dateUtil.dateAndTimeString(lastConnection) + " isStatusOutdated: " + isStatusOutdated) aapsLogger.debug(LTag.CORE, "Generating pump unreachable alarm. lastConnection: " + dateUtil.dateAndTimeString(lastConnection) + " isStatusOutdated: " + isStatusOutdated)
val n = Notification(Notification.PUMP_UNREACHABLE, resourceHelper.gs(R.string.pump_unreachable), Notification.URGENT) sp.putLong("nextPumpDisconnectedAlarm", System.currentTimeMillis() + pumpUnreachableThreshold())
n.soundId = R.raw.alarm rxBus.send(EventNewNotification(Notification(Notification.PUMP_UNREACHABLE, resourceHelper.gs(R.string.pump_unreachable), Notification.URGENT).also { it.soundId - R.raw.alarm }))
sp.putLong("nextPumpDisconnectedAlarm", System.currentTimeMillis() + pumpUnreachableThreshold()) if (sp.getBoolean(R.string.key_ns_create_announcements_from_errors, true))
rxBus.send(EventNewNotification(n)) nsUpload.uploadError(resourceHelper.gs(R.string.pump_unreachable))
if (sp.getBoolean(R.string.key_ns_create_announcements_from_errors, true)) {
nsUpload.uploadError(n.text)
} }
if (sp.getBoolean(R.string.key_smscommunicator_report_pump_ureachable, true))
smsCommunicatorPlugin.sendNotificationToAllNumbers(resourceHelper.gs(R.string.pump_unreachable))
} }
if (!isStatusOutdated && !alarmTimeoutExpired) rxBus.send(EventDismissNotification(Notification.PUMP_UNREACHABLE)) if (!isStatusOutdated && !alarmTimeoutExpired) rxBus.send(EventDismissNotification(Notification.PUMP_UNREACHABLE))
} }
private fun isAlarmTimeoutExpired(lastConnection: Long, unreachableThreshold: Long): Boolean { private fun isAlarmTimeoutExpired(lastConnection: Long, unreachableThreshold: Long): Boolean {
if (activePlugin.activePump.pumpDescription.hasCustomUnreachableAlertCheck) { return if (activePlugin.activePump.pumpDescription.hasCustomUnreachableAlertCheck) {
return activePlugin.activePump.isUnreachableAlertTimeoutExceeded(unreachableThreshold) activePlugin.activePump.isUnreachableAlertTimeoutExceeded(unreachableThreshold)
} else { } else {
return lastConnection + pumpUnreachableThreshold() < System.currentTimeMillis() lastConnection + pumpUnreachableThreshold() < System.currentTimeMillis()
} }
} }
/*Presnoozes the alarms with 5 minutes if no snooze exists. /*Pre-snoozes the alarms with 5 minutes if no snooze exists.
* Call only at startup! * Call only at startup!
*/ */
fun presnoozeAlarms() { fun preSnoozeAlarms() {
if (sp.getLong("nextMissedReadingsAlarm", 0L) < System.currentTimeMillis()) { if (sp.getLong("nextMissedReadingsAlarm", 0L) < System.currentTimeMillis()) {
sp.putLong("nextMissedReadingsAlarm", System.currentTimeMillis() + 5 * 60 * 1000) sp.putLong("nextMissedReadingsAlarm", System.currentTimeMillis() + 5 * 60 * 1000)
} }
@ -83,10 +86,10 @@ class LocalAlertUtils @Inject constructor(
fun shortenSnoozeInterval() { //shortens alarm times in case of setting changes or future data fun shortenSnoozeInterval() { //shortens alarm times in case of setting changes or future data
var nextMissedReadingsAlarm = sp.getLong("nextMissedReadingsAlarm", 0L) var nextMissedReadingsAlarm = sp.getLong("nextMissedReadingsAlarm", 0L)
nextMissedReadingsAlarm = Math.min(System.currentTimeMillis() + missedReadingsThreshold(), nextMissedReadingsAlarm) nextMissedReadingsAlarm = min(System.currentTimeMillis() + missedReadingsThreshold(), nextMissedReadingsAlarm)
sp.putLong("nextMissedReadingsAlarm", nextMissedReadingsAlarm) sp.putLong("nextMissedReadingsAlarm", nextMissedReadingsAlarm)
var nextPumpDisconnectedAlarm = sp.getLong("nextPumpDisconnectedAlarm", 0L) var nextPumpDisconnectedAlarm = sp.getLong("nextPumpDisconnectedAlarm", 0L)
nextPumpDisconnectedAlarm = Math.min(System.currentTimeMillis() + pumpUnreachableThreshold(), nextPumpDisconnectedAlarm) nextPumpDisconnectedAlarm = min(System.currentTimeMillis() + pumpUnreachableThreshold(), nextPumpDisconnectedAlarm)
sp.putLong("nextPumpDisconnectedAlarm", nextPumpDisconnectedAlarm) sp.putLong("nextPumpDisconnectedAlarm", nextPumpDisconnectedAlarm)
} }
@ -104,7 +107,7 @@ class LocalAlertUtils @Inject constructor(
fun checkStaleBGAlert() { fun checkStaleBGAlert() {
val bgReading: BgReading? = iobCobCalculatorPlugin.lastBg() val bgReading: BgReading? = iobCobCalculatorPlugin.lastBg()
if (sp.getBoolean(resourceHelper.gs(R.string.key_enable_missed_bg_readings_alert), false) if (sp.getBoolean(R.string.key_enable_missed_bg_readings_alert, false)
&& bgReading != null && bgReading.date + missedReadingsThreshold() < System.currentTimeMillis() && sp.getLong("nextMissedReadingsAlarm", 0L) < System.currentTimeMillis()) { && bgReading != null && bgReading.date + missedReadingsThreshold() < System.currentTimeMillis() && sp.getLong("nextMissedReadingsAlarm", 0L) < System.currentTimeMillis()) {
val n = Notification(Notification.BG_READINGS_MISSED, resourceHelper.gs(R.string.missed_bg_readings), Notification.URGENT) val n = Notification(Notification.BG_READINGS_MISSED, resourceHelper.gs(R.string.missed_bg_readings), Notification.URGENT)
n.soundId = R.raw.alarm n.soundId = R.raw.alarm

View file

@ -12,9 +12,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/profilehelper_compareprofile" android:id="@+id/profilehelper_compareprofile"
style="@style/ButtonMediumFontStyle" style="?android:attr/buttonStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_compare_profiles" android:drawableStart="@drawable/ic_compare_profiles"
@ -50,8 +50,8 @@
</LinearLayout> </LinearLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:id="@+id/profilehelper_profiletype_title" android:id="@+id/profilehelper_profiletype_title"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/profiletype" android:hint="@string/profiletype"
@ -173,11 +173,11 @@
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:textAppearance="@style/TextAppearance.AppCompat.Small" /> android:textAppearance="@style/TextAppearance.AppCompat.Small" />
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/profilehelper_copytolocalprofile" android:id="@+id/profilehelper_copytolocalprofile"
style="@style/ButtonMediumFontStyle" style="?android:attr/buttonStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_clone_48" android:drawableStart="@drawable/ic_clone_48"
android:text="@string/clone_label" /> android:text="@string/clone_label" />

View file

@ -142,27 +142,12 @@
</LinearLayout> </LinearLayout>
<include layout="@layout/datetime" /> <include layout="@layout/datetime" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/overview_temptarget_custom"
style="?android:attr/buttonStyle"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_marginEnd="-4dp"
android:layout_weight="0.5"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:drawableTop="@drawable/ic_target_manual"
android:text="@string/manual"
android:textColor="@color/tempTargetConfirmation"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:visibility="gone"
android:textSize="11sp" />
<info.nightscout.androidaps.utils.ui.SingleClickButton <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/overview_temptarget_cancel" android:id="@+id/overview_temptarget_cancel"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"

View file

@ -1415,5 +1415,8 @@
<string name="copytolocalprofile_invalid">Unable to create local profile. Profile is invalid.</string> <string name="copytolocalprofile_invalid">Unable to create local profile. Profile is invalid.</string>
<string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string> <string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string>
<string name="alarm">Alarm</string> <string name="alarm">Alarm</string>
<string name="key_smscommunicator_report_pump_ureachable" translatable="false">smscommunicator_report_pump_ureachable</string>
<string name="smscommunicator_report_pump_ureachable_summary">Send SMS if unreachable pump event is triggered</string>
<string name="smscommunicator_pump_ureachable">Report pump ureachable</string>
</resources> </resources>

View file

@ -52,5 +52,5 @@
<item name="android:textColor">#ff0000</item> <item name="android:textColor">#ff0000</item>
</style> </style>
<style name="ProfileHelperAppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar"/> <style name="ProfileHelperAppTheme" parent="Theme.MaterialComponents.NoActionBar"/>
</resources> </resources>

View file

@ -49,6 +49,12 @@
<intent android:action="info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity" /> <intent android:action="info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity" />
</Preference> </Preference>
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_smscommunicator_report_pump_ureachable"
android:summary="@string/smscommunicator_report_pump_ureachable_summary"
android:title="@string/smscommunicator_pump_ureachable" />
</PreferenceCategory> </PreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>

View file

@ -184,7 +184,7 @@ public abstract class AbstractDanaRExecutionService extends DaggerService {
} }
protected void getBTSocketForSelectedPump() { protected void getBTSocketForSelectedPump() {
mDevName = sp.getString(resourceHelper.gs(R.string.key_danar_bt_name), ""); mDevName = sp.getString(R.string.key_danar_bt_name, "");
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter != null) { if (bluetoothAdapter != null) {

View file

@ -180,7 +180,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
} }
public boolean verifyConfiguration() { public boolean verifyConfiguration(boolean forceRileyLinkAddressRenewal) {
try { try {
String regexSN = "[0-9]{6}"; String regexSN = "[0-9]{6}";
String regexMac = "([\\da-fA-F]{1,2}(?:\\:|$)){6}"; String regexMac = "([\\da-fA-F]{1,2}(?:\\:|$)){6}";
@ -316,7 +316,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
//boolean bolusDebug = bolusDebugEnabled != null && bolusDebugEnabled.equals(resourceHelper.gs(R.string.common_on)); //boolean bolusDebug = bolusDebugEnabled != null && bolusDebugEnabled.equals(resourceHelper.gs(R.string.common_on));
//MedtronicHistoryData.doubleBolusDebug = bolusDebug; //MedtronicHistoryData.doubleBolusDebug = bolusDebug;
reconfigureService(); reconfigureService(forceRileyLinkAddressRenewal);
return true; return true;
@ -327,7 +327,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
} }
} }
private boolean reconfigureService() { private boolean reconfigureService(boolean forceRileyLinkAddressRenewal) {
if (!inPreInit) { if (!inPreInit) {
@ -336,7 +336,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
serialChanged = false; serialChanged = false;
} }
if (rileyLinkAddressChanged) { if (rileyLinkAddressChanged || forceRileyLinkAddressRenewal) {
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this); rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
rileyLinkAddressChanged = false; rileyLinkAddressChanged = false;
} }
@ -380,6 +380,6 @@ public class RileyLinkMedtronicService extends RileyLinkService {
public boolean setNotInPreInit() { public boolean setNotInPreInit() {
this.inPreInit = false; this.inPreInit = false;
return reconfigureService(); return reconfigureService(false);
} }
} }

View file

@ -109,7 +109,7 @@ public class RileyLinkOmnipodService extends RileyLinkService {
} }
@Override @Override
public boolean verifyConfiguration() { public boolean verifyConfiguration(boolean forceRileyLinkAddressRenewal) {
try { try {
errorDescription = null; errorDescription = null;
@ -133,7 +133,7 @@ public class RileyLinkOmnipodService extends RileyLinkService {
rileyLinkServiceData.rileyLinkTargetFrequency = RileyLinkTargetFrequency.Omnipod; rileyLinkServiceData.rileyLinkTargetFrequency = RileyLinkTargetFrequency.Omnipod;
reconfigureService(); reconfigureService(forceRileyLinkAddressRenewal);
return true; return true;
@ -144,9 +144,9 @@ public class RileyLinkOmnipodService extends RileyLinkService {
} }
} }
private boolean reconfigureService() { private boolean reconfigureService(boolean forceRileyLinkAddressRenewal) {
if (!inPreInit) { if (!inPreInit) {
if (rileyLinkAddressChanged) { if (rileyLinkAddressChanged || forceRileyLinkAddressRenewal) {
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this); rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
rileyLinkAddressChanged = false; rileyLinkAddressChanged = false;
} }
@ -158,6 +158,6 @@ public class RileyLinkOmnipodService extends RileyLinkService {
public boolean setNotInPreInit() { public boolean setNotInPreInit() {
this.inPreInit = false; this.inPreInit = false;
return reconfigureService(); return reconfigureService(false);
} }
} }

View file

@ -596,7 +596,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
// FIXME ideally we should just have access to LocalAlertUtils here // FIXME ideally we should just have access to LocalAlertUtils here
private fun getPumpUnreachableTimeout(): Duration { private fun getPumpUnreachableTimeout(): Duration {
return Duration.standardMinutes(sp.getInt(resourceHelper.gs(R.string.key_pump_unreachable_threshold_minutes), Constants.DEFAULT_PUMP_UNREACHABLE_THRESHOLD_MINUTES).toLong()) return Duration.standardMinutes(sp.getInt(R.string.key_pump_unreachable_threshold_minutes, Constants.DEFAULT_PUMP_UNREACHABLE_THRESHOLD_MINUTES).toLong())
} }
inner class DisplayResultDialogCallback(private val errorMessagePrefix: String, private val withSoundOnError: Boolean) : Callback() { inner class DisplayResultDialogCallback(private val errorMessagePrefix: String, private val withSoundOnError: Boolean) : Callback() {

View file

@ -79,6 +79,8 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
private String actionTitleStart, actionTitleStop; private String actionTitleStart, actionTitleStop;
private MenuItem menuItem; private MenuItem menuItem;
private boolean rlDisconnected;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -106,7 +108,7 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
sp.putString(RileyLinkConst.Prefs.RileyLinkAddress, bleAddress); sp.putString(RileyLinkConst.Prefs.RileyLinkAddress, bleAddress);
RileyLinkPumpDevice rileyLinkPump = (RileyLinkPumpDevice) activePlugin.getActivePump(); RileyLinkPumpDevice rileyLinkPump = (RileyLinkPumpDevice) activePlugin.getActivePump();
rileyLinkPump.getRileyLinkService().verifyConfiguration(); // force reloading of address rileyLinkPump.getRileyLinkService().verifyConfiguration(true); // force reloading of address to assure that the RL gets reconnected (even if the address didn't change)
rileyLinkPump.triggerPumpConfigurationChangedEvent(); rileyLinkPump.triggerPumpConfigurationChangedEvent();
finish(); finish();
@ -115,10 +117,12 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
toolbarBTScan = findViewById(R.id.rileylink_toolbarBTScan); toolbarBTScan = findViewById(R.id.rileylink_toolbarBTScan);
toolbarBTScan.setTitle(R.string.rileylink_scanner_title); toolbarBTScan.setTitle(R.string.rileylink_scanner_title);
setSupportActionBar(toolbarBTScan); setSupportActionBar(toolbarBTScan);
prepareForScanning();
} }
@Override protected void onResume() {
super.onResume();
prepareForScanning();
}
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
@ -138,6 +142,10 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
if (item.getTitle().equals(actionTitleStart)) { if (item.getTitle().equals(actionTitleStart)) {
// disable currently selected RL, so that we can discover it
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnect, this);
rlDisconnected = true;
scanLeDevice(true); scanLeDevice(true);
return true; return true;
} else if (item.getTitle().equals(actionTitleStop)) { } else if (item.getTitle().equals(actionTitleStop)) {
@ -148,8 +156,21 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
} }
} }
@Override public void onBackPressed() {
super.onBackPressed();
if (rlDisconnected) {
// Reconnect RL if it was disconnected for the scan
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
}
}
public void prepareForScanning() { @Override protected void onDestroy() {
super.onDestroy();
mScanning = false;
mLEScanner.stopScan(mScanCallback2);
}
private void prepareForScanning() {
boolean checkOK = blePrecheck.prerequisitesCheck(this); boolean checkOK = blePrecheck.prerequisitesCheck(this);
if (checkOK) { if (checkOK) {
@ -158,9 +179,6 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
filters = Collections.singletonList(new ScanFilter.Builder().setServiceUuid( filters = Collections.singletonList(new ScanFilter.Builder().setServiceUuid(
ParcelUuid.fromString(GattAttributes.SERVICE_RADIO)).build()); ParcelUuid.fromString(GattAttributes.SERVICE_RADIO)).build());
} }
// disable currently selected RL, so that we can discover it
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnect, this);
} }

View file

@ -112,7 +112,6 @@ public class RFSpy {
reader.newDataIsAvailable(); reader.newDataIsAvailable();
} }
public Integer getBatteryLevel() { public Integer getBatteryLevel() {
BLECommOperationResult result = rileyLinkBle.readCharacteristic_blocking(batteryServiceUUID, batteryLevelUUID); BLECommOperationResult result = rileyLinkBle.readCharacteristic_blocking(batteryServiceUUID, batteryLevelUUID);
if (result.resultCode == BLECommOperationResult.RESULT_SUCCESS) { if (result.resultCode == BLECommOperationResult.RESULT_SUCCESS) {

View file

@ -151,8 +151,8 @@ public class RileyLinkBLE {
} else if ((newState == BluetoothProfile.STATE_CONNECTING) || // } else if ((newState == BluetoothProfile.STATE_CONNECTING) || //
(newState == BluetoothProfile.STATE_DISCONNECTING)) { (newState == BluetoothProfile.STATE_DISCONNECTING)) {
aapsLogger.debug(LTag.PUMPBTCOMM,"We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" : aapsLogger.debug(LTag.PUMPBTCOMM, "We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" :
"Disconnecting"); "Disconnecting");
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) { } else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnected, context); rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnected, context);
if (manualDisconnect) if (manualDisconnect)
@ -392,6 +392,9 @@ public class RileyLinkBLE {
if (gattDebugEnabled) { if (gattDebugEnabled) {
aapsLogger.debug(LTag.PUMPBTCOMM, "Gatt Connected."); aapsLogger.debug(LTag.PUMPBTCOMM, "Gatt Connected.");
} }
rileyLinkServiceData.rileylinkAddress = bluetoothConnectionGatt.getDevice().getAddress();
rileyLinkServiceData.rileyLinkName = bluetoothConnectionGatt.getDevice().getName();
} }
} }

View file

@ -16,7 +16,6 @@ import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.activities.NoSplashAppCompatActivity;
import info.nightscout.androidaps.plugins.pump.common.R; import info.nightscout.androidaps.plugins.pump.common.R;
import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface; import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface;
@ -66,50 +65,14 @@ public class RileyLinkStatusActivity extends NoSplashAppCompatActivity {
RefreshableInterface selectableInterface = (RefreshableInterface) mSectionsPagerAdapter RefreshableInterface selectableInterface = (RefreshableInterface) mSectionsPagerAdapter
.getItem(tabLayout.getSelectedTabPosition()); .getItem(tabLayout.getSelectedTabPosition());
selectableInterface.refreshData(); selectableInterface.refreshData();
// refreshData(tabLayout.getSelectedTabPosition());
// Toast.makeText(getApplicationContext(), "Test pos: " + tabLayout.getSelectedTabPosition(),
// Toast.LENGTH_LONG);
}); });
this.connectionStatus = findViewById(R.id.rls_t1_connection_status); this.connectionStatus = findViewById(R.id.rls_t1_connection_status);
this.configuredAddress = findViewById(R.id.rls_t1_configured_address); this.configuredAddress = findViewById(R.id.rls_t1_configured_address);
this.connectedDevice = findViewById(R.id.rls_t1_connected_device); this.connectedDevice = findViewById(R.id.rls_t1_connected_device);
this.connectionError = findViewById(R.id.rls_t1_connection_error); this.connectionError = findViewById(R.id.rls_t1_connection_error);
// // 7-12
// int[] ids = {R.id.rls_t1_tv02, R.id.rls_t1_tv03, R.id.rls_t1_tv04, R.id.rls_t1_tv05, R.id.rls_t1_tv07, //
// R.id.rls_t1_tv08, R.id.rls_t1_tv09, R.id.rls_t1_tv10, R.id.rls_t1_tv11, R.id.rls_t1_tv12};
//
// for (int id : ids) {
//
// TextView tv = (TextView) findViewById(id);
// tv.setText(tv.getText() + ":");
// }
// refreshData(0);
// refreshData(1);
} }
public void refreshData(int position) {
if (position == 0) {
// FIXME i18n
this.connectionStatus.setText(rileyLinkServiceData.rileyLinkServiceState.name());
this.configuredAddress.setText(rileyLinkServiceData.rileylinkAddress);
// FIXME
this.connectedDevice.setText("???");
// FIXME i18n
this.connectionError.setText(rileyLinkServiceData.rileyLinkError.name());
} else {
}
}
public void setupViewPager(ViewPager pager) { public void setupViewPager(ViewPager pager) {
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

View file

@ -6,6 +6,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.LocalDateTime; import org.joda.time.LocalDateTime;
import java.util.Locale; import java.util.Locale;
@ -31,40 +32,39 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper;
public class RileyLinkStatusGeneralFragment extends DaggerFragment implements RefreshableInterface { public class RileyLinkStatusGeneralFragment extends DaggerFragment implements RefreshableInterface {
private static final String PLACEHOLDER = "-";
@Inject ActivePluginProvider activePlugin; @Inject ActivePluginProvider activePlugin;
@Inject ResourceHelper resourceHelper; @Inject ResourceHelper resourceHelper;
@Inject AAPSLogger aapsLogger; @Inject AAPSLogger aapsLogger;
@Inject RileyLinkServiceData rileyLinkServiceData; @Inject RileyLinkServiceData rileyLinkServiceData;
@Inject DateUtil dateUtil; @Inject DateUtil dateUtil;
TextView connectionStatus; private TextView connectionStatus;
TextView configuredAddress; private TextView configuredAddress;
TextView connectedDevice; private TextView connectedRileyLinkName;
TextView connectionError; private TextView connectedDevice;
TextView deviceType; private TextView connectionError;
TextView deviceModel; private TextView deviceType;
TextView serialNumber; private TextView deviceModel;
TextView pumpFrequency; private TextView serialNumber;
TextView lastUsedFrequency; private TextView pumpFrequency;
TextView lastDeviceContact; private TextView lastUsedFrequency;
TextView firmwareVersion; private TextView lastDeviceContact;
private TextView firmwareVersion;
boolean first = false;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.rileylink_status_general, container, false); return inflater.inflate(R.layout.rileylink_status_general, container, false);
return rootView;
} }
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
this.connectionStatus = getActivity().findViewById(R.id.rls_t1_connection_status); this.connectionStatus = getActivity().findViewById(R.id.rls_t1_connection_status);
this.configuredAddress = getActivity().findViewById(R.id.rls_t1_configured_address); this.configuredAddress = getActivity().findViewById(R.id.rls_t1_configured_address);
this.connectedRileyLinkName = getActivity().findViewById(R.id.rls_t1_connected_riley_link_name);
this.connectedDevice = getActivity().findViewById(R.id.rls_t1_connected_device); this.connectedDevice = getActivity().findViewById(R.id.rls_t1_connected_device);
this.connectionError = getActivity().findViewById(R.id.rls_t1_connection_error); this.connectionError = getActivity().findViewById(R.id.rls_t1_connection_error);
this.deviceType = getActivity().findViewById(R.id.rls_t1_device_type); this.deviceType = getActivity().findViewById(R.id.rls_t1_device_type);
@ -75,39 +75,24 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re
this.lastDeviceContact = getActivity().findViewById(R.id.rls_t1_last_device_contact); this.lastDeviceContact = getActivity().findViewById(R.id.rls_t1_last_device_contact);
this.firmwareVersion = getActivity().findViewById(R.id.rls_t1_firmware_version); this.firmwareVersion = getActivity().findViewById(R.id.rls_t1_firmware_version);
if (!first) {
// 7-14
int[] ids = {R.id.rls_t1_tv02, R.id.rls_t1_tv03, R.id.rls_t1_tv04, R.id.rls_t1_tv05, R.id.rls_t1_tv07, //
R.id.rls_t1_tv08, R.id.rls_t1_tv09, R.id.rls_t1_tv10, R.id.rls_t1_tv11, R.id.rls_t1_tv12, R.id.rls_t1_tv13};
for (int id : ids) {
TextView tv = getActivity().findViewById(id);
tv.setText(tv.getText() + ":");
}
first = true;
}
refreshData(); refreshData();
} }
public void refreshData() { public void refreshData() {
RileyLinkTargetDevice targetDevice = rileyLinkServiceData.targetDevice; RileyLinkTargetDevice targetDevice = rileyLinkServiceData.targetDevice;
this.connectionStatus.setText(resourceHelper.gs(rileyLinkServiceData.rileyLinkServiceState.getResourceId())); this.connectionStatus.setText(resourceHelper.gs(rileyLinkServiceData.rileyLinkServiceState.getResourceId()));
// BS FIXME rileyLinkServiceData is injected so I suppose it cannot be null?
if (rileyLinkServiceData != null) { if (rileyLinkServiceData != null) {
this.configuredAddress.setText(rileyLinkServiceData.rileylinkAddress); this.configuredAddress.setText(StringUtils.isEmpty(rileyLinkServiceData.rileylinkAddress) ? PLACEHOLDER : rileyLinkServiceData.rileylinkAddress);
this.connectedRileyLinkName.setText(StringUtils.isEmpty(rileyLinkServiceData.rileyLinkName) ? PLACEHOLDER : rileyLinkServiceData.rileyLinkName);
this.connectionError.setText(rileyLinkServiceData.rileyLinkError == null ? // this.connectionError.setText(rileyLinkServiceData.rileyLinkError == null ? //
"-" PLACEHOLDER
: resourceHelper.gs(rileyLinkServiceData.rileyLinkError.getResourceId(targetDevice))); : resourceHelper.gs(rileyLinkServiceData.rileyLinkError.getResourceId(targetDevice)));
if (firmwareVersion == null) { if (firmwareVersion == null) {
this.firmwareVersion.setText("BLE113: -\nCC110: -"); this.firmwareVersion.setText("BLE113: " + PLACEHOLDER + "\nCC110: " + PLACEHOLDER);
} else { } else {
this.firmwareVersion.setText("BLE113: " + rileyLinkServiceData.versionBLE113 + this.firmwareVersion.setText("BLE113: " + rileyLinkServiceData.versionBLE113 +
"\nCC110: " + rileyLinkServiceData.versionCC110); "\nCC110: " + rileyLinkServiceData.versionCC110);

View file

@ -84,7 +84,7 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
} }
private RileyLinkService getServiceInstance() { private RileyLinkService getServiceInstance() {
RileyLinkPumpDevice pumpDevice = (RileyLinkPumpDevice)activePlugin.getActivePump(); RileyLinkPumpDevice pumpDevice = (RileyLinkPumpDevice) activePlugin.getActivePump();
return pumpDevice.getRileyLinkService(); return pumpDevice.getRileyLinkService();
} }
@ -142,7 +142,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
return true; return true;
} else if (action.equals(RileyLinkConst.Intents.RileyLinkReady)) { } else if (action.equals(RileyLinkConst.Intents.RileyLinkReady)) {
aapsLogger.warn(LTag.PUMPBTCOMM, "RileyLinkConst.Intents.RileyLinkReady"); aapsLogger.warn(LTag.PUMPBTCOMM, "RileyLinkConst.Intents.RileyLinkReady");
// sendIPCNotification(RT2Const.IPC.MSG_note_WakingPump); // sendIPCNotification(RT2Const.IPC.MSG_note_WakingPump);
@ -153,7 +152,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
String bleVersion = rileyLinkService.rfspy.getBLEVersionCached(); String bleVersion = rileyLinkService.rfspy.getBLEVersionCached();
RileyLinkFirmwareVersion rlVersion = rileyLinkServiceData.firmwareVersion; RileyLinkFirmwareVersion rlVersion = rileyLinkServiceData.firmwareVersion;
// if (isLoggingEnabled())
aapsLogger.debug(LTag.PUMPBTCOMM, "RfSpy version (BLE113): " + bleVersion); aapsLogger.debug(LTag.PUMPBTCOMM, "RfSpy version (BLE113): " + bleVersion);
rileyLinkService.rileyLinkServiceData.versionBLE113 = bleVersion; rileyLinkService.rileyLinkServiceData.versionBLE113 = bleVersion;
@ -180,7 +178,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
return true; return true;
} else if (action.equals(RileyLinkConst.Intents.RileyLinkDisconnect)) { } else if (action.equals(RileyLinkConst.Intents.RileyLinkDisconnect)) {
rileyLinkService.disconnectRileyLink(); rileyLinkService.disconnectRileyLink();
return true; return true;
} else { } else {
return false; return false;

View file

@ -230,6 +230,7 @@ public abstract class RileyLinkService extends DaggerService {
if (rileyLinkBLE.isConnected()) { if (rileyLinkBLE.isConnected()) {
rileyLinkBLE.disconnect(); rileyLinkBLE.disconnect();
rileyLinkServiceData.rileylinkAddress = null; rileyLinkServiceData.rileylinkAddress = null;
rileyLinkServiceData.rileyLinkName = null;
} }
rileyLinkServiceData.setRileyLinkServiceState(RileyLinkServiceState.BluetoothReady); rileyLinkServiceData.setRileyLinkServiceState(RileyLinkServiceState.BluetoothReady);
@ -260,5 +261,9 @@ public abstract class RileyLinkService extends DaggerService {
return null; return null;
} }
public abstract boolean verifyConfiguration(); public boolean verifyConfiguration() {
return verifyConfiguration(false);
}
public abstract boolean verifyConfiguration(boolean forceRileyLinkAddressRenewal);
} }

View file

@ -35,6 +35,7 @@ public class RileyLinkServiceData {
public RileyLinkFirmwareVersion firmwareVersion; // here we have "compatibility level" version public RileyLinkFirmwareVersion firmwareVersion; // here we have "compatibility level" version
public RileyLinkTargetFrequency rileyLinkTargetFrequency; public RileyLinkTargetFrequency rileyLinkTargetFrequency;
public String rileylinkAddress; public String rileylinkAddress;
public String rileyLinkName;
long lastTuneUpTime = 0L; long lastTuneUpTime = 0L;
public Double lastGoodFrequency; public Double lastGoodFrequency;

View file

@ -37,7 +37,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv02"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -65,7 +64,33 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv03" android:layout_width="58dp"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:layout_weight="35"
android:gravity="center_vertical"
android:text="@string/rileylink_connected_riley_link_name" />
<TextView
android:id="@+id/rls_t1_connected_riley_link_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_weight="65"
android:gravity="center_vertical"
android:text=" "
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -94,7 +119,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv04"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -123,7 +147,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv05"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -151,7 +174,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv13"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -194,7 +216,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv07"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -223,7 +244,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv08"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -252,13 +272,12 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv09"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
android:layout_weight="35" android:layout_weight="35"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/medtronic_serial_number" /> android:text="@string/rileylink_pump_serial_number" />
<TextView <TextView
android:id="@+id/rls_t1_serial_number" android:id="@+id/rls_t1_serial_number"
@ -281,13 +300,12 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv10"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
android:layout_weight="35" android:layout_weight="35"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/medtronic_pump_frequency" /> android:text="@string/rileylink_pump_frequency" />
<TextView <TextView
android:id="@+id/rls_t1_pump_frequency" android:id="@+id/rls_t1_pump_frequency"
@ -309,7 +327,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv11"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
@ -338,7 +355,6 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/rls_t1_tv12"
android:layout_width="58dp" android:layout_width="58dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"

View file

@ -20,16 +20,19 @@
<string name="medtronic_pump_status">Pump Status</string> <string name="medtronic_pump_status">Pump Status</string>
<string name="title_activity_rileylink_settings">RileyLink Settings</string> <string name="title_activity_rileylink_settings">RileyLink Settings</string>
<string name="rileylink_title">RileyLink</string> <string name="rileylink_title">RileyLink</string>
<string name="rileylink_configured_address">Configured Address</string> <string name="rileylink_configured_address">Configured Address:</string>
<string name="rileylink_connected_device">Connected Device</string> <string name="rileylink_connected_device">Connected Device:</string>
<string name="rileylink_connection_status">Connection Status</string> <string name="rileylink_connection_status">Connection Status:</string>
<string name="rileylink_connection_error">Connection Error</string> <string name="rileylink_connection_error">Connection Error:</string>
<string name="rileylink_device">Device</string> <string name="rileylink_device">Device</string>
<string name="rileylink_device_type">Device Type</string> <string name="rileylink_device_type">Device Type:</string>
<string name="rileylink_device_model">Device Model</string> <string name="rileylink_device_model">Device Model:</string>
<string name="rileylink_last_used_frequency">Last used frequency</string> <string name="rileylink_last_used_frequency">Last Used Frequency:</string>
<string name="rileylink_last_device_contact">Last device contact</string> <string name="rileylink_last_device_contact">Last Device Contact:</string>
<string name="rileylink_firmware_version">Firmware</string> <string name="rileylink_firmware_version">Firmware Version:</string>
<string name="rileylink_connected_riley_link_name">Connected RileyLink Name:</string>
<string name="rileylink_pump_serial_number">Pump Serial Number:</string>
<string name="rileylink_pump_frequency">Pump Frequency:</string>
<!-- RL State --> <!-- RL State -->