remove :ui dependency
|
@ -39,6 +39,7 @@ import info.nightscout.ui.dialogs.TempBasalDialog
|
||||||
import info.nightscout.ui.dialogs.TempTargetDialog
|
import info.nightscout.ui.dialogs.TempTargetDialog
|
||||||
import info.nightscout.ui.dialogs.TreatmentDialog
|
import info.nightscout.ui.dialogs.TreatmentDialog
|
||||||
import info.nightscout.ui.dialogs.WizardDialog
|
import info.nightscout.ui.dialogs.WizardDialog
|
||||||
|
import info.nightscout.ui.widget.Widget
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class UiInteractionImpl @Inject constructor(
|
class UiInteractionImpl @Inject constructor(
|
||||||
|
@ -67,6 +68,10 @@ class UiInteractionImpl @Inject constructor(
|
||||||
context.startActivity(i)
|
context.startActivity(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun updateWidget(context: Context) {
|
||||||
|
Widget.updateWidget(context)
|
||||||
|
}
|
||||||
|
|
||||||
override fun runWizardDialog(fragmentManager: FragmentManager, carbs: Int?, name: String?) {
|
override fun runWizardDialog(fragmentManager: FragmentManager, carbs: Int?, name: String?) {
|
||||||
WizardDialog().also { dialog ->
|
WizardDialog().also { dialog ->
|
||||||
dialog.arguments = Bundle().also { bundle ->
|
dialog.arguments = Bundle().also { bundle ->
|
||||||
|
|
|
@ -31,6 +31,9 @@ interface UiInteraction {
|
||||||
* @param soundId sound resource. if == 0 alarm is not started
|
* @param soundId sound resource. if == 0 alarm is not started
|
||||||
*/
|
*/
|
||||||
fun runAlarm(status: String, title: String, @RawRes soundId: Int = 0)
|
fun runAlarm(status: String, title: String, @RawRes soundId: Int = 0)
|
||||||
|
|
||||||
|
fun updateWidget(context: Context)
|
||||||
|
|
||||||
fun runWizardDialog(fragmentManager: FragmentManager, carbs: Int? = null, name: String? = null)
|
fun runWizardDialog(fragmentManager: FragmentManager, carbs: Int? = null, name: String? = null)
|
||||||
fun runLoopDialog(fragmentManager: FragmentManager, showOkCancel: Int)
|
fun runLoopDialog(fragmentManager: FragmentManager, showOkCancel: Int)
|
||||||
fun runProfileSwitchDialog(fragmentManager: FragmentManager, profileName: String? = null)
|
fun runProfileSwitchDialog(fragmentManager: FragmentManager, profileName: String? = null)
|
||||||
|
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 7 KiB After Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
@ -26,7 +26,6 @@ dependencies {
|
||||||
implementation project(':core:interfaces')
|
implementation project(':core:interfaces')
|
||||||
implementation project(':core:ui')
|
implementation project(':core:ui')
|
||||||
implementation project(':core:utils')
|
implementation project(':core:utils')
|
||||||
implementation project(':ui')
|
|
||||||
|
|
||||||
// Protection
|
// Protection
|
||||||
api 'androidx.biometric:biometric:1.1.0'
|
api 'androidx.biometric:biometric:1.1.0'
|
||||||
|
|
|
@ -13,6 +13,7 @@ import info.nightscout.database.entities.TemporaryBasal
|
||||||
import info.nightscout.database.entities.TemporaryTarget
|
import info.nightscout.database.entities.TemporaryTarget
|
||||||
import info.nightscout.database.entities.TherapyEvent
|
import info.nightscout.database.entities.TherapyEvent
|
||||||
import info.nightscout.database.impl.AppRepository
|
import info.nightscout.database.impl.AppRepository
|
||||||
|
import info.nightscout.interfaces.ui.UiInteraction
|
||||||
import info.nightscout.rx.bus.RxBus
|
import info.nightscout.rx.bus.RxBus
|
||||||
import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged
|
import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged
|
||||||
import info.nightscout.rx.events.EventExtendedBolusChange
|
import info.nightscout.rx.events.EventExtendedBolusChange
|
||||||
|
@ -27,24 +28,24 @@ import info.nightscout.rx.events.EventTherapyEventChange
|
||||||
import info.nightscout.rx.events.EventTreatmentChange
|
import info.nightscout.rx.events.EventTreatmentChange
|
||||||
import info.nightscout.rx.logging.AAPSLogger
|
import info.nightscout.rx.logging.AAPSLogger
|
||||||
import info.nightscout.rx.logging.LTag
|
import info.nightscout.rx.logging.LTag
|
||||||
import info.nightscout.ui.widget.Widget
|
|
||||||
import io.reactivex.rxjava3.disposables.Disposable
|
import io.reactivex.rxjava3.disposables.Disposable
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class CompatDBHelper @Inject constructor(
|
class CompatDBHelper @Inject constructor(
|
||||||
val aapsLogger: AAPSLogger,
|
private val aapsLogger: AAPSLogger,
|
||||||
val repository: AppRepository,
|
private val repository: AppRepository,
|
||||||
val rxBus: RxBus,
|
private val rxBus: RxBus,
|
||||||
val context: Context
|
private val context: Context,
|
||||||
|
private val uiInteraction: UiInteraction
|
||||||
) {
|
) {
|
||||||
|
|
||||||
fun dbChangeDisposable(): Disposable = repository
|
fun dbChangeDisposable(): Disposable = repository
|
||||||
.changeObservable()
|
.changeObservable()
|
||||||
.doOnSubscribe {
|
.doOnSubscribe {
|
||||||
rxBus.send(EventNewBG(null))
|
rxBus.send(EventNewBG(null))
|
||||||
Widget.updateWidget(context)
|
uiInteraction.updateWidget(context)
|
||||||
}
|
}
|
||||||
.subscribe {
|
.subscribe {
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +58,7 @@ class CompatDBHelper @Inject constructor(
|
||||||
it.filterIsInstance<GlucoseValue>().maxByOrNull { gv -> gv.timestamp }?.let { gv ->
|
it.filterIsInstance<GlucoseValue>().maxByOrNull { gv -> gv.timestamp }?.let { gv ->
|
||||||
aapsLogger.debug(LTag.DATABASE, "Firing EventNewBg $gv")
|
aapsLogger.debug(LTag.DATABASE, "Firing EventNewBg $gv")
|
||||||
rxBus.send(EventNewBG(gv.timestamp))
|
rxBus.send(EventNewBG(gv.timestamp))
|
||||||
Widget.updateWidget(context)
|
uiInteraction.updateWidget(context)
|
||||||
newestGlucoseValue = gv
|
newestGlucoseValue = gv
|
||||||
}
|
}
|
||||||
it.filterIsInstance<GlucoseValue>().minOfOrNull { gv -> gv.timestamp }?.let { timestamp ->
|
it.filterIsInstance<GlucoseValue>().minOfOrNull { gv -> gv.timestamp }?.let { timestamp ->
|
||||||
|
|
|
@ -11,9 +11,9 @@ class IconsProviderImplementation @Inject constructor(private val config: Config
|
||||||
|
|
||||||
override fun getIcon(): Int =
|
override fun getIcon(): Int =
|
||||||
when {
|
when {
|
||||||
config.NSCLIENT -> info.nightscout.ui.R.mipmap.ic_yellowowl
|
config.NSCLIENT -> info.nightscout.core.ui.R.mipmap.ic_yellowowl
|
||||||
config.PUMPCONTROL -> info.nightscout.ui.R.mipmap.ic_pumpcontrol
|
config.PUMPCONTROL -> info.nightscout.core.ui.R.mipmap.ic_pumpcontrol
|
||||||
else -> info.nightscout.ui.R.mipmap.ic_launcher
|
else -> info.nightscout.core.ui.R.mipmap.ic_launcher
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getNotificationIcon(): Int =
|
override fun getNotificationIcon(): Int =
|
||||||
|
|