core -> core-main
This commit is contained in:
parent
efd4d43a50
commit
6cc67e52a4
548 changed files with 1489 additions and 1480 deletions
|
@ -7,9 +7,9 @@ plugins {
|
|||
id 'kotlinx-serialization'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/jacoco_global.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
||||
|
||||
android {
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ plugins {
|
|||
id 'kotlinx-serialization'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle"
|
||||
|
||||
android {
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@ plugins {
|
|||
id 'com.hiya.jacoco-android'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/jacoco_global.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
||||
|
||||
android {
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ plugins {
|
|||
id 'com.google.firebase.crashlytics'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/jacoco_global.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@ -185,7 +185,7 @@ dependencies {
|
|||
implementation project(':app-wear-shared:rx')
|
||||
implementation project(':app-wear-shared:shared')
|
||||
implementation project(':app-wear-shared:shared-impl')
|
||||
implementation project(':core')
|
||||
implementation project(':core:core-main')
|
||||
implementation project(':interfaces')
|
||||
implementation project(':ui')
|
||||
implementation project(':plugins')
|
||||
|
@ -227,7 +227,7 @@ dependencies {
|
|||
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle"
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -130,7 +130,7 @@ class MainApp : DaggerApplication() {
|
|||
InsertIfNewByTimestampTherapyEventTransaction(
|
||||
timestamp = dateUtil.now(),
|
||||
type = TherapyEvent.Type.NOTE,
|
||||
note = rh.get().gs(info.nightscout.androidaps.core.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL,
|
||||
note = rh.get().gs(info.nightscout.core.main.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL,
|
||||
glucoseUnit = TherapyEvent.GlucoseUnit.MGDL
|
||||
)
|
||||
)
|
||||
|
|
|
@ -6,8 +6,8 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.main.databinding.DialogBolusprogressBinding
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.configBuilder
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.androidaps.data.ProfileSealed
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.ValueWrapper
|
||||
|
|
|
@ -9,7 +9,7 @@ import android.content.Intent
|
|||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.TaskStackBuilder
|
||||
import info.nightscout.androidaps.MainActivity
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.interfaces.IconsProvider
|
||||
import info.nightscout.interfaces.NotificationHolder
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
|
|
|
@ -6,11 +6,11 @@ plugins {
|
|||
id 'com.hiya.jacoco-android'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/jacoco_global.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
||||
|
||||
android {
|
||||
namespace 'info.nightscout.automation'
|
||||
|
@ -18,7 +18,7 @@ android {
|
|||
|
||||
dependencies {
|
||||
implementation project(':graphview')
|
||||
implementation project(':core')
|
||||
implementation project(':core:core-main')
|
||||
implementation project(':database')
|
||||
implementation project(':app-wear-shared:rx')
|
||||
implementation project(':app-wear-shared:shared')
|
||||
|
|
|
@ -45,15 +45,15 @@ class ActionAlarmTest : TestBase() {
|
|||
|
||||
@Before
|
||||
fun setup() {
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.ok)).thenReturn("OK")
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.alarm)).thenReturn("Alarm")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.alarm)).thenReturn("Alarm")
|
||||
`when`(rh.gs(ArgumentMatchers.eq(R.string.alarm_message), ArgumentMatchers.anyString())).thenReturn("Alarm: %s")
|
||||
|
||||
sut = ActionAlarm(injector)
|
||||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.alarm, sut.friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.alarm, sut.friendlyName())
|
||||
}
|
||||
|
||||
@Test fun shortDescriptionTest() {
|
||||
|
@ -62,7 +62,7 @@ class ActionAlarmTest : TestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_access_alarm_24dp, sut.icon())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_access_alarm_24dp, sut.icon())
|
||||
}
|
||||
|
||||
@Test fun doActionTest() {
|
||||
|
|
|
@ -23,7 +23,7 @@ class ActionCarePortalEventTest : ActionsTestBase() {
|
|||
`when`(sp.getString(ArgumentMatchers.anyString(), ArgumentMatchers.anyString())).thenReturn("AAPS")
|
||||
`when`(
|
||||
rh.gs(
|
||||
ArgumentMatchers.eq(info.nightscout.androidaps.core.R.string.careportal_note_message),
|
||||
ArgumentMatchers.eq(info.nightscout.core.main.R.string.careportal_note_message),
|
||||
ArgumentMatchers.anyString()
|
||||
)
|
||||
).thenReturn("Note : %s")
|
||||
|
@ -40,7 +40,7 @@ class ActionCarePortalEventTest : ActionsTestBase() {
|
|||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.careportal, sut.friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.careportal, sut.friendlyName())
|
||||
}
|
||||
|
||||
@Test fun shortDescriptionTest() {
|
||||
|
@ -48,7 +48,7 @@ class ActionCarePortalEventTest : ActionsTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_cp_note, sut.icon())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_cp_note, sut.icon())
|
||||
}
|
||||
|
||||
@Test fun doActionTest() {
|
||||
|
|
|
@ -18,7 +18,7 @@ class ActionLoopDisableTest : ActionsTestBase() {
|
|||
fun setup() {
|
||||
|
||||
testPumpPlugin.pumpDescription.isTempBasalCapable = true
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.disableloop)).thenReturn("Disable loop")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.disableloop)).thenReturn("Disable loop")
|
||||
`when`(rh.gs(R.string.alreadydisabled)).thenReturn("Disable loop")
|
||||
|
||||
sut = ActionLoopDisable(injector)
|
||||
|
@ -26,7 +26,7 @@ class ActionLoopDisableTest : ActionsTestBase() {
|
|||
|
||||
@Test
|
||||
fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.disableloop, sut.friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.disableloop, sut.friendlyName())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -17,14 +17,14 @@ class ActionLoopEnableTest : ActionsTestBase() {
|
|||
fun setup() {
|
||||
|
||||
testPumpPlugin.pumpDescription.isTempBasalCapable = true
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.enableloop)).thenReturn("Enable loop")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.enableloop)).thenReturn("Enable loop")
|
||||
`when`(rh.gs(R.string.alreadyenabled)).thenReturn("Already enabled")
|
||||
|
||||
sut = ActionLoopEnable(injector)
|
||||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.enableloop, sut.friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.enableloop, sut.friendlyName())
|
||||
}
|
||||
|
||||
@Test fun shortDescriptionTest() {
|
||||
|
|
|
@ -18,14 +18,14 @@ class ActionLoopResumeTest : ActionsTestBase() {
|
|||
@Before
|
||||
fun setup() {
|
||||
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.resumeloop)).thenReturn("Resume loop")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.resumeloop)).thenReturn("Resume loop")
|
||||
`when`(rh.gs(R.string.notsuspended)).thenReturn("Not suspended")
|
||||
|
||||
sut = ActionLoopResume(injector)
|
||||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.resumeloop, sut.friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.resumeloop, sut.friendlyName())
|
||||
}
|
||||
|
||||
@Test fun shortDescriptionTest() {
|
||||
|
|
|
@ -17,7 +17,7 @@ class ActionLoopSuspendTest : ActionsTestBase() {
|
|||
@Before
|
||||
fun setup() {
|
||||
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.suspendloop)).thenReturn("Suspend loop")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.suspendloop)).thenReturn("Suspend loop")
|
||||
`when`(rh.gs(ArgumentMatchers.eq(R.string.suspendloopforXmin), ArgumentMatchers.anyInt())).thenReturn("Suspend loop for %d min")
|
||||
`when`(rh.gs(R.string.alreadysuspended)).thenReturn("Already suspended")
|
||||
|
||||
|
@ -25,7 +25,7 @@ class ActionLoopSuspendTest : ActionsTestBase() {
|
|||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.suspendloop, sut.friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.suspendloop, sut.friendlyName())
|
||||
}
|
||||
|
||||
@Test fun shortDescriptionTest() {
|
||||
|
|
|
@ -43,8 +43,8 @@ class ActionNotificationTest : TestBase() {
|
|||
|
||||
@Before
|
||||
fun setup() {
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.ok)).thenReturn("OK")
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.notification)).thenReturn("Notification")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.notification)).thenReturn("Notification")
|
||||
`when`(
|
||||
rh.gs(
|
||||
ArgumentMatchers.eq(R.string.notification_message),
|
||||
|
@ -58,7 +58,7 @@ class ActionNotificationTest : TestBase() {
|
|||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.notification, sut.friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.notification, sut.friendlyName())
|
||||
}
|
||||
|
||||
@Test fun shortDescriptionTest() {
|
||||
|
|
|
@ -18,7 +18,7 @@ class ActionProfileSwitchPercentTest : ActionsTestBase() {
|
|||
fun setup() {
|
||||
|
||||
`when`(rh.gs(R.string.startprofileforever)).thenReturn("Start profile %d%%")
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.startprofile)).thenReturn("Start profile %d%% for %d min")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.startprofile)).thenReturn("Start profile %d%% for %d min")
|
||||
|
||||
sut = ActionProfileSwitchPercent(injector)
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class ActionProfileSwitchPercentTest : ActionsTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_actions_profileswitch, sut.icon())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_actions_profileswitch, sut.icon())
|
||||
}
|
||||
|
||||
@Test fun doActionTest() {
|
||||
|
|
|
@ -23,9 +23,9 @@ class ActionProfileSwitchTest : ActionsTestBase() {
|
|||
`when`(rh.gs(R.string.profilename)).thenReturn("Change profile to")
|
||||
`when`(rh.gs(ArgumentMatchers.eq(R.string.changengetoprofilename), ArgumentMatchers.anyString())).thenReturn("Change profile to %s")
|
||||
`when`(rh.gs(R.string.alreadyset)).thenReturn("Already set")
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.notexists)).thenReturn("not exists")
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.error_field_must_not_be_empty)).thenReturn("The field must not be empty")
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.noprofile)).thenReturn("No profile loaded from NS yet")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.notexists)).thenReturn("not exists")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.error_field_must_not_be_empty)).thenReturn("The field must not be empty")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.noprofile)).thenReturn("No profile loaded from NS yet")
|
||||
|
||||
sut = ActionProfileSwitch(injector)
|
||||
}
|
||||
|
@ -107,6 +107,6 @@ class ActionProfileSwitchTest : ActionsTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_actions_profileswitch, sut.icon())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_actions_profileswitch, sut.icon())
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ class ActionStartTempTargetTest : ActionsTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_temptarget_high, sut.icon())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_temptarget_high, sut.icon())
|
||||
}
|
||||
|
||||
@Test fun doActionTest() {
|
||||
|
|
|
@ -180,7 +180,7 @@ ActionsTestBase : TestBaseWithProfile() {
|
|||
`when`(activePlugin.activeProfileSource).thenReturn(profilePlugin)
|
||||
`when`(profilePlugin.profile).thenReturn(getValidProfileStore())
|
||||
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.ok)).thenReturn("OK")
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.error)).thenReturn("Error")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK")
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.error)).thenReturn("Error")
|
||||
}
|
||||
}
|
|
@ -11,8 +11,8 @@ class StaticLabelTest : TriggerTestBase() {
|
|||
@Test fun constructor() {
|
||||
var sl = StaticLabel(rh, "any", TriggerDummy(injector))
|
||||
Assert.assertEquals("any", sl.label)
|
||||
`when`(rh.gs(info.nightscout.androidaps.core.R.string.pumplimit)).thenReturn("pump limit")
|
||||
sl = StaticLabel(rh, info.nightscout.androidaps.core.R.string.pumplimit, TriggerDummy(injector))
|
||||
`when`(rh.gs(info.nightscout.core.main.R.string.pumplimit)).thenReturn("pump limit")
|
||||
sl = StaticLabel(rh, info.nightscout.core.main.R.string.pumplimit, TriggerDummy(injector))
|
||||
Assert.assertEquals("pump limit", sl.label)
|
||||
}
|
||||
}
|
|
@ -16,8 +16,8 @@ class TriggerAutosensValueTest : TriggerTestBase() {
|
|||
|
||||
var now = 1514766900000L
|
||||
@Test fun shouldRunTest() {
|
||||
`when`(sp.getDouble(Mockito.eq(info.nightscout.androidaps.core.R.string.key_openapsama_autosens_max), ArgumentMatchers.anyDouble())).thenReturn(1.2)
|
||||
`when`(sp.getDouble(Mockito.eq(info.nightscout.androidaps.core.R.string.key_openapsama_autosens_min), ArgumentMatchers.anyDouble())).thenReturn(0.7)
|
||||
`when`(sp.getDouble(Mockito.eq(info.nightscout.core.main.R.string.key_openapsama_autosens_max), ArgumentMatchers.anyDouble())).thenReturn(1.2)
|
||||
`when`(sp.getDouble(Mockito.eq(info.nightscout.core.main.R.string.key_openapsama_autosens_min), ArgumentMatchers.anyDouble())).thenReturn(0.7)
|
||||
`when`(autosensDataStore.getLastAutosensData(anyObject(), anyObject(), anyObject())).thenReturn(generateAutosensData())
|
||||
var t = TriggerAutosensValue(injector)
|
||||
t.autosens.value = 110.0
|
||||
|
|
|
@ -33,7 +33,7 @@ class TriggerBTDeviceTest : TriggerTestBase() {
|
|||
|
||||
@Test
|
||||
fun icon() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_bluetooth_white_48dp), TriggerBTDevice(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_bluetooth_white_48dp), TriggerBTDevice(injector).icon())
|
||||
}
|
||||
|
||||
@Test fun duplicate() {
|
||||
|
|
|
@ -76,7 +76,7 @@ class TriggerBgTest : TriggerTestBase() {
|
|||
|
||||
@Test
|
||||
fun iconTest() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_cp_bgcheck), TriggerBg(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_cp_bgcheck), TriggerBg(injector).icon())
|
||||
}
|
||||
|
||||
private fun generateOneCurrentRecordBgData(): List<GlucoseValue> {
|
||||
|
|
|
@ -94,6 +94,6 @@ class TriggerBolusAgoTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_bolus), TriggerBolusAgo(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_bolus), TriggerBolusAgo(injector).icon())
|
||||
}
|
||||
}
|
|
@ -61,7 +61,7 @@ class TriggerCOBTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_cp_bolus_carbs), TriggerCOB(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_cp_bolus_carbs), TriggerCOB(injector).icon())
|
||||
}
|
||||
|
||||
fun generateCobInfo(): CobInfo {
|
||||
|
|
|
@ -60,7 +60,7 @@ class TriggerProfilePercentTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_actions_profileswitch), TriggerProfilePercent(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_actions_profileswitch), TriggerProfilePercent(injector).icon())
|
||||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
|
|
|
@ -61,7 +61,7 @@ class TriggerPumpLastConnectionTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_remove), TriggerPumpLastConnection(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_remove), TriggerPumpLastConnection(injector).icon())
|
||||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
|
|
|
@ -65,6 +65,6 @@ class TriggerTimeRangeTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_access_alarm_24dp), TriggerTimeRange(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_access_alarm_24dp), TriggerTimeRange(injector).icon())
|
||||
}
|
||||
}
|
|
@ -48,7 +48,7 @@ class TriggerTimeTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.time, TriggerTime(injector).friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.time, TriggerTime(injector).friendlyName())
|
||||
}
|
||||
|
||||
@Test fun friendlyDescriptionTest() {
|
||||
|
@ -56,6 +56,6 @@ class TriggerTimeTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun iconTest() {
|
||||
Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_access_alarm_24dp), TriggerTime(injector).icon())
|
||||
Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_access_alarm_24dp), TriggerTime(injector).icon())
|
||||
}
|
||||
}
|
|
@ -65,7 +65,7 @@ class TriggerWifiSsidTest : TriggerTestBase() {
|
|||
}
|
||||
|
||||
@Test fun friendlyNameTest() {
|
||||
Assert.assertEquals(info.nightscout.androidaps.core.R.string.ns_wifi_ssids, TriggerWifiSsid(injector).friendlyName())
|
||||
Assert.assertEquals(info.nightscout.core.main.R.string.ns_wifi_ssids, TriggerWifiSsid(injector).friendlyName())
|
||||
}
|
||||
|
||||
@Test fun friendlyDescriptionTest() {
|
||||
|
|
0
core/.gitignore → core/core-main/.gitignore
vendored
0
core/.gitignore → core/core-main/.gitignore
vendored
|
@ -7,11 +7,11 @@ plugins {
|
|||
id 'com.hiya.jacoco-android'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/jacoco_global.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation project(':graphview')
|
||||
|
@ -92,5 +92,5 @@ dependencies {
|
|||
}
|
||||
|
||||
android {
|
||||
namespace 'info.nightscout.androidaps.core'
|
||||
namespace 'info.nightscout.core.main'
|
||||
}
|
|
@ -5,7 +5,7 @@ import android.content.pm.PackageManager
|
|||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.core.app.ActivityCompat
|
||||
import dagger.android.support.DaggerAppCompatActivity
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.interfaces.ImportExportPrefs
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.activities
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.interfaces.locale.LocaleHelper
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventThemeSwitch
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.data
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.androidaps.database.data.Block
|
||||
import info.nightscout.androidaps.database.data.TargetBlock
|
||||
import info.nightscout.androidaps.database.embedments.InsulinConfiguration
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.data
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||
import info.nightscout.interfaces.utils.Round
|
|
@ -9,8 +9,8 @@ import android.view.Window
|
|||
import android.view.WindowManager
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.activities.DialogAppCompatActivity
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.main.databinding.DialogBolusprogressBinding
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
|
@ -13,7 +13,7 @@ import com.google.android.material.datepicker.MaterialDatePicker
|
|||
import com.google.android.material.timepicker.MaterialTimePicker
|
||||
import com.google.android.material.timepicker.TimeFormat
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
|
@ -12,8 +12,8 @@ import android.view.Window
|
|||
import android.view.WindowManager
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.activities.DialogAppCompatActivity
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.core.databinding.DialogErrorBinding
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.main.databinding.DialogErrorBinding
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
|
@ -9,8 +9,8 @@ import android.view.Window
|
|||
import android.view.WindowManager
|
||||
import dagger.android.HasAndroidInjector
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.core.databinding.DialogProfileviewerBinding
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.main.databinding.DialogProfileviewerBinding
|
||||
import info.nightscout.androidaps.data.ProfileSealed
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.database.ValueWrapper
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.events
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
|
||||
class EventPumpStatusChanged : EventStatus {
|
|
@ -1,91 +1,91 @@
|
|||
package info.nightscout.androidaps.extensions
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import info.nightscout.shared.extensions.runOnUiThread
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
|
||||
class EmptyRecyclerView : RecyclerView {
|
||||
|
||||
private var mEmptyView: View? = null
|
||||
private var mLoadingView: View? = null
|
||||
private var mIsLoading = true
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
|
||||
|
||||
private fun updateEmptyView() {
|
||||
runOnUiThread {
|
||||
val isEmpty = !mIsLoading && (adapter == null || adapter?.itemCount == 0)
|
||||
visibility = isEmpty.not().toVisibility()
|
||||
mEmptyView?.visibility = isEmpty.toVisibility()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateLoadingView() {
|
||||
runOnUiThread {
|
||||
mLoadingView?.visibility = mIsLoading.toVisibility()
|
||||
}
|
||||
}
|
||||
|
||||
private val observer: AdapterDataObserver = object : AdapterDataObserver() {
|
||||
override fun onChanged() {
|
||||
super.onChanged()
|
||||
updateEmptyView()
|
||||
}
|
||||
|
||||
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
||||
super.onItemRangeInserted(positionStart, itemCount)
|
||||
updateEmptyView()
|
||||
}
|
||||
|
||||
override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) {
|
||||
super.onItemRangeRemoved(positionStart, itemCount)
|
||||
updateEmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setAdapter(adapter: Adapter<*>?) {
|
||||
val oldAdapter = getAdapter()
|
||||
super.setAdapter(adapter)
|
||||
update(oldAdapter, adapter)
|
||||
}
|
||||
|
||||
override fun swapAdapter(adapter: Adapter<*>?, removeAndRecycleExistingViews: Boolean) {
|
||||
val oldAdapter = getAdapter()
|
||||
super.swapAdapter(adapter, removeAndRecycleExistingViews)
|
||||
update(oldAdapter, adapter)
|
||||
}
|
||||
|
||||
var emptyView: View?
|
||||
get() = mEmptyView
|
||||
set(view) {
|
||||
mEmptyView = view
|
||||
updateEmptyView()
|
||||
}
|
||||
|
||||
var loadingView: View?
|
||||
get() = mLoadingView
|
||||
set(view) {
|
||||
mLoadingView = view
|
||||
updateLoadingView()
|
||||
}
|
||||
|
||||
var isLoading: Boolean
|
||||
get() = mIsLoading
|
||||
set(loading) {
|
||||
mIsLoading = loading
|
||||
updateLoadingView()
|
||||
}
|
||||
|
||||
private fun update(oldAdapter: Adapter<*>?, newAdapter: Adapter<*>?) {
|
||||
oldAdapter?.unregisterAdapterDataObserver(observer)
|
||||
newAdapter?.registerAdapterDataObserver(observer)
|
||||
updateEmptyView()
|
||||
isLoading = false
|
||||
updateLoadingView()
|
||||
}
|
||||
}
|
||||
package info.nightscout.androidaps.extensions
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import info.nightscout.shared.extensions.runOnUiThread
|
||||
import info.nightscout.shared.extensions.toVisibility
|
||||
|
||||
class EmptyRecyclerView : RecyclerView {
|
||||
|
||||
private var mEmptyView: View? = null
|
||||
private var mLoadingView: View? = null
|
||||
private var mIsLoading = true
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
|
||||
|
||||
private fun updateEmptyView() {
|
||||
runOnUiThread {
|
||||
val isEmpty = !mIsLoading && (adapter == null || adapter?.itemCount == 0)
|
||||
visibility = isEmpty.not().toVisibility()
|
||||
mEmptyView?.visibility = isEmpty.toVisibility()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateLoadingView() {
|
||||
runOnUiThread {
|
||||
mLoadingView?.visibility = mIsLoading.toVisibility()
|
||||
}
|
||||
}
|
||||
|
||||
private val observer: AdapterDataObserver = object : AdapterDataObserver() {
|
||||
override fun onChanged() {
|
||||
super.onChanged()
|
||||
updateEmptyView()
|
||||
}
|
||||
|
||||
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
||||
super.onItemRangeInserted(positionStart, itemCount)
|
||||
updateEmptyView()
|
||||
}
|
||||
|
||||
override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) {
|
||||
super.onItemRangeRemoved(positionStart, itemCount)
|
||||
updateEmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setAdapter(adapter: Adapter<*>?) {
|
||||
val oldAdapter = getAdapter()
|
||||
super.setAdapter(adapter)
|
||||
update(oldAdapter, adapter)
|
||||
}
|
||||
|
||||
override fun swapAdapter(adapter: Adapter<*>?, removeAndRecycleExistingViews: Boolean) {
|
||||
val oldAdapter = getAdapter()
|
||||
super.swapAdapter(adapter, removeAndRecycleExistingViews)
|
||||
update(oldAdapter, adapter)
|
||||
}
|
||||
|
||||
var emptyView: View?
|
||||
get() = mEmptyView
|
||||
set(view) {
|
||||
mEmptyView = view
|
||||
updateEmptyView()
|
||||
}
|
||||
|
||||
var loadingView: View?
|
||||
get() = mLoadingView
|
||||
set(view) {
|
||||
mLoadingView = view
|
||||
updateLoadingView()
|
||||
}
|
||||
|
||||
var isLoading: Boolean
|
||||
get() = mIsLoading
|
||||
set(loading) {
|
||||
mIsLoading = loading
|
||||
updateLoadingView()
|
||||
}
|
||||
|
||||
private fun update(oldAdapter: Adapter<*>?, newAdapter: Adapter<*>?) {
|
||||
oldAdapter?.unregisterAdapterDataObserver(observer)
|
||||
newAdapter?.registerAdapterDataObserver(observer)
|
||||
updateEmptyView()
|
||||
isLoading = false
|
||||
updateLoadingView()
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.extensions
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||
import info.nightscout.interfaces.GlucoseUnit
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
|
@ -5,7 +5,7 @@ import android.content.Context
|
|||
import android.view.Gravity
|
||||
import android.widget.TableRow
|
||||
import android.widget.TextView
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.androidaps.database.entities.TotalDailyDose
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.extensions
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||
|
||||
fun GlucoseValue.TrendArrow.directionToIcon(): Int {
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.extensions
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||
|
||||
fun ColorGroup.colorId(): Int {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue