This commit is contained in:
Milos Kozak 2022-03-13 11:10:27 +01:00
commit 6919565c3c
66 changed files with 818 additions and 622 deletions

View file

@ -6,6 +6,7 @@ import android.content.IntentFilter
import android.net.ConnectivityManager import android.net.ConnectivityManager
import android.net.wifi.WifiManager import android.net.wifi.WifiManager
import android.os.Build import android.os.Build
import androidx.lifecycle.ProcessLifecycleOwner
import com.uber.rxdogtag.RxDogTag import com.uber.rxdogtag.RxDogTag
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import dagger.android.DaggerApplication import dagger.android.DaggerApplication
@ -35,6 +36,7 @@ import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver
import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.androidaps.services.AlarmSoundServiceHelper
import info.nightscout.androidaps.utils.ActivityMonitor import info.nightscout.androidaps.utils.ActivityMonitor
import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.ProcessLifecycleListener
import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.buildHelper.BuildHelper
import info.nightscout.androidaps.utils.locale.LocaleHelper import info.nightscout.androidaps.utils.locale.LocaleHelper
import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.protection.PasswordCheck
@ -70,6 +72,7 @@ class MainApp : DaggerApplication() {
@Inject lateinit var passwordCheck: PasswordCheck @Inject lateinit var passwordCheck: PasswordCheck
@Inject lateinit var alarmSoundServiceHelper: AlarmSoundServiceHelper @Inject lateinit var alarmSoundServiceHelper: AlarmSoundServiceHelper
@Inject lateinit var notificationStore: NotificationStore @Inject lateinit var notificationStore: NotificationStore
@Inject lateinit var processLifecycleListener: ProcessLifecycleListener
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
@ -77,6 +80,7 @@ class MainApp : DaggerApplication() {
RxDogTag.install() RxDogTag.install()
setRxErrorHandler() setRxErrorHandler()
LocaleHelper.update(this) LocaleHelper.update(this)
ProcessLifecycleOwner.get().lifecycle.addObserver(processLifecycleListener)
var gitRemote: String? = BuildConfig.REMOTE var gitRemote: String? = BuildConfig.REMOTE
var commitHash: String? = BuildConfig.HEAD var commitHash: String? = BuildConfig.HEAD

View file

@ -27,6 +27,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv
import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign
@ -50,6 +51,7 @@ class CarbsDialog : DialogFragmentWithDate() {
@Inject lateinit var bolusTimer: BolusTimer @Inject lateinit var bolusTimer: BolusTimer
@Inject lateinit var commandQueue: CommandQueue @Inject lateinit var commandQueue: CommandQueue
@Inject lateinit var repository: AppRepository @Inject lateinit var repository: AppRepository
@Inject lateinit var protectionCheck: ProtectionCheck
companion object { companion object {
@ -377,4 +379,17 @@ class CarbsDialog : DialogFragmentWithDate() {
} }
return true return true
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -22,7 +22,10 @@ import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.shared.SafeParse import info.nightscout.shared.SafeParse
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.formatColor
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.shared.logging.LTag
import java.text.DecimalFormat import java.text.DecimalFormat
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
@ -36,6 +39,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() {
@Inject lateinit var commandQueue: CommandQueue @Inject lateinit var commandQueue: CommandQueue
@Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var uel: UserEntryLogger @Inject lateinit var uel: UserEntryLogger
@Inject lateinit var protectionCheck: ProtectionCheck
private var _binding: DialogExtendedbolusBinding? = null private var _binding: DialogExtendedbolusBinding? = null
@ -106,4 +110,17 @@ class ExtendedBolusDialog : DialogFragmentWithDate() {
} }
return true return true
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -28,6 +28,8 @@ import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.shared.SafeParse import info.nightscout.shared.SafeParse
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.formatColor
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign
@ -44,6 +46,7 @@ class FillDialog : DialogFragmentWithDate() {
@Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var uel: UserEntryLogger @Inject lateinit var uel: UserEntryLogger
@Inject lateinit var repository: AppRepository @Inject lateinit var repository: AppRepository
@Inject lateinit var protectionCheck: ProtectionCheck
private val disposable = CompositeDisposable() private val disposable = CompositeDisposable()
@ -196,4 +199,17 @@ class FillDialog : DialogFragmentWithDate() {
} }
}) })
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -28,6 +28,7 @@ import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.extensions.toSignedString import info.nightscout.androidaps.utils.extensions.toSignedString
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.shared.SafeParse import info.nightscout.shared.SafeParse
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
@ -52,6 +53,7 @@ class InsulinDialog : DialogFragmentWithDate() {
@Inject lateinit var config: Config @Inject lateinit var config: Config
@Inject lateinit var bolusTimer: BolusTimer @Inject lateinit var bolusTimer: BolusTimer
@Inject lateinit var uel: UserEntryLogger @Inject lateinit var uel: UserEntryLogger
@Inject lateinit var protectionCheck: ProtectionCheck
companion object { companion object {
@ -255,4 +257,17 @@ class InsulinDialog : DialogFragmentWithDate() {
} }
return true return true
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -38,6 +38,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
@ -62,6 +63,7 @@ class LoopDialog : DaggerDialogFragment() {
@Inject lateinit var dateUtil: DateUtil @Inject lateinit var dateUtil: DateUtil
@Inject lateinit var repository: AppRepository @Inject lateinit var repository: AppRepository
@Inject lateinit var objectivePlugin: ObjectivesPlugin @Inject lateinit var objectivePlugin: ObjectivesPlugin
@Inject lateinit var protectionCheck: ProtectionCheck
private var showOkCancel: Boolean = true private var showOkCancel: Boolean = true
private var _binding: DialogLoopBinding? = null private var _binding: DialogLoopBinding? = null
@ -437,4 +439,17 @@ class LoopDialog : DaggerDialogFragment() {
aapsLogger.debug(e.localizedMessage ?: e.toString()) aapsLogger.debug(e.localizedMessage ?: e.toString())
} }
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.dialogs package info.nightscout.androidaps.dialogs
import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
@ -30,7 +31,9 @@ import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.HardLimits
import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign
@ -51,6 +54,8 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
@Inject lateinit var hardLimits: HardLimits @Inject lateinit var hardLimits: HardLimits
@Inject lateinit var rxBus: RxBus @Inject lateinit var rxBus: RxBus
@Inject lateinit var defaultValueHelper: DefaultValueHelper @Inject lateinit var defaultValueHelper: DefaultValueHelper
@Inject lateinit var ctx: Context
@Inject lateinit var protectionCheck: ProtectionCheck
private var profileIndex: Int? = null private var profileIndex: Int? = null
@ -245,4 +250,17 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
} }
return true return true
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -20,7 +20,10 @@ import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.shared.SafeParse import info.nightscout.shared.SafeParse
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.formatColor
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.shared.logging.LTag
import java.text.DecimalFormat import java.text.DecimalFormat
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
@ -35,6 +38,7 @@ class TempBasalDialog : DialogFragmentWithDate() {
@Inject lateinit var commandQueue: CommandQueue @Inject lateinit var commandQueue: CommandQueue
@Inject lateinit var ctx: Context @Inject lateinit var ctx: Context
@Inject lateinit var uel: UserEntryLogger @Inject lateinit var uel: UserEntryLogger
@Inject lateinit var protectionCheck: ProtectionCheck
private var isPercentPump = true private var isPercentPump = true
@ -141,4 +145,17 @@ class TempBasalDialog : DialogFragmentWithDate() {
} }
return true return true
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.dialogs package info.nightscout.androidaps.dialogs
import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -26,7 +27,9 @@ import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.DefaultValueHelper
import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign
@ -43,6 +46,8 @@ class TempTargetDialog : DialogFragmentWithDate() {
@Inject lateinit var defaultValueHelper: DefaultValueHelper @Inject lateinit var defaultValueHelper: DefaultValueHelper
@Inject lateinit var uel: UserEntryLogger @Inject lateinit var uel: UserEntryLogger
@Inject lateinit var repository: AppRepository @Inject lateinit var repository: AppRepository
@Inject lateinit var ctx: Context
@Inject lateinit var protectionCheck: ProtectionCheck
private lateinit var reasonList: List<String> private lateinit var reasonList: List<String>
@ -218,4 +223,17 @@ class TempTargetDialog : DialogFragmentWithDate() {
} }
return true return true
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -30,6 +30,7 @@ import info.nightscout.shared.SafeParse
import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.formatColor
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign
@ -48,6 +49,7 @@ class TreatmentDialog : DialogFragmentWithDate() {
@Inject lateinit var config: Config @Inject lateinit var config: Config
@Inject lateinit var uel: UserEntryLogger @Inject lateinit var uel: UserEntryLogger
@Inject lateinit var repository: AppRepository @Inject lateinit var repository: AppRepository
@Inject lateinit var protectionCheck: ProtectionCheck
private val disposable = CompositeDisposable() private val disposable = CompositeDisposable()
@ -201,4 +203,17 @@ class TreatmentDialog : DialogFragmentWithDate() {
} }
return true return true
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -29,6 +29,7 @@ import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.extensions.valueToUnits
import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP
@ -55,6 +56,7 @@ class WizardDialog : DaggerDialogFragment() {
@Inject lateinit var iobCobCalculator: IobCobCalculator @Inject lateinit var iobCobCalculator: IobCobCalculator
@Inject lateinit var repository: AppRepository @Inject lateinit var repository: AppRepository
@Inject lateinit var dateUtil: DateUtil @Inject lateinit var dateUtil: DateUtil
@Inject lateinit var protectionCheck: ProtectionCheck
private var wizard: BolusWizard? = null private var wizard: BolusWizard? = null
private var calculatedPercentage = 100.0 private var calculatedPercentage = 100.0
@ -497,4 +499,17 @@ class WizardDialog : DaggerDialogFragment() {
aapsLogger.debug(e.localizedMessage ?: "") aapsLogger.debug(e.localizedMessage ?: "")
} }
} }
override fun onResume() {
super.onResume()
activity?.let { activity ->
val cancelFail = {
aapsLogger.debug(LTag.APS, "Dialog canceled on resume protection: ${this.javaClass.name}")
ToastUtils.showToastInUiThread(ctx, R.string.dialog_cancled)
dismiss()
}
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, {}, cancelFail, fail = cancelFail)
}
}
} }

