simplify :core:utils

This commit is contained in:
Milos Kozak 2023-09-18 23:28:32 +02:00
parent 81eb4f3a1c
commit ebcea9eed8
61 changed files with 54 additions and 206 deletions

View file

@ -13,6 +13,9 @@ apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle"
android { android {
namespace 'info.nightscout.interfaces' namespace 'info.nightscout.interfaces'
defaultConfig {
minSdkVersion 25 // for wear
}
} }
dependencies { dependencies {

View file

@ -8,6 +8,7 @@ import android.view.MenuItem
import androidx.core.view.MenuCompat import androidx.core.view.MenuCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import info.nightscout.core.main.R
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper
class ActionModeHelper<T>(val rh: ResourceHelper, val activity: FragmentActivity?, val fragment: Fragment?) { class ActionModeHelper<T>(val rh: ResourceHelper, val activity: FragmentActivity?, val fragment: Fragment?) {

View file

@ -23,6 +23,7 @@ class CryptoUtil @Inject constructor(
) { ) {
companion object { companion object {
private const val IV_LENGTH_BYTE = 12 private const val IV_LENGTH_BYTE = 12
private const val TAG_LENGTH_BIT = 128 private const val TAG_LENGTH_BIT = 128
private const val AES_KEY_SIZE_BIT = 256 private const val AES_KEY_SIZE_BIT = 256

View file

@ -2,4 +2,9 @@
<resources> <resources>
<string name="format_carbs">%1$d g</string> <string name="format_carbs">%1$d g</string>
<string name="count_selected">%1$d selected</string>
<string name="remove_items">Remove Items</string>
<string name="sort_items">Sort Items</string>
<string name="remove_selected_items">Remove Selected Items</string>
<string name="sort_label">Sort</string>
</resources> </resources>

View file

@ -18,7 +18,10 @@ android {
dependencies { dependencies {
implementation project(':app-wear-shared:shared') api "com.google.dagger:dagger-android:$dagger_version"
api "com.google.dagger:dagger-android-support:$dagger_version"
api "net.danlew:android.joda:$joda_version"
//Firebase //Firebase
api platform('com.google.firebase:firebase-bom:32.3.1') api platform('com.google.firebase:firebase-bom:32.3.1')

View file

@ -2,11 +2,11 @@ package info.nightscout.core.utils.receivers
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import androidx.annotation.OpenForTesting
import androidx.work.Data import androidx.work.Data
import androidx.work.ExistingWorkPolicy import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequest import androidx.work.OneTimeWorkRequest
import androidx.work.WorkManager import androidx.work.WorkManager
import info.nightscout.annotations.OpenForTesting
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import javax.inject.Inject import javax.inject.Inject

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d избрано</string>
<string name="remove_items">Премахни артикули</string>
<string name="sort_items">Подреди артикули</string>
<string name="remove_selected_items">Премахнете избраните елементи</string>
<string name="sort_label">Сортирай</string>
</resources>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">Vybráno: %1$d</string>
<string name="remove_items">Odebrat položky</string>
<string name="sort_items">Seřadit položky</string>
<string name="remove_selected_items">Odebrat vybrané položky</string>
<string name="sort_label">Seřadit</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d valgt</string>
<string name="remove_items">Fjern Emner</string>
<string name="sort_items">Sortér Emner</string>
<string name="remove_selected_items">Fjern valgte emner</string>
<string name="sort_label">Sortér</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d ausgewählt</string>
<string name="remove_items">Entferne Elemente</string>
<string name="sort_items">Sortiere Elemente</string>
<string name="remove_selected_items">lösche ausgewählte Elemente</string>
<string name="sort_label">Sortieren</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">Επιλέχθηκε %1$d</string>
<string name="remove_items">Αφαίρεση Στοιχείων</string>
<string name="sort_items">Ταξινόμηση Στοιχείων</string>
<string name="remove_selected_items">Αφαίρεση Επιλεγμένων Στοιχείων</string>
<string name="sort_label">Ταξινόμηση</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d seleccionado</string>
<string name="remove_items">Eliminar elementos</string>
<string name="sort_items">Ordenar elementos</string>
<string name="remove_selected_items">Eliminar elementos seleccionados</string>
<string name="sort_label">Ordenar</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d séléctionné(s)</string>
<string name="remove_items">Supprimer les éléments</string>
<string name="sort_items">Trier les éléments</string>
<string name="remove_selected_items">Supprimer les éléments sélectionnés</string>
<string name="sort_label">Trier</string>
</resources>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d selezionati</string>
<string name="remove_items">Rimuovi elementi</string>
<string name="sort_items">Ordina elementi</string>
<string name="remove_selected_items">Rimuovi elementi selezionati</string>
<string name="sort_label">Ordina</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d נבחרו</string>
<string name="remove_items">פריטים שהוסרו</string>
<string name="sort_items">מיין פריטים</string>
<string name="remove_selected_items">הסר פריטים נבחרים</string>
<string name="sort_label">מיין</string>
</resources>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d 선택됨</string>
<string name="remove_items">항목 제거하기</string>
<string name="sort_items">항목 분류하기</string>
<string name="remove_selected_items">선택된 항목 제거하기</string>
<string name="sort_label">분류</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d pasirinkta</string>
<string name="remove_items">Pašalinti elementus</string>
<string name="sort_items">Rūšiuoti elementus</string>
<string name="remove_selected_items">Pašalinti pasirinktus elementus</string>
<string name="sort_label">Rūšiuoti</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d geselecteerd</string>
<string name="remove_items">Items verwijderen</string>
<string name="sort_items">Sorteer items</string>
<string name="remove_selected_items">Verwijder geselecteerde items</string>
<string name="sort_label">Sorteren</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d valgt</string>
<string name="remove_items">Slett elementer</string>
<string name="sort_items">Sorter elementer</string>
<string name="remove_selected_items">Slett valgte elementer</string>
<string name="sort_label">Sorter</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">Wybrany %1$d</string>
<string name="remove_items">Usuń pozycje</string>
<string name="sort_items">Sortuj pozycje</string>
<string name="remove_selected_items">Usuń zaznaczone pozycje</string>
<string name="sort_label">Sortuj</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">Selecionado %1$d</string>
<string name="remove_items">Remover itens</string>
<string name="sort_items">Ordenar Itens</string>
<string name="remove_selected_items">Remover itens selecionados</string>
<string name="sort_label">Ordenar</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d selecionados</string>
<string name="remove_items">Remover itens</string>
<string name="sort_items">Ordenar itens</string>
<string name="remove_selected_items">Remover itens selecionados</string>
<string name="sort_label">Ordenar</string>
</resources>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sort_label">Sortează</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">Выбрано: %1$d</string>
<string name="remove_items">Удалить элементы</string>
<string name="sort_items">Сортировать элементы</string>
<string name="remove_selected_items">Удалить выбранные элементы</string>
<string name="sort_label">Сортировать</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d vybraných</string>
<string name="remove_items">Odstrániť položky</string>
<string name="sort_items">Zoradiť položky</string>
<string name="remove_selected_items">Odstrániť vybrané položky</string>
<string name="sort_label">Zoradiť</string>
</resources>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d valt</string>
<string name="remove_items">Ta bort objekt</string>
<string name="sort_items">Sortera objekt</string>
<string name="remove_selected_items">Ta bort valda objekt</string>
<string name="sort_label">Sortera</string>
</resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d seçildi</string>
<string name="remove_items">Öğeleri kaldır</string>
<string name="sort_items">Öğeleri Sırala</string>
<string name="remove_selected_items">Seçilen öğeleri kaldır</string>
<string name="sort_label">Sırala</string>
</resources>

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">已选中 %1$d 项</string>
<string name="remove_items">删除项目</string>
<string name="sort_items">项目排序</string>
<string name="remove_selected_items">删除选中项</string>
<string name="sort_label">排序</string>
</resources>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="count_selected">%1$d selected</string>
<string name="remove_items">Remove Items</string>
<string name="sort_items">Sort Items</string>
<string name="remove_selected_items">Remove Selected Items</string>
<string name="sort_label">Sort</string>
</resources>

View file

@ -41,8 +41,6 @@ files:
translation: /core/main/src/main/res/values-%android_code%/strings.xml translation: /core/main/src/main/res/values-%android_code%/strings.xml
- source: /core/interfaces/src/main/res/values/strings.xml - source: /core/interfaces/src/main/res/values/strings.xml
translation: /core/interfaces/src/main/res/values-%android_code%/strings.xml translation: /core/interfaces/src/main/res/values-%android_code%/strings.xml
- source: /core/utils/src/main/res/values/strings.xml
translation: /core/utils/src/main/res/values-%android_code%/strings.xml
- source: /core/ui/src/main/res/values/protection.xml - source: /core/ui/src/main/res/values/protection.xml
translation: /core/ui/src/main/res/values-%android_code%/protection.xml translation: /core/ui/src/main/res/values-%android_code%/protection.xml
- source: /core/validators/src/main/res/values/validator.xml - source: /core/validators/src/main/res/values/validator.xml

View file

@ -12,6 +12,9 @@ apply from: "${project.rootDir}/core/main/test_dependencies.gradle"
android { android {
namespace 'info.nightscout.database.entities' namespace 'info.nightscout.database.entities'
defaultConfig {
minSdkVersion 25 // for wear
}
buildFeatures { buildFeatures {
buildConfig = false buildConfig = false

View file

@ -18,6 +18,7 @@ android {
dependencies { dependencies {
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:validators') implementation project(':core:validators')

View file

@ -21,6 +21,7 @@ android {
dependencies { dependencies {
implementation project(':core:libraries') implementation project(':core:libraries')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')

View file

@ -27,6 +27,7 @@ android {
dependencies { dependencies {
implementation project(':core:libraries') implementation project(':core:libraries')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')

View file

@ -18,6 +18,7 @@ dependencies {
implementation 'androidx.media3:media3-common:1.1.1' implementation 'androidx.media3:media3-common:1.1.1'
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:validators') implementation project(':core:validators')

View file

@ -31,6 +31,7 @@ android {
dependencies { dependencies {
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:validators') implementation project(':core:validators')

View file

@ -29,6 +29,7 @@ dependencies {
implementation project(':app-wear-shared:shared-impl') implementation project(':app-wear-shared:shared-impl')
implementation project(':core:libraries') implementation project(':core:libraries')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:ui') implementation project(':core:ui')

View file

@ -24,6 +24,7 @@ dependencies {
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')
implementation project(':database:entities') implementation project(':database:entities')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:ui') implementation project(':core:ui')

View file

@ -18,6 +18,7 @@ dependencies {
implementation project(':core:libraries') implementation project(':core:libraries')
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:validators') implementation project(':core:validators')

View file

@ -14,11 +14,10 @@ import info.nightscout.interfaces.notifications.Notification
import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.ActivePlugin
import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.Profile
import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.profile.ProfileFunction
import info.nightscout.interfaces.pump.BolusProgressData
import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.DetailedBolusInfo
import info.nightscout.interfaces.pump.DetailedBolusInfoStorage import info.nightscout.interfaces.pump.DetailedBolusInfoStorage
import info.nightscout.interfaces.pump.BolusProgressData
import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.interfaces.pump.defs.PumpType
import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.Callback
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.interfaces.ui.UiInteraction
@ -28,7 +27,27 @@ import info.nightscout.pump.medtrum.R
import info.nightscout.pump.medtrum.code.ConnectionState import info.nightscout.pump.medtrum.code.ConnectionState
import info.nightscout.pump.medtrum.comm.enums.AlarmState import info.nightscout.pump.medtrum.comm.enums.AlarmState
import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState
import info.nightscout.pump.medtrum.comm.packets.* import info.nightscout.pump.medtrum.comm.packets.ActivatePacket
import info.nightscout.pump.medtrum.comm.packets.AuthorizePacket
import info.nightscout.pump.medtrum.comm.packets.CancelBolusPacket
import info.nightscout.pump.medtrum.comm.packets.CancelTempBasalPacket
import info.nightscout.pump.medtrum.comm.packets.ClearPumpAlarmPacket
import info.nightscout.pump.medtrum.comm.packets.GetDeviceTypePacket
import info.nightscout.pump.medtrum.comm.packets.GetRecordPacket
import info.nightscout.pump.medtrum.comm.packets.GetTimePacket
import info.nightscout.pump.medtrum.comm.packets.MedtrumPacket
import info.nightscout.pump.medtrum.comm.packets.NotificationPacket
import info.nightscout.pump.medtrum.comm.packets.PrimePacket
import info.nightscout.pump.medtrum.comm.packets.ResumePumpPacket
import info.nightscout.pump.medtrum.comm.packets.SetBasalProfilePacket
import info.nightscout.pump.medtrum.comm.packets.SetBolusPacket
import info.nightscout.pump.medtrum.comm.packets.SetPatchPacket
import info.nightscout.pump.medtrum.comm.packets.SetTempBasalPacket
import info.nightscout.pump.medtrum.comm.packets.SetTimePacket
import info.nightscout.pump.medtrum.comm.packets.SetTimeZonePacket
import info.nightscout.pump.medtrum.comm.packets.StopPatchPacket
import info.nightscout.pump.medtrum.comm.packets.SubscribePacket
import info.nightscout.pump.medtrum.comm.packets.SynchronizePacket
import info.nightscout.pump.medtrum.util.MedtrumSnUtil import info.nightscout.pump.medtrum.util.MedtrumSnUtil
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus

View file

@ -30,6 +30,7 @@ dependencies {
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')
implementation project(':core:libraries') implementation project(':core:libraries')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:validators') implementation project(':core:validators')

View file

@ -30,6 +30,7 @@ dependencies {
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')
implementation project(':core:libraries') implementation project(':core:libraries')
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':core:ui') implementation project(':core:ui')
implementation project(':core:validators') implementation project(':core:validators')

View file

@ -16,6 +16,7 @@ android {
dependencies { dependencies {
implementation project(':core:interfaces') implementation project(':core:interfaces')
implementation project(':core:main')
implementation project(':core:utils') implementation project(':core:utils')
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')

View file

@ -156,7 +156,7 @@ class QuickWizardListActivity : TranslatedDaggerAppCompatActivity(), OnStartDrag
} }
addMenuProvider(object : MenuProvider { addMenuProvider(object : MenuProvider {
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) { override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {
menuInflater.inflate(info.nightscout.core.utils.R.menu.menu_actions, menu) menuInflater.inflate(info.nightscout.core.main.R.menu.menu_actions, menu)
} }
override fun onMenuItemSelected(menuItem: MenuItem): Boolean = override fun onMenuItemSelected(menuItem: MenuItem): Boolean =

View file

@ -95,6 +95,7 @@ allprojects {
dependencies { dependencies {
implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared')
implementation project(':app-wear-shared:shared-impl') implementation project(':app-wear-shared:shared-impl')
implementation project(':core:interfaces')
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')