View file

@ -8,6 +8,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TableRow
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import dagger.android.support.DaggerFragment import dagger.android.support.DaggerFragment
@ -108,6 +109,7 @@ class ActionsFragment : DaggerFragment() {
private var insulinLevelLabel: TextView? = null private var insulinLevelLabel: TextView? = null
private var pbLevelLabel: TextView? = null private var pbLevelLabel: TextView? = null
private var cannulaOrPatch: TextView? = null private var cannulaOrPatch: TextView? = null
private var batteryLayout: TableRow? = null
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
@ -143,7 +145,6 @@ class ActionsFragment : DaggerFragment() {
historyBrowser = view.findViewById(R.id.actions_historybrowser) historyBrowser = view.findViewById(R.id.actions_historybrowser)
tddStats = view.findViewById(R.id.actions_tddstats) tddStats = view.findViewById(R.id.actions_tddstats)
pumpBatteryChange = view.findViewById(R.id.actions_pumpbatterychange) pumpBatteryChange = view.findViewById(R.id.actions_pumpbatterychange)
cannulaAge = view.findViewById(R.id.cannula_age) cannulaAge = view.findViewById(R.id.cannula_age)
insulinAge = view.findViewById(R.id.insulin_age) insulinAge = view.findViewById(R.id.insulin_age)
reservoirLevel = view.findViewById(R.id.reservoir_level) reservoirLevel = view.findViewById(R.id.reservoir_level)
@ -155,6 +156,7 @@ class ActionsFragment : DaggerFragment() {
insulinLevelLabel = view.findViewById(R.id.insulin_level_label) insulinLevelLabel = view.findViewById(R.id.insulin_level_label)
pbLevelLabel = view.findViewById(R.id.pb_level_label) pbLevelLabel = view.findViewById(R.id.pb_level_label)
cannulaOrPatch = view.findViewById(R.id.cannula_or_patch) cannulaOrPatch = view.findViewById(R.id.cannula_or_patch)
batteryLayout = view.findViewById(R.id.battery_layout)
profileSwitch?.setOnClickListener { profileSwitch?.setOnClickListener {
activity?.let { activity -> activity?.let { activity ->
@ -327,18 +329,14 @@ class ActionsFragment : DaggerFragment() {
val activeBgSource = activePlugin.activeBgSource val activeBgSource = activePlugin.activeBgSource
historyBrowser?.visibility = (profile != null).toVisibility() historyBrowser?.visibility = (profile != null).toVisibility()
fill?.visibility = (pump.pumpDescription.isRefillingCapable && pump.isInitialized() && !pump.isSuspended()).toVisibility() fill?.visibility = (pump.pumpDescription.isRefillingCapable && pump.isInitialized() && !pump.isSuspended()).toVisibility()
if (pump is DiaconnG8Plugin) { pumpBatteryChange?.visibility = (pump.pumpDescription.isBatteryReplaceable || pump.isBatteryChangeLoggingEnabled()).toVisibility()
pumpBatteryChange?.visibility = (pump.pumpDescription.isBatteryReplaceable && !pump.isBatteryChangeLoggingEnabled()).toVisibility()
} else {
pumpBatteryChange?.visibility =
(pump.pumpDescription.isBatteryReplaceable || (pump is OmnipodErosPumpPlugin && pump.isUseRileyLinkBatteryLevel && pump.isBatteryChangeLoggingEnabled)).toVisibility()
}
tempTarget?.visibility = (profile != null && !loop.isDisconnected).toVisibility() tempTarget?.visibility = (profile != null && !loop.isDisconnected).toVisibility()
tddStats?.visibility = pump.pumpDescription.supportsTDDs.toVisibility() tddStats?.visibility = pump.pumpDescription.supportsTDDs.toVisibility()
val isPatchPump = pump.pumpDescription.isPatchPump
cannulaOrPatch?.text = if (pump.pumpDescription.isPatchPump) rh.gs(R.string.patch_pump) else rh.gs(R.string.cannula) cannulaOrPatch?.text = if (isPatchPump) rh.gs(R.string.patch_pump) else rh.gs(R.string.cannula)
val imageResource = if (pump.pumpDescription.isPatchPump) R.drawable.ic_patch_pump_outline else R.drawable.ic_cp_age_cannula val imageResource = if (isPatchPump) R.drawable.ic_patch_pump_outline else R.drawable.ic_cp_age_cannula
cannulaOrPatch?.setCompoundDrawablesWithIntrinsicBounds(imageResource, 0, 0, 0) cannulaOrPatch?.setCompoundDrawablesWithIntrinsicBounds(imageResource, 0, 0, 0)
batteryLayout?.visibility = (!isPatchPump || pump.pumpDescription.useHardwareLink).toVisibility()
if (!config.NSCLIENT) { if (!config.NSCLIENT) {
statusLightHandler.updateStatusLights(cannulaAge, insulinAge, reservoirLevel, sensorAge, sensorLevel, pbAge, batteryLevel) statusLightHandler.updateStatusLights(cannulaAge, insulinAge, reservoirLevel, sensorAge, sensorLevel, pbAge, batteryLevel)

View file

@ -34,6 +34,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action
import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.UserEntry.Sources
import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.database.interfaces.end
import info.nightscout.androidaps.databinding.OverviewFragmentBinding import info.nightscout.androidaps.databinding.OverviewFragmentBinding
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
import info.nightscout.androidaps.dialogs.* import info.nightscout.androidaps.dialogs.*
import info.nightscout.androidaps.events.EventAcceptOpenLoopChange import info.nightscout.androidaps.events.EventAcceptOpenLoopChange
import info.nightscout.androidaps.events.EventInitializationChanged import info.nightscout.androidaps.events.EventInitializationChanged
@ -61,6 +62,7 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Notific
import info.nightscout.androidaps.plugins.general.wear.events.EventWearInitiateAction import info.nightscout.androidaps.plugins.general.wear.events.EventWearInitiateAction
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.source.DexcomPlugin import info.nightscout.androidaps.plugins.source.DexcomPlugin
import info.nightscout.androidaps.plugins.source.XdripPlugin import info.nightscout.androidaps.plugins.source.XdripPlugin
import info.nightscout.androidaps.skins.SkinProvider import info.nightscout.androidaps.skins.SkinProvider
@ -866,13 +868,19 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
fun updateTime(from: String) { fun updateTime(from: String) {
binding.infoLayout.time.text = dateUtil.timeString(dateUtil.now()) binding.infoLayout.time.text = dateUtil.timeString(dateUtil.now())
// Status lights // Status lights
val isPatchPump = activePlugin.activePump.pumpDescription.isPatchPump val pump = activePlugin.activePump
val isPatchPump = pump.pumpDescription.isPatchPump
binding.statusLightsLayout.apply { binding.statusLightsLayout.apply {
cannulaOrPatch.setImageResource(if (isPatchPump) R.drawable.ic_patch_pump_outline else R.drawable.ic_cp_age_cannula) cannulaOrPatch.setImageResource(if (isPatchPump) R.drawable.ic_patch_pump_outline else R.drawable.ic_cp_age_cannula)
cannulaOrPatch.contentDescription = rh.gs(if (isPatchPump) R.string.statuslights_patch_pump_age else R.string.statuslights_cannula_age) cannulaOrPatch.contentDescription = rh.gs(if (isPatchPump) R.string.statuslights_patch_pump_age else R.string.statuslights_cannula_age)
cannulaOrPatch.scaleX = if (isPatchPump) 1.4f else 2f cannulaOrPatch.scaleX = if (isPatchPump) 1.4f else 2f
cannulaOrPatch.scaleY = cannulaOrPatch.scaleX cannulaOrPatch.scaleY = cannulaOrPatch.scaleX
insulinAge.visibility = isPatchPump.not().toVisibility() insulinAge.visibility = isPatchPump.not().toVisibility()
batteryLayout.visibility = (!isPatchPump || pump.pumpDescription.useHardwareLink).toVisibility()
pbAge.visibility = (pump.pumpDescription.isBatteryReplaceable || pump.isBatteryChangeLoggingEnabled()).toVisibility()
val useBatteryLevel = (pump.model() == PumpType.OMNIPOD_EROS && pump is OmnipodErosPumpPlugin)
|| (pump.model() != PumpType.ACCU_CHEK_COMBO && pump.model() != PumpType.OMNIPOD_DASH)
batteryLevel.visibility = useBatteryLevel.toVisibility()
statusLights.visibility = (sp.getBoolean(R.string.key_show_statuslights, true) || config.NSCLIENT).toVisibility() statusLights.visibility = (sp.getBoolean(R.string.key_show_statuslights, true) || config.NSCLIENT).toVisibility()
} }
statusLightHandler.updateStatusLights( statusLightHandler.updateStatusLights(

View file

@ -1,7 +1,6 @@
package info.nightscout.androidaps.plugins.general.overview package info.nightscout.androidaps.plugins.general.overview
import android.graphics.Color import android.graphics.Color
import android.view.View
import android.widget.TextView import android.widget.TextView
import androidx.annotation.StringRes import androidx.annotation.StringRes
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
@ -42,7 +41,7 @@ class StatusLightHandler @Inject constructor(
handleAge(careportal_cannula_age, TherapyEvent.Type.CANNULA_CHANGE, R.string.key_statuslights_cage_warning, 48.0, R.string.key_statuslights_cage_critical, 72.0) handleAge(careportal_cannula_age, TherapyEvent.Type.CANNULA_CHANGE, R.string.key_statuslights_cage_warning, 48.0, R.string.key_statuslights_cage_critical, 72.0)
handleAge(careportal_insulin_age, TherapyEvent.Type.INSULIN_CHANGE, R.string.key_statuslights_iage_warning, 72.0, R.string.key_statuslights_iage_critical, 144.0) handleAge(careportal_insulin_age, TherapyEvent.Type.INSULIN_CHANGE, R.string.key_statuslights_iage_warning, 72.0, R.string.key_statuslights_iage_critical, 144.0)
handleAge(careportal_sensor_age, TherapyEvent.Type.SENSOR_CHANGE, R.string.key_statuslights_sage_warning, 216.0, R.string.key_statuslights_sage_critical, 240.0) handleAge(careportal_sensor_age, TherapyEvent.Type.SENSOR_CHANGE, R.string.key_statuslights_sage_warning, 216.0, R.string.key_statuslights_sage_critical, 240.0)
if (pump.pumpDescription.isBatteryReplaceable || (pump is OmnipodErosPumpPlugin && pump.isUseRileyLinkBatteryLevel && pump.isBatteryChangeLoggingEnabled)) { if (pump.pumpDescription.isBatteryReplaceable || pump.isBatteryChangeLoggingEnabled()) {
handleAge(careportal_pb_age, TherapyEvent.Type.PUMP_BATTERY_CHANGE, R.string.key_statuslights_bage_warning, 216.0, R.string.key_statuslights_bage_critical, 240.0) handleAge(careportal_pb_age, TherapyEvent.Type.PUMP_BATTERY_CHANGE, R.string.key_statuslights_bage_warning, 216.0, R.string.key_statuslights_bage_critical, 240.0)
} }
if (!config.NSCLIENT) { if (!config.NSCLIENT) {
@ -58,16 +57,16 @@ class StatusLightHandler @Inject constructor(
} }
if (!config.NSCLIENT) { if (!config.NSCLIENT) {
if (pump.model() == PumpType.OMNIPOD_DASH) {
// Omnipod Dash does not report its battery level
careportal_battery_level?.text = rh.gs(R.string.notavailable)
careportal_battery_level?.setTextColor(Color.WHITE)
} else if (pump.model() == PumpType.OMNIPOD_EROS && pump is OmnipodErosPumpPlugin) { // instance of check is needed because at startup, pump can still be VirtualPumpPlugin and that will cause a crash because of the class cast below
// The Omnipod Eros does not report its battery level. However, some RileyLink alternatives do. // The Omnipod Eros does not report its battery level. However, some RileyLink alternatives do.
// Depending on the user's configuration, we will either show the battery level reported by the RileyLink or "n/a" // Depending on the user's configuration, we will either show the battery level reported by the RileyLink or "n/a"
handleOmnipodErosBatteryLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%", pump.isUseRileyLinkBatteryLevel) // Pump instance check is needed because at startup, the pump can still be VirtualPumpPlugin and that will cause a crash
} else if (pump.model() != PumpType.ACCU_CHEK_COMBO) { val erosBatteryLinkAvailable = pump.model() == PumpType.OMNIPOD_EROS && pump is OmnipodErosPumpPlugin && pump.isUseRileyLinkBatteryLevel
if (pump.model().supportBatteryLevel || erosBatteryLinkAvailable) {
handleLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%") handleLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%")
} else {
careportal_battery_level?.text = rh.gs(R.string.notavailable)
careportal_battery_level?.setTextColor(Color.WHITE)
} }
} }
} }
@ -104,13 +103,4 @@ class StatusLightHandler @Inject constructor(
} }
} }
@Suppress("SameParameterValue")
private fun handleOmnipodErosBatteryLevel(view: TextView?, criticalSetting: Int, criticalDefaultValue: Double, warnSetting: Int, warnDefaultValue: Double, level: Double, units: String, useRileyLinkBatteryLevel: Boolean) {
if (useRileyLinkBatteryLevel) {
handleLevel(view, criticalSetting, criticalDefaultValue, warnSetting, warnDefaultValue, level, units)
} else {
view?.text = rh.gs(R.string.notavailable)
view?.setTextColor(Color.WHITE)
}
}
} }

View file

@ -2,15 +2,9 @@ package info.nightscout.androidaps.plugins.general.overview.activities
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.SparseArray
import android.view.LayoutInflater import android.view.*
import android.view.MenuItem import androidx.core.util.forEach
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_DRAG import androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_DRAG
@ -23,11 +17,14 @@ import androidx.recyclerview.widget.RecyclerView
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult
import info.nightscout.androidaps.databinding.OverviewQuickwizardlistActivityBinding import info.nightscout.androidaps.databinding.OverviewQuickwizardlistActivityBinding
import info.nightscout.androidaps.databinding.OverviewQuickwizardlistItemBinding
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog
import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange
import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizard
import info.nightscout.androidaps.utils.wizard.QuickWizardEntry import info.nightscout.androidaps.utils.wizard.QuickWizardEntry
@ -46,17 +43,16 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult() {
@Inject lateinit var sp: SP @Inject lateinit var sp: SP
private var disposable: CompositeDisposable = CompositeDisposable() private var disposable: CompositeDisposable = CompositeDisposable()
private var selectedItems: SparseArray<QuickWizardEntry> = SparseArray()
private var removeActionMode: ActionMode? = null
private var sortActionMode: ActionMode? = null
private lateinit var binding: OverviewQuickwizardlistActivityBinding private lateinit var binding: OverviewQuickwizardlistActivityBinding
private val itemTouchHelper by lazy { private val itemTouchHelper by lazy {
val simpleItemTouchCallback = object : ItemTouchHelper.SimpleCallback(UP or DOWN or START or END, 0) { val simpleItemTouchCallback = object : ItemTouchHelper.SimpleCallback(UP or DOWN or START or END, 0) {
override fun onMove( override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder
): Boolean {
val adapter = recyclerView.adapter as RecyclerViewAdapter val adapter = recyclerView.adapter as RecyclerViewAdapter
val from = viewHolder.layoutPosition val from = viewHolder.layoutPosition
val to = target.layoutPosition val to = target.layoutPosition
@ -66,12 +62,10 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult() {
return true return true
} }
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {}
}
override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) { override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) {
super.onSelectedChanged(viewHolder, actionState) super.onSelectedChanged(viewHolder, actionState)
if (actionState == ACTION_STATE_DRAG) { if (actionState == ACTION_STATE_DRAG) {
viewHolder?.itemView?.alpha = 0.5f viewHolder?.itemView?.alpha = 0.5f
} }
@ -79,11 +73,8 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult() {
override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) {
super.clearView(recyclerView, viewHolder) super.clearView(recyclerView, viewHolder)
viewHolder.itemView.alpha = 1.0f viewHolder.itemView.alpha = 1.0f
(recyclerView.adapter as RecyclerViewAdapter).onDrop()
val adapter = recyclerView.adapter as RecyclerViewAdapter
adapter.onDrop()
} }
} }
@ -96,82 +87,84 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult() {
private inner class RecyclerViewAdapter(var fragmentManager: FragmentManager) : RecyclerView.Adapter<RecyclerViewAdapter.QuickWizardEntryViewHolder>() { private inner class RecyclerViewAdapter(var fragmentManager: FragmentManager) : RecyclerView.Adapter<RecyclerViewAdapter.QuickWizardEntryViewHolder>() {
@SuppressLint("ClickableViewAccessibility") private inner class QuickWizardEntryViewHolder(val binding: OverviewQuickwizardlistItemBinding, val fragmentManager: FragmentManager) : RecyclerView.ViewHolder(binding.root)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QuickWizardEntryViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QuickWizardEntryViewHolder {
val itemView = LayoutInflater.from(parent.context).inflate(R.layout.overview_quickwizardlist_item, parent, false) val binding = OverviewQuickwizardlistItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)
val viewHolder = QuickWizardEntryViewHolder(itemView, fragmentManager) return QuickWizardEntryViewHolder(binding, fragmentManager)
viewHolder.handleView.setOnTouchListener { _, event ->
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
startDragging(viewHolder)
}
return@setOnTouchListener true
}
return viewHolder
} }
@SuppressLint("ClickableViewAccessibility")
override fun onBindViewHolder(holder: QuickWizardEntryViewHolder, position: Int) { override fun onBindViewHolder(holder: QuickWizardEntryViewHolder, position: Int) {
holder.from.text = dateUtil.timeString(quickWizard[position].validFromDate()) val entry = quickWizard[position]
holder.to.text = dateUtil.timeString(quickWizard[position].validToDate()) holder.binding.from.text = dateUtil.timeString(entry.validFromDate())
val wearControl = sp.getBoolean(R.string.key_wear_control, false) holder.binding.to.text = dateUtil.timeString(entry.validToDate())
holder.binding.buttonText.text = entry.buttonText()
if (wearControl) { holder.binding.carbs.text = rh.gs(R.string.format_carbs, entry.carbs())
holder.handleView.visibility = View.VISIBLE if (entry.device() == QuickWizardEntry.DEVICE_ALL) {
holder.binding.device.visibility = View.GONE
} else { } else {
holder.handleView.visibility = View.GONE holder.binding.device.visibility = View.VISIBLE
} holder.binding.device.setImageResource(
if (quickWizard[position].device() == QuickWizardEntry.DEVICE_ALL) {
holder.device.visibility = View.GONE
} else {
holder.device.visibility = View.VISIBLE
holder.device.setImageResource(
when (quickWizard[position].device()) { when (quickWizard[position].device()) {
QuickWizardEntry.DEVICE_WATCH -> R.drawable.ic_watch QuickWizardEntry.DEVICE_WATCH -> R.drawable.ic_watch
else -> R.drawable.ic_smartphone else -> R.drawable.ic_smartphone
} }
) )
} }
holder.buttonText.text = quickWizard[position].buttonText()
holder.carbs.text = rh.gs(R.string.format_carbs, quickWizard[position].carbs()) if (sortActionMode != null && removeActionMode != null) {
holder.binding.cardview.setOnClickListener {
val manager = fragmentManager
val editQuickWizardDialog = EditQuickWizardDialog()
val bundle = Bundle()
bundle.putInt("position", position)
editQuickWizardDialog.arguments = bundle
editQuickWizardDialog.show(manager, "EditQuickWizardDialog")
}
}
fun updateSelection(selected: Boolean) {
if (selected) {
selectedItems.put(position, entry)
} else {
selectedItems.remove(position)
}
removeActionMode?.title = rh.gs(R.string.count_selected, selectedItems.size())
}
holder.binding.cardview.setOnTouchListener { _, event ->
if (event.actionMasked == MotionEvent.ACTION_UP && sortActionMode == null && removeActionMode == null) {
val manager = fragmentManager
val editQuickWizardDialog = EditQuickWizardDialog()
val bundle = Bundle()
bundle.putInt("position", position)
editQuickWizardDialog.arguments = bundle
editQuickWizardDialog.show(manager, "EditQuickWizardDialog")
}
if (event.actionMasked == MotionEvent.ACTION_DOWN && sortActionMode != null) {
startDragging(holder)
}
if (event.actionMasked == MotionEvent.ACTION_UP && removeActionMode != null) {
holder.binding.cbRemove.toggle()
updateSelection(holder.binding.cbRemove.isChecked)
}
return@setOnTouchListener true
}
holder.binding.cbRemove.isChecked = selectedItems.get(position) != null
holder.binding.cbRemove.setOnCheckedChangeListener { _, value -> updateSelection(value) }
holder.binding.handleView.visibility = (sortActionMode != null).toVisibility()
holder.binding.cbRemove.visibility = (removeActionMode != null).toVisibility()
removeActionMode?.title = rh.gs(R.string.count_selected, selectedItems.size())
} }
override fun getItemCount(): Int = quickWizard.size() override fun getItemCount(): Int = quickWizard.size()
private inner class QuickWizardEntryViewHolder(itemView: View, var fragmentManager: FragmentManager) : RecyclerView.ViewHolder(itemView) {
val buttonText: TextView = itemView.findViewById(R.id.overview_quickwizard_item_buttonText)
val carbs: TextView = itemView.findViewById(R.id.overview_quickwizard_item_carbs)
val from: TextView = itemView.findViewById(R.id.overview_quickwizard_item_from)
val handleView: ImageView = itemView.findViewById(R.id.handleView)
val device: ImageView = itemView.findViewById(R.id.overview_quickwizard_item_device)
val to: TextView = itemView.findViewById(R.id.overview_quickwizard_item_to)
private val editButton: Button = itemView.findViewById(R.id.overview_quickwizard_item_edit_button)
private val removeButton: Button = itemView.findViewById(R.id.overview_quickwizard_item_remove_button)
init {
editButton.setOnClickListener {
val manager = fragmentManager
val editQuickWizardDialog = EditQuickWizardDialog()
val bundle = Bundle()
bundle.putInt("position", bindingAdapterPosition)
editQuickWizardDialog.arguments = bundle
editQuickWizardDialog.show(manager, "EditQuickWizardDialog")
}
removeButton.setOnClickListener {
quickWizard.remove(bindingAdapterPosition)
rxBus.send(EventQuickWizardChange())
}
}
}
fun moveItem(from: Int, to: Int) { fun moveItem(from: Int, to: Int) {
Log.i("QuickWizard", "moveItem")
quickWizard.move(from, to) quickWizard.move(from, to)
} }
fun onDrop() { fun onDrop() {
Log.i("QuickWizard", "onDrop")
rxBus.send(EventQuickWizardChange()) rxBus.send(EventQuickWizardChange())
} }
} }
@ -213,6 +206,25 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult() {
super.onPause() super.onPause()
} }
private fun removeSelected() {
if (selectedItems.size() > 0)
OKDialog.showConfirmation(this, rh.gs(R.string.removerecord), getConfirmationText(), Runnable {
selectedItems.forEach { _, item ->
quickWizard.remove(item.position)
rxBus.send(EventQuickWizardChange())
}
removeActionMode?.finish()
})
else
removeActionMode?.finish()
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
val inflater = menuInflater
inflater.inflate(R.menu.menu_quickwizard, menu)
return super.onCreateOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean = override fun onOptionsItemSelected(item: MenuItem): Boolean =
when (item.itemId) { when (item.itemId) {
android.R.id.home -> { android.R.id.home -> {
@ -220,6 +232,81 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult() {
true true
} }
R.id.nav_remove_items -> {
removeActionMode = startActionMode(RemoveActionModeCallback())
true
}
R.id.nav_sort_items -> {
sortActionMode = startActionMode(SortActionModeCallback())
true
}
else -> false
}
inner class RemoveActionModeCallback : ActionMode.Callback {
override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean {
mode.menuInflater.inflate(R.menu.menu_delete_selection, menu)
selectedItems.clear()
mode.title = rh.gs(R.string.count_selected, selectedItems.size())
binding.recyclerview.adapter?.notifyDataSetChanged()
return true
}
override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false
override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean {
return when (item.itemId) {
R.id.remove_selected -> {
removeSelected()
true
}
else -> false else -> false
} }
} }
override fun onDestroyActionMode(mode: ActionMode?) {
removeActionMode = null
binding.recyclerview.adapter?.notifyDataSetChanged()
}
}
inner class SortActionModeCallback : ActionMode.Callback {
override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean {
mode.title = rh.gs(R.string.sort_label)
binding.recyclerview.adapter?.notifyDataSetChanged()
return true
}
override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false
override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean {
return when (item.itemId) {
R.id.remove_selected -> {
removeSelected()
true
}
else -> false
}
}
override fun onDestroyActionMode(mode: ActionMode?) {
sortActionMode = null
binding.recyclerview.adapter?.notifyDataSetChanged()
}
}
private fun getConfirmationText(): String {
if (selectedItems.size() == 1) {
val entry = selectedItems.valueAt(0)
return "${rh.gs(R.string.remove_button)} ${entry.buttonText()} ${rh.gs(R.string.format_carbs, entry.carbs())}\n" +
"${dateUtil.timeString(entry.validFromDate())} - ${dateUtil.timeString(entry.validToDate())}"
}
return rh.gs(R.string.confirm_remove_multiple_items, selectedItems.size())
}
}

View file

@ -1,10 +1,10 @@
package info.nightscout.androidaps.plugins.source package info.nightscout.androidaps.plugins.source
import android.graphics.Paint
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.util.SparseArray
import android.view.View import android.view.*
import android.view.ViewGroup import androidx.appcompat.widget.Toolbar
import androidx.core.util.forEach
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment import dagger.android.support.DaggerFragment
@ -54,11 +54,12 @@ class BGSourceFragment : DaggerFragment() {
private val disposable = CompositeDisposable() private val disposable = CompositeDisposable()
private val millsToThePast = T.hours(36).msecs() private val millsToThePast = T.hours(36).msecs()
private var selectedItems: SparseArray<GlucoseValue> = SparseArray()
private var toolbar: Toolbar? = null
private var removeActionMode: ActionMode? = null
private var _binding: BgsourceFragmentBinding? = null private var _binding: BgsourceFragmentBinding? = null
// This property is only valid between onCreateView and onDestroyView.
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!! private val binding get() = _binding!!
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View = override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
@ -66,6 +67,8 @@ class BGSourceFragment : DaggerFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
toolbar = activity?.findViewById(R.id.toolbar)
setHasOptionsMenu(true)
binding.recyclerview.setHasFixedSize(true) binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context) binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
@ -94,17 +97,45 @@ class BGSourceFragment : DaggerFragment() {
@Synchronized @Synchronized
override fun onPause() { override fun onPause() {
removeActionMode?.finish()
disposable.clear() disposable.clear()
super.onPause() super.onPause()
} }
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
inflater.inflate(R.menu.menu_bgsource, menu)
}
override fun onPrepareOptionsMenu(menu: Menu) {
// Only show when tab bg source is shown
menu.findItem(R.id.nav_remove_items)?.isVisible = isResumed
super.onPrepareOptionsMenu(menu)
}
@Synchronized @Synchronized
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
removeActionMode?.finish()
binding.recyclerview.adapter = null // avoid leaks binding.recyclerview.adapter = null // avoid leaks
_binding = null _binding = null
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.nav_remove_items -> {
if (toolbar != null) {
removeActionMode = toolbar?.startActionMode(RemoveActionModeCallback()) // in overview
} else {
removeActionMode = activity?.startActionMode(RemoveActionModeCallback()) // in Single FragmentActivity
}
true
}
else -> false
}
}
inner class RecyclerViewAdapter internal constructor(private var glucoseValues: List<GlucoseValue>) : RecyclerView.Adapter<RecyclerViewAdapter.GlucoseValuesViewHolder>() { inner class RecyclerViewAdapter internal constructor(private var glucoseValues: List<GlucoseValue>) : RecyclerView.Adapter<RecyclerViewAdapter.GlucoseValuesViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): GlucoseValuesViewHolder { override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): GlucoseValuesViewHolder {
@ -122,13 +153,37 @@ class BGSourceFragment : DaggerFragment() {
holder.binding.time.text = dateUtil.timeString(glucoseValue.timestamp) holder.binding.time.text = dateUtil.timeString(glucoseValue.timestamp)
holder.binding.value.text = glucoseValue.valueToUnitsString(profileFunction.getUnits()) holder.binding.value.text = glucoseValue.valueToUnitsString(profileFunction.getUnits())
holder.binding.direction.setImageResource(glucoseValue.trendArrow.directionToIcon()) holder.binding.direction.setImageResource(glucoseValue.trendArrow.directionToIcon())
holder.binding.remove.tag = glucoseValue
if (position > 0) { if (position > 0) {
val previous = glucoseValues[position - 1] val previous = glucoseValues[position - 1]
val diff = previous.timestamp - glucoseValue.timestamp val diff = previous.timestamp - glucoseValue.timestamp
if (diff < T.secs(20).msecs()) if (diff < T.secs(20).msecs())
holder.binding.root.setBackgroundColor(rh.gc(R.color.errorAlertBackground)) holder.binding.root.setBackgroundColor(rh.gc(R.color.errorAlertBackground))
} }
fun updateSelection(selected: Boolean) {
if (selected) {
selectedItems.put(position, glucoseValue)
} else {
selectedItems.remove(position)
}
removeActionMode?.title = rh.gs(R.string.count_selected, selectedItems.size())
}
holder.binding.root.setOnLongClickListener {
if (removeActionMode == null) {
removeActionMode = toolbar?.startActionMode(RemoveActionModeCallback())
}
holder.binding.cbRemove.toggle()
updateSelection(holder.binding.cbRemove.isChecked)
true
}
holder.binding.root.setOnClickListener {
if (removeActionMode != null) {
holder.binding.cbRemove.toggle()
updateSelection(holder.binding.cbRemove.isChecked)
}
}
holder.binding.cbRemove.setOnCheckedChangeListener { _, value -> updateSelection(value) }
holder.binding.cbRemove.isChecked = selectedItems.get(position) != null
holder.binding.cbRemove.visibility = (removeActionMode != null).toVisibility()
} }
override fun getItemCount(): Int = glucoseValues.size override fun getItemCount(): Int = glucoseValues.size
@ -136,14 +191,51 @@ class BGSourceFragment : DaggerFragment() {
inner class GlucoseValuesViewHolder(view: View) : RecyclerView.ViewHolder(view) { inner class GlucoseValuesViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val binding = BgsourceItemBinding.bind(view) val binding = BgsourceItemBinding.bind(view)
}
}
init { inner class RemoveActionModeCallback : ActionMode.Callback {
binding.remove.paintFlags = binding.remove.paintFlags or Paint.UNDERLINE_TEXT_FLAG
binding.remove.setOnClickListener { v: View -> override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean {
val glucoseValue = v.tag as GlucoseValue mode.menuInflater.inflate(R.menu.menu_delete_selection, menu)
selectedItems.clear()
mode.title = rh.gs(R.string.count_selected, selectedItems.size())
binding.recyclerview.adapter?.notifyDataSetChanged()
return true
}
override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false
override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean {
return when (item.itemId) {
R.id.remove_selected -> {
removeSelected()
true
}
else -> false
}
}
override fun onDestroyActionMode(mode: ActionMode?) {
removeActionMode = null
binding.recyclerview.adapter?.notifyDataSetChanged()
}
}
private fun getConfirmationText(): String {
if (selectedItems.size() == 1) {
val glucoseValue = selectedItems.valueAt(0)
return dateUtil.dateAndTimeString(glucoseValue.timestamp) + "\n" + glucoseValue.valueToUnitsString(profileFunction.getUnits())
}
return rh.gs(R.string.confirm_remove_multiple_items, selectedItems.size())
}
private fun removeSelected() {
if (selectedItems.size() > 0)
activity?.let { activity -> activity?.let { activity ->
val text = dateUtil.dateAndTimeString(glucoseValue.timestamp) + "\n" + glucoseValue.valueToUnitsString(profileFunction.getUnits()) OKDialog.showConfirmation(activity, rh.gs(R.string.removerecord), getConfirmationText(), Runnable {
OKDialog.showConfirmation(activity, rh.gs(R.string.removerecord), text, Runnable { selectedItems.forEach { _, glucoseValue ->
val source = when ((activePlugin.activeBgSource as PluginBase).pluginDescription.pluginName) { val source = when ((activePlugin.activeBgSource as PluginBase).pluginDescription.pluginName) {
R.string.dexcom_app_patched -> Sources.Dexcom R.string.dexcom_app_patched -> Sources.Dexcom
R.string.eversense -> Sources.Eversense R.string.eversense -> Sources.Eversense
@ -164,10 +256,11 @@ class BGSourceFragment : DaggerFragment() {
.doOnError { aapsLogger.error(LTag.DATABASE, "Error while invalidating BG value", it) } .doOnError { aapsLogger.error(LTag.DATABASE, "Error while invalidating BG value", it) }
.blockingGet() .blockingGet()
.also { result -> result.invalidated.forEach { aapsLogger.debug(LTag.DATABASE, "Invalidated bg $it") } } .also { result -> result.invalidated.forEach { aapsLogger.debug(LTag.DATABASE, "Invalidated bg $it") } }
}
removeActionMode?.finish()
}) })
} }
} else
} removeActionMode?.finish()
}
} }
} }

View file

@ -0,0 +1,13 @@
package info.nightscout.androidaps.utils
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import info.nightscout.androidaps.utils.protection.ProtectionCheck
import javax.inject.Inject
class ProcessLifecycleListener @Inject constructor(private val protectionCheck: ProtectionCheck) : DefaultLifecycleObserver {
override fun onPause(owner: LifecycleOwner) {
protectionCheck.resetAuthorization()
}
}

View file

@ -17,7 +17,7 @@
android:id="@+id/date" android:id="@+id/date"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:textAppearance="?android:attr/textAppearanceMedium" />
@ -68,18 +68,19 @@
android:text="@string/invalid" android:text="@string/invalid"
android:textColor="@android:color/holo_red_light" /> android:textColor="@android:color/holo_red_light" />
<TextView
android:id="@+id/remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:text="@string/remove_button"
android:textAlignment="viewEnd"
android:textColor="@android:color/holo_orange_light" />
</LinearLayout> </LinearLayout>
<CheckBox
android:id="@+id/cb_remove"
android:layout_width="wrap_content"
android:layout_gravity="end"
android:layout_height="19dp"
android:contentDescription="@string/select_for_removal"
android:minWidth="0dp"
android:layout_marginTop="-25dp"
android:visibility="gone"/>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View file

@ -41,7 +41,6 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
android:id="@+id/sensor_level_label" android:id="@+id/sensor_level_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -77,7 +76,7 @@
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:layout_span="5" android:layout_span="5"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</TableRow> </TableRow>
@ -96,7 +95,6 @@
android:textSize="14sp" android:textSize="14sp"
app:drawableStartCompat="@drawable/ic_cp_age_insulin" /> app:drawableStartCompat="@drawable/ic_cp_age_insulin" />
<TextView <TextView
android:id="@+id/insulin_age_label" android:id="@+id/insulin_age_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -153,7 +151,7 @@
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:layout_span="5" android:layout_span="5"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</TableRow> </TableRow>
@ -226,11 +224,12 @@
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:layout_span="5" android:layout_span="5"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</TableRow> </TableRow>
<TableRow <TableRow
android:id="@+id/battery_layout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:focusable="true"> android:focusable="true">
@ -246,7 +245,6 @@
android:textSize="14sp" android:textSize="14sp"
app:drawableStartCompat="@drawable/ic_cp_age_battery" /> app:drawableStartCompat="@drawable/ic_cp_age_battery" />
<TextView <TextView
android:id="@+id/pb_age_label" android:id="@+id/pb_age_label"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -290,20 +288,4 @@
</TableRow> </TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:layout_span="5"
android:background="@color/list_delimiter" />
</TableRow>
</TableLayout> </TableLayout>

View file

@ -1,232 +0,0 @@
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="0,2,4"
tools:context=".plugins.general.actions.ActionsFragment">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="25dp"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingEnd="2dp"
android:text="@string/careportal_sensor_label"
android:textSize="14sp"
app:drawableStartCompat="@drawable/ic_cp_age_sensor" />
<TextView
android:id="@+id/sensor_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/sensor_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:gravity="center_vertical"
android:paddingStart="2dp"
android:textColor="@android:color/white"
android:textSize="14sp"
tools:ignore="RtlSymmetry" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:layout_span="3"
android:background="@color/list_delimiter" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="25dp"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingEnd="2dp"
android:text="@string/careportal_insulin_label"
android:textSize="14sp"
app:drawableStartCompat="@drawable/ic_cp_age_insulin" />
<TextView
android:id="@+id/insulin_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/reservoir_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:gravity="center_vertical"
android:paddingStart="2dp"
android:textColor="@android:color/white"
android:textSize="14sp"
tools:ignore="RtlSymmetry" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:layout_span="3"
android:background="@color/list_delimiter" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="true">
<TextView
android:id="@+id/cannula_or_patch"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingEnd="2dp"
android:text="@string/cannula"
android:textSize="14sp"
app:drawableStartCompat="@drawable/ic_cp_age_cannula" />
<TextView
android:id="@+id/cannula_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:gravity="center_vertical"
android:paddingStart="2dp"
android:text=""
android:textColor="@android:color/white"
android:textSize="14sp"
tools:ignore="RtlSymmetry" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:layout_span="3"
android:background="@color/list_delimiter" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="true">
<TextView
android:id="@+id/pb_label"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingEnd="2dp"
android:text="@string/pump"
android:textSize="14sp"
app:drawableStartCompat="@drawable/ic_cp_age_battery" />
<TextView
android:id="@+id/pb_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/battery_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:gravity="center_vertical"
android:paddingStart="2dp"
android:textColor="@android:color/white"
android:textSize="14sp"
tools:ignore="RtlSymmetry" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:layout_span="3"
android:background="@color/list_delimiter" />
</TableRow>
</TableLayout>

View file

@ -160,7 +160,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>
@ -270,7 +270,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>
@ -393,7 +393,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/cancel" android:id="@+id/cancel"

View file

@ -340,7 +340,7 @@
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:id="@+id/result" android:id="@+id/result"
@ -441,7 +441,7 @@
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<TableRow <TableRow
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -133,7 +133,7 @@
android:layout_height="2dip" android:layout_height="2dip"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -61,7 +61,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -108,7 +108,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -154,7 +154,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -200,7 +200,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -246,7 +246,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -292,7 +292,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -338,7 +338,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -384,7 +384,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -430,7 +430,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -476,7 +476,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -522,7 +522,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -68,7 +68,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -94,7 +94,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -140,7 +140,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -186,7 +186,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -232,7 +232,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -278,7 +278,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -324,7 +324,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -370,7 +370,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -416,7 +416,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -442,7 +442,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<View <View
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -451,7 +451,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -497,7 +497,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -543,7 +543,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -589,7 +589,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -1,25 +1,27 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".plugins.general.overview.activities.QuickWizardListActivity"> tools:context=".plugins.general.overview.activities.QuickWizardListActivity">
<com.google.android.material.button.MaterialButton
android:id="@+id/add_button"
style="@style/GrayButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/overview_editquickwizardlistactivity_add" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="wrap_content" />
</LinearLayout> <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:clickable="true"
android:contentDescription="@string/addnew"
android:focusable="true"
android:src="@drawable/ic_add_black_24dp"
tools:ignore="RelativeOverlap" />
</RelativeLayout>

View file

@ -2,7 +2,7 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/overview_quickwizard_cardview" android:id="@+id/cardview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -47,7 +47,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/overview_quickwizard_item_buttonText" android:id="@+id/buttonText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
@ -58,7 +58,7 @@
tools:ignore="HardcodedText,RtlSymmetry" /> tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/overview_quickwizard_item_carbs" android:id="@+id/carbs"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
@ -71,12 +71,11 @@
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@+id/overview_quickwizard_item_device" android:id="@+id/device"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="false" android:adjustViewBounds="false"
android:cropToPadding="false" android:cropToPadding="false"
android:paddingEnd="10dp"
android:scaleType="fitStart" android:scaleType="fitStart"
card_view:srcCompat="@drawable/ic_smartphone" card_view:srcCompat="@drawable/ic_smartphone"
tools:ignore="RtlSymmetry" /> tools:ignore="RtlSymmetry" />
@ -90,6 +89,13 @@
android:scaleType="fitStart" android:scaleType="fitStart"
card_view:srcCompat="@drawable/ic_reorder_gray_24dp" /> card_view:srcCompat="@drawable/ic_reorder_gray_24dp" />
<CheckBox
android:id="@+id/cb_remove"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:contentDescription="@string/select_for_removal"
android:minWidth="0dp"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -107,7 +113,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" /> android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<TextView <TextView
android:id="@+id/overview_quickwizard_item_from" android:id="@+id/from"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@ -124,7 +130,7 @@
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/overview_quickwizard_item_to" android:id="@+id/to"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@ -136,31 +142,9 @@
</LinearLayout> </LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
style="@style/GrayButton"
android:id="@+id/overview_quickwizard_item_edit_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/overview_quickwizard_item_edit_button" />
<com.google.android.material.button.MaterialButton
style="@style/GrayButton"
android:id="@+id/overview_quickwizard_item_remove_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/remove_button" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -94,6 +94,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/battery_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1" android:layout_weight="1"

View file

@ -20,7 +20,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -285,7 +285,7 @@ android:visibility="gone"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -20,7 +20,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -129,7 +129,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -20,7 +20,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -176,7 +176,7 @@
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -20,7 +20,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -141,7 +141,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -20,7 +20,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -195,7 +195,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -20,7 +20,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -164,7 +164,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -15,7 +15,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
android:gravity="center" android:gravity="center"
android:text="1.1.2000" android:text="1.1.2000"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -93,7 +93,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" android:background="?android:attr/dividerHorizontal"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/notes" /> app:layout_constraintTop_toBottomOf="@id/notes" />

View file

@ -65,7 +65,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -110,7 +110,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -155,7 +155,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -201,7 +201,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -247,7 +247,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -293,7 +293,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -339,7 +339,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -0,0 +1,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/nav_remove_items"
android:orderInCategory="0"
android:title="@string/remove_bg_readings"
app:showAsAction="never" />
</menu>

View file

@ -2,45 +2,57 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MainActivity"> tools:context=".MainActivity">
<item <item
android:id="@+id/nav_preferences" android:id="@+id/nav_preferences"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_preferences" /> android:title="@string/nav_preferences" />
<item <item
android:id="@+id/nav_plugin_preferences" android:id="@+id/nav_plugin_preferences"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_plugin_preferences" /> android:title="@string/nav_plugin_preferences" />
<item <item
android:id="@+id/nav_treatments" android:id="@+id/nav_treatments"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/treatments" /> android:title="@string/treatments" />
<item <item
android:id="@+id/nav_historybrowser" android:id="@+id/nav_historybrowser"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_historybrowser" /> android:title="@string/nav_historybrowser" />
<item <item
android:id="@+id/nav_setupwizard" android:id="@+id/nav_setupwizard"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_setupwizard" /> android:title="@string/nav_setupwizard" />
<item <item
android:id="@+id/nav_stats" android:id="@+id/nav_stats"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/statistics" /> android:title="@string/statistics" />
<!-- <item <!-- <item
android:id="@+id/nav_survey" android:id="@+id/nav_survey"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_survey" /> android:title="@string/nav_survey" />
--> -->
<item <item
android:id="@+id/nav_defaultprofile" android:id="@+id/nav_defaultprofile"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_profilehelper" /> android:title="@string/nav_profilehelper" />
<item <item
android:id="@+id/nav_about" android:id="@+id/nav_about"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_about" /> android:title="@string/nav_about" />
<item <item
android:id="@+id/nav_exit" android:id="@+id/nav_exit"
android:orderInCategory="1"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/nav_exit" /> android:title="@string/nav_exit" />
</menu> </menu>

View file

@ -0,0 +1,14 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/nav_remove_items"
android:title="@string/remove_items"
app:showAsAction="never" />
<item
android:id="@+id/nav_sort_items"
android:title="@string/sort_items"
app:showAsAction="never" />
</menu>

View file

@ -827,6 +827,7 @@
<string name="show_invalidated">Show invalidated</string> <string name="show_invalidated">Show invalidated</string>
<string name="hide_invalidated">Hide invalidated</string> <string name="hide_invalidated">Hide invalidated</string>
<string name="remove_items">Remove items</string> <string name="remove_items">Remove items</string>
<string name="sort_items">Sort items</string>
<string name="storedsettingsfound">Stored settings found</string> <string name="storedsettingsfound">Stored settings found</string>
<string name="allow_hardware_pump_text">Attention: If you activate and connect to a hardware pump, AndroidAPS will copy the basal settings from the profile to the pump, overwriting the existing basal rate stored on the pump. Make sure you have the correct basal setting in AndroidAPS. If you are not sure or don\'t want to overwrite the basal settings on your pump, press cancel and repeat switching to the pump at a later time.</string> <string name="allow_hardware_pump_text">Attention: If you activate and connect to a hardware pump, AndroidAPS will copy the basal settings from the profile to the pump, overwriting the existing basal rate stored on the pump. Make sure you have the correct basal setting in AndroidAPS. If you are not sure or don\'t want to overwrite the basal settings on your pump, press cancel and repeat switching to the pump at a later time.</string>
<string name="error_adding_treatment_title">Treatment data incomplete</string> <string name="error_adding_treatment_title">Treatment data incomplete</string>
@ -1139,6 +1140,7 @@
<string name="errors">Errors</string> <string name="errors">Errors</string>
<string name="ns_sync_slow">Slow down uploads</string> <string name="ns_sync_slow">Slow down uploads</string>
<string name="data_status">BG data status</string> <string name="data_status">BG data status</string>
<string name="remove_bg_readings">Remove BG readings</string>
<string name="statuslights_cannula_age">cannula age</string> <string name="statuslights_cannula_age">cannula age</string>
<string name="statuslights_patch_pump_age">patch pump age</string> <string name="statuslights_patch_pump_age">patch pump age</string>
<string name="patch_pump">Patch pump</string> <string name="patch_pump">Patch pump</string>
@ -1222,4 +1224,6 @@
<string name="hide_loop">Hide loop</string> <string name="hide_loop">Hide loop</string>
<string name="show_loop">Show loop</string> <string name="show_loop">Show loop</string>
<string name="count_selected">%1$d selected</string> <string name="count_selected">%1$d selected</string>
<string name="sort_label">Sort</string>
<string name="dialog_cancled">Dialog canceled</string>
</resources> </resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory <PreferenceCategory
android:key="@string/key_configbuilder_general_settings" android:key="@string/key_configbuilder_general_settings"
@ -24,9 +25,8 @@
<EditTextPreference <EditTextPreference
android:inputType="textPersonName" android:inputType="textPersonName"
android:key="@string/key_patient_name" android:key="@string/key_patient_name"
android:title="@string/patient_name"
android:summary="@string/patient_name_summary" android:summary="@string/patient_name_summary"
/> android:title="@string/patient_name" />
<PreferenceCategory <PreferenceCategory
android:key="@string/key_protection_settings" android:key="@string/key_protection_settings"
@ -35,8 +35,7 @@
<Preference <Preference
android:inputType="textPassword" android:inputType="textPassword"
android:key="@string/key_master_password" android:key="@string/key_master_password"
android:title="@string/master_password" android:title="@string/master_password" />
/>
<ListPreference <ListPreference
android:defaultValue="0" android:defaultValue="0"
@ -83,6 +82,16 @@
android:key="@string/key_bolus_pin" android:key="@string/key_bolus_pin"
android:title="@string/bolus_pin" /> android:title="@string/bolus_pin" />
<EditTextPreference
android:inputType="number"
android:key="@string/key_protection_timeout"
android:title="@string/protection_timeout_title"
android:summary="@string/protection_timeout_summary"
app:defaultValue="0"
validate:maxNumber="180"
validate:minNumber="0"
validate:testType="numeric" />
</PreferenceCategory> </PreferenceCategory>
<info.nightscout.androidaps.skins.SkinListPreference <info.nightscout.androidaps.skins.SkinListPreference

View file

@ -148,7 +148,7 @@
android:layout_height="2dip" android:layout_height="2dip"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -63,7 +63,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -109,7 +109,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
@ -157,7 +157,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -203,7 +203,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -249,7 +249,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -295,7 +295,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -341,7 +341,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -387,7 +387,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -433,7 +433,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -480,7 +480,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:id="@+id/combo_connection_error_layout" android:id="@+id/combo_connection_error_layout"
@ -528,7 +528,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -14,6 +14,7 @@ dependencies {
api "androidx.browser:browser:1.3.0" api "androidx.browser:browser:1.3.0"
api "androidx.activity:activity-ktx:${activity_version}" api "androidx.activity:activity-ktx:${activity_version}"
api "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" api "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
api "androidx.lifecycle:lifecycle-process:$lifecycle_version"
api 'androidx.cardview:cardview:1.0.0' api 'androidx.cardview:cardview:1.0.0'
api 'androidx.recyclerview:recyclerview:1.2.1' api 'androidx.recyclerview:recyclerview:1.2.1'
api 'androidx.gridlayout:gridlayout:1.0.0' api 'androidx.gridlayout:gridlayout:1.0.0'

View file

@ -276,4 +276,9 @@ interface Pump {
* if true APS set 100% basal before full hour to avoid pump beeping * if true APS set 100% basal before full hour to avoid pump beeping
*/ */
fun setNeutralTempAtFullHour(): Boolean = false fun setNeutralTempAtFullHour(): Boolean = false
/**
* Pumps with a hardware link can set via config "Battery Change Logging"
*/
fun isBatteryChangeLoggingEnabled(): Boolean = false
} }

View file

@ -39,6 +39,7 @@ class PumpDescription() {
var needsManualTDDLoad = false var needsManualTDDLoad = false
var hasCustomUnreachableAlertCheck = false var hasCustomUnreachableAlertCheck = false
var isPatchPump = false var isPatchPump = false
var useHardwareLink = false
fun resetSettings() { fun resetSettings() {
isBolusCapable = true isBolusCapable = true
@ -68,6 +69,7 @@ class PumpDescription() {
supportsTDDs = false supportsTDDs = false
needsManualTDDLoad = true needsManualTDDLoad = true
hasCustomUnreachableAlertCheck = false hasCustomUnreachableAlertCheck = false
useHardwareLink = false
} }
fun fillFor(pumpType: PumpType) { fun fillFor(pumpType: PumpType) {
@ -105,6 +107,7 @@ class PumpDescription() {
is30minBasalRatesCapable = pumpCapability.hasCapability(PumpCapability.BasalRate30min) is30minBasalRatesCapable = pumpCapability.hasCapability(PumpCapability.BasalRate30min)
hasCustomUnreachableAlertCheck = pumpType.hasCustomUnreachableAlertCheck hasCustomUnreachableAlertCheck = pumpType.hasCustomUnreachableAlertCheck
isPatchPump = pumpType.isPatchPump isPatchPump = pumpType.isPatchPump
useHardwareLink = pumpType.useHardwareLink
} }
companion object { companion object {

View file

@ -52,7 +52,8 @@ enum class PumpType {
baseBasalStep = 0.01, baseBasalStep = 0.01,
baseBasalSpecialSteps = DoseStepSize.ComboBasal, baseBasalSpecialSteps = DoseStepSize.ComboBasal,
pumpCapability = PumpCapability.ComboCapabilities, pumpCapability = PumpCapability.ComboCapabilities,
source = Sources.Combo), source = Sources.Combo,
supportBatteryLevel = false),
ACCU_CHEK_SPIRIT(description = "Accu-Chek Spirit", ACCU_CHEK_SPIRIT(description = "Accu-Chek Spirit",
manufacturer = ManufacturerType.Roche, manufacturer = ManufacturerType.Roche,
model = "Spirit", model = "Spirit",
@ -185,6 +186,8 @@ enum class PumpType {
pumpCapability = PumpCapability.OmnipodCapabilities, pumpCapability = PumpCapability.OmnipodCapabilities,
hasCustomUnreachableAlertCheck = true, hasCustomUnreachableAlertCheck = true,
isPatchPump = true, isPatchPump = true,
useHardwareLink = true,
supportBatteryLevel = false,
source = Sources.OmnipodEros), source = Sources.OmnipodEros),
OMNIPOD_DASH(description = "Omnipod Dash", OMNIPOD_DASH(description = "Omnipod Dash",
manufacturer = ManufacturerType.Insulet, manufacturer = ManufacturerType.Insulet,
@ -201,7 +204,8 @@ enum class PumpType {
baseBasalSpecialSteps = null, baseBasalSpecialSteps = null,
isPatchPump = true, isPatchPump = true,
pumpCapability = PumpCapability.OmnipodCapabilities, pumpCapability = PumpCapability.OmnipodCapabilities,
hasCustomUnreachableAlertCheck = false), hasCustomUnreachableAlertCheck = false,
supportBatteryLevel = false),
MEDTRONIC_512_712(description = "Medtronic 512/712", MEDTRONIC_512_712(description = "Medtronic 512/712",
manufacturer = ManufacturerType.Medtronic, manufacturer = ManufacturerType.Medtronic,
model = "512/712", model = "512/712",
@ -313,7 +317,8 @@ enum class PumpType {
baseBasalStep = 0.01, baseBasalStep = 0.01,
baseBasalSpecialSteps = null, baseBasalSpecialSteps = null,
pumpCapability = PumpCapability.DanaWithHistoryCapabilities, pumpCapability = PumpCapability.DanaWithHistoryCapabilities,
source = Sources.DiaconnG8); source = Sources.DiaconnG8,
useHardwareLink = true);
val description: String val description: String
var manufacturer: ManufacturerType? = null var manufacturer: ManufacturerType? = null
@ -356,6 +361,10 @@ enum class PumpType {
private set private set
var isPatchPump = false var isPatchPump = false
private set private set
var supportBatteryLevel = true
private set
var useHardwareLink = false
private set
private var parent: PumpType? = null private var parent: PumpType? = null
val source: Sources val source: Sources
@ -424,6 +433,8 @@ enum class PumpType {
pumpCapability: PumpCapability, pumpCapability: PumpCapability,
hasCustomUnreachableAlertCheck: Boolean = false, hasCustomUnreachableAlertCheck: Boolean = false,
isPatchPump: Boolean = false, isPatchPump: Boolean = false,
supportBatteryLevel: Boolean = true,
useHardwareLink: Boolean = false,
source: Sources = Sources.VirtualPump) { source: Sources = Sources.VirtualPump) {
this.description = description this.description = description
this.manufacturer = manufacturer this.manufacturer = manufacturer
@ -441,6 +452,8 @@ enum class PumpType {
this.pumpCapability = pumpCapability this.pumpCapability = pumpCapability
this.hasCustomUnreachableAlertCheck = hasCustomUnreachableAlertCheck this.hasCustomUnreachableAlertCheck = hasCustomUnreachableAlertCheck
this.isPatchPump = isPatchPump this.isPatchPump = isPatchPump
this.supportBatteryLevel = supportBatteryLevel
this.useHardwareLink = useHardwareLink
this.source = source this.source = source
} }

View file

@ -2,16 +2,22 @@ package info.nightscout.androidaps.utils.protection
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import info.nightscout.androidaps.core.R import info.nightscout.androidaps.core.R
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP
import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@Singleton @Singleton
class ProtectionCheck @Inject constructor( class ProtectionCheck @Inject constructor(
val sp: SP, val sp: SP,
val passwordCheck: PasswordCheck val passwordCheck: PasswordCheck,
val dateUtil: DateUtil
) { ) {
private var lastAuthorization = mutableListOf(0L, 0L, 0L)
private val timeout = TimeUnit.SECONDS.toMillis(sp.getInt(R.string.key_protection_timeout, 0).toLong())
enum class Protection { enum class Protection {
PREFERENCES, PREFERENCES,
APPLICATION, APPLICATION,
@ -52,6 +58,9 @@ class ProtectionCheck @Inject constructor(
R.string.bolus_pin) R.string.bolus_pin)
fun isLocked(protection: Protection): Boolean { fun isLocked(protection: Protection): Boolean {
if (activeSession(protection)) {
return false
}
return when (ProtectionType.values()[sp.getInt(protectionTypeResourceIDs[protection.ordinal], ProtectionType.NONE.ordinal)]) { return when (ProtectionType.values()[sp.getInt(protectionTypeResourceIDs[protection.ordinal], ProtectionType.NONE.ordinal)]) {
ProtectionType.NONE -> false ProtectionType.NONE -> false
ProtectionType.BIOMETRIC -> true ProtectionType.BIOMETRIC -> true
@ -61,19 +70,38 @@ class ProtectionCheck @Inject constructor(
} }
} }
fun queryProtection(activity: FragmentActivity, protection: Protection, fun resetAuthorization() {
ok: Runnable?, cancel: Runnable? = null, fail: Runnable? = null) { lastAuthorization = mutableListOf(0L, 0L, 0L)
}
private fun activeSession(protection: Protection): Boolean {
val last = lastAuthorization[protection.ordinal]
val diff = dateUtil.now() - last
return diff < timeout
}
private fun onOk(protection: Protection) {
lastAuthorization[protection.ordinal] = dateUtil.now()
}
fun queryProtection(activity: FragmentActivity, protection: Protection, ok: Runnable?, cancel: Runnable? = null, fail: Runnable? = null) {
if (activeSession(protection)) {
onOk(protection)
ok?.run()
return
}
when (ProtectionType.values()[sp.getInt(protectionTypeResourceIDs[protection.ordinal], ProtectionType.NONE.ordinal)]) { when (ProtectionType.values()[sp.getInt(protectionTypeResourceIDs[protection.ordinal], ProtectionType.NONE.ordinal)]) {
ProtectionType.NONE -> ProtectionType.NONE ->
ok?.run() ok?.run()
ProtectionType.BIOMETRIC -> ProtectionType.BIOMETRIC ->
BiometricCheck.biometricPrompt(activity, titlePassResourceIDs[protection.ordinal], ok, cancel, fail, passwordCheck) BiometricCheck.biometricPrompt(activity, titlePassResourceIDs[protection.ordinal], { onOk(protection); ok?.run() }, cancel, fail, passwordCheck)
ProtectionType.MASTER_PASSWORD -> ProtectionType.MASTER_PASSWORD ->
passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { onOk(protection); ok?.run() }, { cancel?.run() }, { fail?.run() })
ProtectionType.CUSTOM_PASSWORD -> ProtectionType.CUSTOM_PASSWORD ->
passwordCheck.queryPassword(activity, titlePassResourceIDs[protection.ordinal], passwordsResourceIDs[protection.ordinal], { ok?.run() }, { cancel?.run() }, { fail?.run() }) passwordCheck.queryPassword(activity, titlePassResourceIDs[protection.ordinal], passwordsResourceIDs[protection.ordinal], { onOk(protection); ok?.run() }, { cancel?.run() }, { fail?.run() })
ProtectionType.CUSTOM_PIN -> ProtectionType.CUSTOM_PIN ->
passwordCheck.queryPassword(activity, titlePinResourceIDs[protection.ordinal], pinsResourceIDs[protection.ordinal], { ok?.run() }, { cancel?.run() }, { fail?.run() }, true) passwordCheck.queryPassword(activity, titlePinResourceIDs[protection.ordinal], pinsResourceIDs[protection.ordinal], { onOk(protection); ok?.run() }, { cancel?.run() }, { fail?.run() }, true)
} }
} }
} }

View file

@ -118,7 +118,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -164,7 +164,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -210,7 +210,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -262,7 +262,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -314,7 +314,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -402,7 +402,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -163,7 +163,7 @@
android:layout_marginTop="7dp" android:layout_marginTop="7dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:layout_marginBottom="3dp" android:layout_marginBottom="3dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -12,6 +12,8 @@
<string name="application_pin">Application PIN</string> <string name="application_pin">Application PIN</string>
<string name="bolus_password">Bolus password</string> <string name="bolus_password">Bolus password</string>
<string name="bolus_pin">Bolus PIN</string> <string name="bolus_pin">Bolus PIN</string>
<string name="protection_timeout_title">Password and PIN retention [s]</string>
<string name="protection_timeout_summary">Time before the password or PIN should be entered</string>
<string name="unlock_settings">Unlock settings</string> <string name="unlock_settings">Unlock settings</string>
<string name="biometric">Biometric</string> <string name="biometric">Biometric</string>
<string name="custom_password">Custom password</string> <string name="custom_password">Custom password</string>
@ -43,4 +45,5 @@
<string name="key_settings_protection" translatable="false">settings_protection</string> <string name="key_settings_protection" translatable="false">settings_protection</string>
<string name="key_application_protection" translatable="false">application_protection</string> <string name="key_application_protection" translatable="false">application_protection</string>
<string name="key_bolus_protection" translatable="false">bolus_protection</string> <string name="key_bolus_protection" translatable="false">bolus_protection</string>
<string name="key_protection_timeout" translatable="false">protection_timeout</string>
</resources> </resources>

View file

@ -28,6 +28,8 @@
<item name="notificationLow">@color/notificationLow</item> <item name="notificationLow">@color/notificationLow</item>
<item name="notificationInfo">@color/notificationInfo</item> <item name="notificationInfo">@color/notificationInfo</item>
<item name="notificationAnnouncement">@color/notificationAnnouncement</item> <item name="notificationAnnouncement">@color/notificationAnnouncement</item>
<item name="actionModeCloseDrawable">@drawable/ic_close</item>
</style> </style>
<style name="AppTheme.NoActionBar" parent="Theme.MaterialComponents.NoActionBar"> <style name="AppTheme.NoActionBar" parent="Theme.MaterialComponents.NoActionBar">

View file

@ -65,7 +65,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:id="@+id/bt_connection_layout" android:id="@+id/bt_connection_layout"
@ -117,7 +117,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -167,7 +167,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -216,7 +216,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -265,7 +265,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -314,7 +314,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -363,7 +363,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -412,7 +412,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -461,7 +461,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -510,7 +510,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -559,7 +559,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -608,7 +608,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<ImageView <ImageView
android:id="@+id/dana_icon" android:id="@+id/dana_icon"

View file

@ -103,7 +103,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>

View file

@ -67,7 +67,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<Switch <Switch
android:id="@+id/buttonscroll" android:id="@+id/buttonscroll"
@ -86,7 +86,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<Switch <Switch
android:id="@+id/beep" android:id="@+id/beep"
@ -105,7 +105,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -158,7 +158,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -193,7 +193,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -230,7 +230,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<Switch <Switch
android:id="@+id/units" android:id="@+id/units"
@ -251,7 +251,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -286,7 +286,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -542,7 +542,7 @@ class DiaconnG8Plugin @Inject constructor(
override fun executeCustomAction(customActionType: CustomActionType) {} override fun executeCustomAction(customActionType: CustomActionType) {}
override fun canHandleDST(): Boolean = false override fun canHandleDST(): Boolean = false
fun isBatteryChangeLoggingEnabled():Boolean { override fun isBatteryChangeLoggingEnabled():Boolean {
return sp.getBoolean(R.string.key_diaconn_g8_logbatterychange, false) return sp.getBoolean(R.string.key_diaconn_g8_logbatterychange, false)
} }

View file

@ -84,7 +84,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -142,7 +142,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -190,7 +190,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -237,7 +237,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -284,7 +284,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -331,7 +331,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -378,7 +378,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -425,7 +425,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -472,7 +472,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -519,7 +519,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -566,7 +566,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -613,7 +613,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -660,7 +660,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<TextView <TextView
android:layout_width="150dp" android:layout_width="150dp"

View file

@ -73,7 +73,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -141,7 +141,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -223,7 +223,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -304,7 +304,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout

View file

@ -4,4 +4,4 @@
android:layout_height="2dip" android:layout_height="2dip"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />

View file

@ -46,7 +46,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -99,7 +99,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:id="@+id/rl_battery_layout" android:id="@+id/rl_battery_layout"
@ -154,7 +154,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -213,7 +213,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -263,7 +263,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -312,7 +312,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -362,7 +362,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -411,7 +411,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -460,7 +460,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
@ -511,7 +511,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -560,7 +560,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -304,7 +304,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -353,7 +353,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -402,7 +402,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -451,7 +451,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -500,7 +500,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -549,7 +549,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -598,7 +598,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -647,7 +647,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -696,7 +696,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -22,7 +22,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<include layout="@layout/omnipod_dash_overview_bluetooth_status" /> <include layout="@layout/omnipod_dash_overview_bluetooth_status" />

View file

@ -167,5 +167,5 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</merge> </merge>

View file

@ -1083,7 +1083,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements Pump, Riley
return aapsOmnipodErosManager.isShowRileyLinkBatteryLevel(); return aapsOmnipodErosManager.isShowRileyLinkBatteryLevel();
} }
public boolean isBatteryChangeLoggingEnabled() { @Override public boolean isBatteryChangeLoggingEnabled() {
return aapsOmnipodErosManager.isBatteryChangeLoggingEnabled(); return aapsOmnipodErosManager.isBatteryChangeLoggingEnabled();
} }

View file

@ -22,7 +22,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
<include layout="@layout/omnipod_eros_overview_riley_link_status" /> <include layout="@layout/omnipod_eros_overview_riley_link_status" />

View file

@ -50,5 +50,5 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" /> android:background="?android:attr/dividerHorizontal" />
</merge> </merge>