:app :wear cleanup

This commit is contained in:
Milos Kozak 2023-09-26 18:29:58 +02:00
parent 2e3159fd60
commit 7c417e3519
106 changed files with 1723 additions and 1684 deletions

View file

@ -99,7 +99,7 @@ def allCommitted = { ->
android {
namespace 'info.nightscout.androidaps'
namespace 'app.aaps'
ndkVersion "21.1.6352462"
defaultConfig {

View file

@ -59,22 +59,20 @@ import app.aaps.core.ui.toast.ToastUtils
import app.aaps.core.utils.isRunningRealPumpTest
import app.aaps.database.entities.UserEntry.Action
import app.aaps.database.entities.UserEntry.Sources
import app.aaps.databinding.ActivityMainBinding
import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult
import app.aaps.plugins.configuration.activities.SingleFragmentActivity
import app.aaps.plugins.configuration.setupwizard.SetupWizardActivity
import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin
import app.aaps.ui.activities.ProfileHelperActivity
import app.aaps.ui.activities.StatsActivity
import app.aaps.ui.activities.TreatmentsActivity
import app.aaps.ui.tabs.TabPageAdapter
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.tabs.TabLayoutMediator
import com.google.firebase.crashlytics.FirebaseCrashlytics
import com.joanzapata.iconify.Iconify
import com.joanzapata.iconify.fonts.FontAwesomeModule
import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityMainBinding
import app.aaps.ui.activities.ProfileHelperActivity
import app.aaps.ui.activities.StatsActivity
import app.aaps.ui.activities.TreatmentsActivity
import app.aaps.ui.tabs.TabPageAdapter
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import java.io.File

View file

@ -42,15 +42,13 @@ import app.aaps.receivers.BTReceiver
import app.aaps.receivers.ChargingStateReceiver
import app.aaps.receivers.KeepAliveWorker
import app.aaps.receivers.TimeDateOrTZChangeReceiver
import app.aaps.ui.activityMonitor.ActivityMonitor
import app.aaps.ui.widget.Widget
import dagger.android.AndroidInjector
import dagger.android.DaggerApplication
import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.R
import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction
import info.nightscout.database.impl.transactions.VersionChangeTransaction
import app.aaps.ui.activityMonitor.ActivityMonitor
import app.aaps.ui.widget.Widget
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.exceptions.UndeliverableException
import io.reactivex.rxjava3.kotlin.plusAssign

View file

@ -30,11 +30,11 @@ import app.aaps.core.main.events.EventIobCalculationProgress
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.main.workflow.CalculationWorkflow
import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity
import app.aaps.databinding.ActivityHistorybrowseBinding
import app.aaps.plugins.main.general.overview.graphData.GraphData
import com.google.android.material.datepicker.MaterialDatePicker
import com.jjoe64.graphview.GraphView
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import java.util.Calendar

View file

@ -15,6 +15,7 @@ import androidx.preference.PreferenceGroup
import androidx.preference.PreferenceManager
import androidx.preference.PreferenceScreen
import androidx.preference.size
import app.aaps.R
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.nsclient.NSSettingsStatus
import app.aaps.core.interfaces.plugin.PluginBase
@ -60,7 +61,6 @@ import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin
import app.aaps.plugins.sync.tidepool.TidepoolPlugin
import app.aaps.plugins.sync.xdrip.XdripPlugin
import dagger.android.support.AndroidSupportInjection
import info.nightscout.androidaps.R
import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin
import info.nightscout.androidaps.danaRv2.DanaRv2Plugin
import info.nightscout.androidaps.danar.DanaRPlugin

View file

@ -8,9 +8,9 @@ import androidx.appcompat.widget.SearchView
import androidx.core.view.MenuProvider
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceScreen
import app.aaps.R
import app.aaps.databinding.ActivityPreferencesBinding
import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityPreferencesBinding
class PreferencesActivity : DaggerAppCompatActivityWithResult(), PreferenceFragmentCompat.OnPreferenceStartScreenCallback {

View file

@ -1,10 +1,10 @@
package app.aaps.implementations
import android.os.Build
import app.aaps.BuildConfig
import app.aaps.R
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.maintenance.PrefFileListProvider
import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.R
import java.io.File
import javax.inject.Inject
import javax.inject.Singleton

View file

@ -7,6 +7,7 @@ import androidx.annotation.RawRes
import androidx.annotation.StringRes
import androidx.fragment.app.FragmentManager
import app.aaps.MainActivity
import app.aaps.R
import app.aaps.activities.HistoryBrowseActivity
import app.aaps.activities.MyPreferenceFragment
import app.aaps.activities.PreferencesActivity
@ -18,8 +19,6 @@ import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.ui.toast.ToastUtils
import app.aaps.plugins.configuration.activities.SingleFragmentActivity
import app.aaps.plugins.main.general.overview.notifications.NotificationWithAction
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import app.aaps.ui.activities.BolusProgressHelperActivity
import app.aaps.ui.activities.ErrorHelperActivity
import app.aaps.ui.activities.QuickWizardListActivity
@ -41,6 +40,7 @@ import app.aaps.ui.dialogs.WizardDialog
import app.aaps.ui.services.AlarmSoundService
import app.aaps.ui.services.AlarmSoundServiceHelper
import app.aaps.ui.widget.Widget
import dagger.android.HasAndroidInjector
import javax.inject.Inject
class UiInteractionImpl @Inject constructor(

View file

@ -9,6 +9,7 @@ import androidx.work.WorkManager
import androidx.work.WorkQuery
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import app.aaps.R
import app.aaps.core.interfaces.alerts.LocalAlertUtils
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.configuration.Config
@ -28,7 +29,6 @@ import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.plugins.configuration.maintenance.MaintenancePlugin
import com.google.common.util.concurrent.ListenableFuture
import info.nightscout.androidaps.R
import info.nightscout.database.impl.AppRepository
import kotlinx.coroutines.Dispatchers
import java.util.concurrent.TimeUnit

View file

@ -13,7 +13,7 @@ fun isRunningTest(): Boolean {
@Synchronized
fun isRunningRealPumpTest(): Boolean {
return try {
Class.forName("info.nightscout.androidaps.RealPumpTest")
Class.forName("app.aaps.RealPumpTest")
true
} catch (e: ClassNotFoundException) {
false

View file

@ -80,7 +80,7 @@ android {
versionName version + "-aapsclient"
}
}
namespace 'info.nightscout.androidaps'
namespace 'app.aaps.wear'
}
allprojects {

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps
package app.aaps.wear
import android.content.Intent
import android.content.SharedPreferences
@ -8,19 +8,20 @@ import androidx.preference.PreferenceManager
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.wear.comm.DataHandlerWear
import app.aaps.wear.comm.DataLayerListenerServiceWear
import app.aaps.wear.comm.ExceptionHandlerWear
import app.aaps.wear.di.DaggerWearComponent
import app.aaps.wear.events.EventWearPreferenceChange
import dagger.android.AndroidInjector
import dagger.android.DaggerApplication
import info.nightscout.androidaps.comm.DataHandlerWear
import info.nightscout.androidaps.comm.DataLayerListenerServiceWear
import info.nightscout.androidaps.comm.ExceptionHandlerWear
import info.nightscout.androidaps.di.DaggerWearComponent
import info.nightscout.androidaps.events.EventWearPreferenceChange
import javax.inject.Inject
class WearApp : DaggerApplication(), OnSharedPreferenceChangeListener {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var rxBus: RxBus
@Suppress("unused")
@Inject lateinit var dataHandlerWear: DataHandlerWear // instantiate only
@Inject lateinit var exceptionHandlerWear: ExceptionHandlerWear

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.comm
package app.aaps.wear.comm
import android.annotation.TargetApi
import android.app.Notification
@ -22,15 +22,15 @@ import app.aaps.core.interfaces.rx.events.EventWearDataToMobile
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.wear.R
import app.aaps.wear.interaction.WatchfaceConfigurationActivity
import app.aaps.wear.interaction.actions.AcceptActivity
import app.aaps.wear.interaction.actions.ProfileSwitchActivity
import app.aaps.wear.interaction.utils.Persistence
import app.aaps.wear.tile.ActionsTileService
import app.aaps.wear.tile.QuickWizardTileService
import app.aaps.wear.tile.TempTargetTileService
import com.google.android.gms.wearable.WearableListenerService
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.WatchfaceConfigurationActivity
import info.nightscout.androidaps.interaction.actions.AcceptActivity
import info.nightscout.androidaps.interaction.actions.ProfileSwitchActivity
import info.nightscout.androidaps.interaction.utils.Persistence
import info.nightscout.androidaps.tile.ActionsTileService
import info.nightscout.androidaps.tile.QuickWizardTileService
import info.nightscout.androidaps.tile.TempTargetTileService
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.comm
package app.aaps.wear.comm
import android.app.NotificationManager
import android.content.Intent
@ -13,6 +13,8 @@ import app.aaps.core.interfaces.rx.events.EventWearDataToMobile
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.wear.interaction.utils.Persistence
import app.aaps.wear.interaction.utils.WearUtil
import com.google.android.gms.tasks.Tasks
import com.google.android.gms.wearable.CapabilityClient
import com.google.android.gms.wearable.CapabilityInfo
@ -25,8 +27,6 @@ import com.google.android.gms.wearable.PutDataMapRequest
import com.google.android.gms.wearable.Wearable
import com.google.android.gms.wearable.WearableListenerService
import dagger.android.AndroidInjection
import info.nightscout.androidaps.interaction.utils.Persistence
import info.nightscout.androidaps.interaction.utils.WearUtil
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import kotlinx.coroutines.CancellationException

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.comm
package app.aaps.wear.comm
import android.os.Build
import android.util.Log

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.comm
package app.aaps.wear.comm
import android.content.Context
import android.content.Intent

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.comm
package app.aaps.wear.comm
import android.content.Context
import android.content.Intent

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.content.BroadcastReceiver
@ -20,17 +20,17 @@ import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData
import app.aaps.wear.R
import app.aaps.wear.comm.DataLayerListenerServiceWear.Companion.INTENT_NEW_DATA
import app.aaps.wear.complications.ComplicationTapBroadcastReceiver.Companion.getTapActionIntent
import app.aaps.wear.complications.ComplicationTapBroadcastReceiver.Companion.getTapWarningSinceIntent
import app.aaps.wear.data.RawDisplayData
import app.aaps.wear.interaction.utils.Constants
import app.aaps.wear.interaction.utils.DisplayFormat
import app.aaps.wear.interaction.utils.Inevitable
import app.aaps.wear.interaction.utils.Persistence
import app.aaps.wear.interaction.utils.WearUtil
import dagger.android.AndroidInjection
import info.nightscout.androidaps.R
import info.nightscout.androidaps.comm.DataLayerListenerServiceWear.Companion.INTENT_NEW_DATA
import info.nightscout.androidaps.complications.ComplicationTapBroadcastReceiver.Companion.getTapActionIntent
import info.nightscout.androidaps.complications.ComplicationTapBroadcastReceiver.Companion.getTapWarningSinceIntent
import info.nightscout.androidaps.data.RawDisplayData
import info.nightscout.androidaps.interaction.utils.Constants
import info.nightscout.androidaps.interaction.utils.DisplayFormat
import info.nightscout.androidaps.interaction.utils.Inevitable
import info.nightscout.androidaps.interaction.utils.Persistence
import info.nightscout.androidaps.interaction.utils.WearUtil
import javax.inject.Inject
/**

View file

@ -1,15 +1,15 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import app.aaps.wear.data.RawDisplayData
import app.aaps.wear.interaction.utils.DisplayFormat
import app.aaps.wear.interaction.utils.SmallestDoubleString
import dagger.android.AndroidInjection
import info.nightscout.androidaps.data.RawDisplayData
import info.nightscout.androidaps.interaction.utils.DisplayFormat
import info.nightscout.androidaps.interaction.utils.SmallestDoubleString
import kotlin.math.max
/*

View file

@ -1,12 +1,12 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.data.RawDisplayData
import app.aaps.wear.data.RawDisplayData
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,14 +1,14 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.graphics.drawable.Icon
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.RawDisplayData
import app.aaps.wear.R
import app.aaps.wear.data.RawDisplayData
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,14 +1,14 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.data.RawDisplayData
import info.nightscout.androidaps.interaction.utils.DisplayFormat
import info.nightscout.androidaps.interaction.utils.SmallestDoubleString
import app.aaps.wear.data.RawDisplayData
import app.aaps.wear.interaction.utils.DisplayFormat
import app.aaps.wear.interaction.utils.SmallestDoubleString
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
enum class ComplicationAction {
NONE, MENU, WIZARD, BOLUS, E_CARB, STATUS, WARNING_SYNC, WARNING_OLD

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.content.ComponentName
@ -12,16 +12,16 @@ import androidx.annotation.StringRes
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.wear.R
import app.aaps.wear.interaction.actions.ECarbActivity
import app.aaps.wear.interaction.actions.TreatmentActivity
import app.aaps.wear.interaction.actions.WizardActivity
import app.aaps.wear.interaction.menus.MainMenuActivity
import app.aaps.wear.interaction.menus.StatusMenuActivity
import app.aaps.wear.interaction.utils.Constants
import app.aaps.wear.interaction.utils.DisplayFormat
import app.aaps.wear.interaction.utils.WearUtil
import dagger.android.DaggerBroadcastReceiver
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.actions.ECarbActivity
import info.nightscout.androidaps.interaction.actions.TreatmentActivity
import info.nightscout.androidaps.interaction.actions.WizardActivity
import info.nightscout.androidaps.interaction.menus.MainMenuActivity
import info.nightscout.androidaps.interaction.menus.StatusMenuActivity
import info.nightscout.androidaps.interaction.utils.Constants
import info.nightscout.androidaps.interaction.utils.DisplayFormat
import info.nightscout.androidaps.interaction.utils.WearUtil
import javax.inject.Inject
/*

View file

@ -1,12 +1,12 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.data.RawDisplayData
import app.aaps.wear.data.RawDisplayData
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,16 +1,16 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.graphics.drawable.Icon
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.RawDisplayData
import info.nightscout.androidaps.interaction.utils.DisplayFormat
import info.nightscout.androidaps.interaction.utils.SmallestDoubleString
import app.aaps.wear.R
import app.aaps.wear.data.RawDisplayData
import app.aaps.wear.interaction.utils.DisplayFormat
import app.aaps.wear.interaction.utils.SmallestDoubleString
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,13 +1,13 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import app.aaps.wear.data.RawDisplayData
import dagger.android.AndroidInjection
import info.nightscout.androidaps.data.RawDisplayData
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,13 +1,13 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import app.aaps.wear.data.RawDisplayData
import dagger.android.AndroidInjection
import info.nightscout.androidaps.data.RawDisplayData
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,13 +1,13 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import app.aaps.core.interfaces.logging.LTag
import app.aaps.wear.data.RawDisplayData
import dagger.android.AndroidInjection
import info.nightscout.androidaps.data.RawDisplayData
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.graphics.drawable.Icon
@ -8,8 +8,8 @@ import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
import androidx.annotation.DrawableRes
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.RawDisplayData
import app.aaps.wear.R
import app.aaps.wear.data.RawDisplayData
import kotlin.math.floor
import kotlin.math.max
import kotlin.math.min

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
import android.app.PendingIntent
import android.graphics.Bitmap
@ -10,7 +10,7 @@ import android.support.wearable.complications.ComplicationData
import android.util.DisplayMetrics
import android.view.WindowManager
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.data.RawDisplayData
import app.aaps.wear.data.RawDisplayData
import java.io.IOException
/*

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.complications
package app.aaps.wear.complications
/*
* Created by dlvoy on 2019-11-12

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.data
package app.aaps.wear.data
import app.aaps.core.interfaces.rx.weardata.EventData
import info.nightscout.androidaps.interaction.utils.Persistence
import app.aaps.wear.interaction.utils.Persistence
/**
* Holds bunch of data model variables and lists that arrive from phone app and are due to be

View file

@ -1,16 +1,26 @@
package info.nightscout.androidaps.di
package app.aaps.wear.di
import app.aaps.wear.interaction.ConfigurationActivity
import app.aaps.wear.interaction.TileConfigurationActivity
import app.aaps.wear.interaction.actions.AcceptActivity
import app.aaps.wear.interaction.actions.BackgroundActionActivity
import app.aaps.wear.interaction.actions.BolusActivity
import app.aaps.wear.interaction.actions.CarbActivity
import app.aaps.wear.interaction.actions.ECarbActivity
import app.aaps.wear.interaction.actions.FillActivity
import app.aaps.wear.interaction.actions.ProfileSwitchActivity
import app.aaps.wear.interaction.actions.QuickSnoozeActivity
import app.aaps.wear.interaction.actions.TempTargetActivity
import app.aaps.wear.interaction.actions.TreatmentActivity
import app.aaps.wear.interaction.actions.ViewSelectorActivity
import app.aaps.wear.interaction.actions.WizardActivity
import app.aaps.wear.interaction.menus.FillMenuActivity
import app.aaps.wear.interaction.menus.MainMenuActivity
import app.aaps.wear.interaction.menus.PreferenceMenuActivity
import app.aaps.wear.interaction.menus.StatusMenuActivity
import app.aaps.wear.interaction.utils.MenuListActivity
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.interaction.actions.QuickSnoozeActivity
import info.nightscout.androidaps.interaction.ConfigurationActivity
import info.nightscout.androidaps.interaction.TileConfigurationActivity
import info.nightscout.androidaps.interaction.actions.*
import info.nightscout.androidaps.interaction.menus.FillMenuActivity
import info.nightscout.androidaps.interaction.menus.MainMenuActivity
import info.nightscout.androidaps.interaction.menus.PreferenceMenuActivity
import info.nightscout.androidaps.interaction.menus.StatusMenuActivity
import info.nightscout.androidaps.interaction.utils.MenuListActivity
@Module
@Suppress("unused")

View file

@ -1,10 +1,10 @@
package info.nightscout.androidaps.di
package app.aaps.wear.di
import app.aaps.wear.WearApp
import dagger.BindsInstance
import dagger.Component
import dagger.android.AndroidInjectionModule
import dagger.android.AndroidInjector
import info.nightscout.androidaps.WearApp
import javax.inject.Singleton
@Singleton

View file

@ -1,12 +1,12 @@
package info.nightscout.androidaps.di
package app.aaps.wear.di
import android.content.Context
import app.aaps.shared.impl.di.SharedImplModule
import app.aaps.wear.WearApp
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.WearApp
import kotlinx.datetime.Clock
@Suppress("unused")

View file

@ -1,13 +1,37 @@
package info.nightscout.androidaps.di
package app.aaps.wear.di
import app.aaps.wear.comm.DataLayerListenerServiceWear
import app.aaps.wear.complications.BaseComplicationProviderService
import app.aaps.wear.complications.BrCobIobComplication
import app.aaps.wear.complications.CobDetailedComplication
import app.aaps.wear.complications.CobIconComplication
import app.aaps.wear.complications.CobIobComplication
import app.aaps.wear.complications.ComplicationTapBroadcastReceiver
import app.aaps.wear.complications.IobDetailedComplication
import app.aaps.wear.complications.IobIconComplication
import app.aaps.wear.complications.LongStatusComplication
import app.aaps.wear.complications.LongStatusFlippedComplication
import app.aaps.wear.complications.SgvComplication
import app.aaps.wear.complications.UploaderBatteryComplication
import app.aaps.wear.complications.WallpaperComplication
import app.aaps.wear.heartrate.HeartRateListener
import app.aaps.wear.tile.ActionsTileService
import app.aaps.wear.tile.QuickWizardTileService
import app.aaps.wear.tile.TempTargetTileService
import app.aaps.wear.tile.TileBase
import app.aaps.wear.watchfaces.AapsLargeWatchface
import app.aaps.wear.watchfaces.AapsV2Watchface
import app.aaps.wear.watchfaces.AapsWatchface
import app.aaps.wear.watchfaces.BigChartWatchface
import app.aaps.wear.watchfaces.CircleWatchface
import app.aaps.wear.watchfaces.CockpitWatchface
import app.aaps.wear.watchfaces.CustomWatchface
import app.aaps.wear.watchfaces.DigitalStyleWatchface
import app.aaps.wear.watchfaces.NoChartWatchface
import app.aaps.wear.watchfaces.SteampunkWatchface
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.comm.DataLayerListenerServiceWear
import info.nightscout.androidaps.complications.*
import info.nightscout.androidaps.heartrate.HeartRateListener
import info.nightscout.androidaps.tile.*
import info.nightscout.androidaps.watchfaces.*
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
@Module
@Suppress("unused")
@ -36,7 +60,6 @@ abstract class WearServicesModule {
@ContributesAndroidInjector abstract fun contributesSteampunk(): SteampunkWatchface
@ContributesAndroidInjector abstract fun contributesDigitalStyleWatchface(): DigitalStyleWatchface
@ContributesAndroidInjector abstract fun contributesCockpitWatchface(): CockpitWatchface
@ContributesAndroidInjector abstract fun contributesBIGChart(): BigChartWatchface
@ContributesAndroidInjector abstract fun contributesNOChart(): NoChartWatchface
@ContributesAndroidInjector abstract fun contributesCircleWatchface(): CircleWatchface

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.events
package app.aaps.wear.events
import android.content.Context
import app.aaps.core.interfaces.rx.events.Event

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.heartrate
package app.aaps.wear.heartrate
import android.content.Context
import android.content.Context.SENSOR_SERVICE
@ -12,7 +12,7 @@ import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.rx.AapsSchedulers
import app.aaps.core.interfaces.rx.weardata.EventData
import info.nightscout.androidaps.comm.IntentWearToMobile
import app.aaps.wear.comm.IntentWearToMobile
import io.reactivex.rxjava3.disposables.Disposable
import java.util.concurrent.TimeUnit
import java.util.concurrent.locks.ReentrantLock

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction
package app.aaps.wear.interaction
import android.os.Bundle
import android.view.View
@ -6,8 +6,8 @@ import android.view.ViewGroup
import androidx.core.content.ContextCompat
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.wear.R
import dagger.android.AndroidInjection
import info.nightscout.androidaps.R
import preference.WearPreferenceActivity
import javax.inject.Inject

View file

@ -1,13 +1,13 @@
package info.nightscout.androidaps.interaction
package app.aaps.wear.interaction
import android.os.Bundle
import android.view.ViewGroup
import androidx.wear.tiles.TileService
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.wear.tile.ActionsTileService
import app.aaps.wear.tile.TempTargetTileService
import dagger.android.AndroidInjection
import info.nightscout.androidaps.tile.ActionsTileService
import info.nightscout.androidaps.tile.TempTargetTileService
import preference.WearPreferenceActivity
import javax.inject.Inject

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction
package app.aaps.wear.interaction
import android.Manifest
import android.content.SharedPreferences
@ -11,7 +11,7 @@ import androidx.core.content.ContextCompat
import androidx.preference.PreferenceManager
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.R
import app.aaps.wear.R
import preference.WearPreferenceActivity
import javax.inject.Inject

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.content.Intent
import android.os.Bundle
@ -16,11 +16,11 @@ import android.widget.TextView
import androidx.core.view.InputDeviceCompat
import androidx.core.view.MotionEventCompat
import androidx.core.view.ViewConfigurationCompat
import info.nightscout.androidaps.R
import info.nightscout.androidaps.comm.DataLayerListenerServiceWear
import info.nightscout.androidaps.comm.IntentCancelNotification
import info.nightscout.androidaps.comm.IntentWearToMobile
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.comm.DataLayerListenerServiceWear
import app.aaps.wear.comm.IntentCancelNotification
import app.aaps.wear.comm.IntentWearToMobile
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import kotlin.math.roundToInt
class AcceptActivity : ViewSelectorActivity() {

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.widget.Toast
@ -7,8 +7,8 @@ import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.wear.comm.DataLayerListenerServiceWear
import dagger.android.DaggerActivity
import info.nightscout.androidaps.comm.DataLayerListenerServiceWear
import javax.inject.Inject
class BackgroundActionActivity : DaggerActivity() {

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -10,10 +10,10 @@ import android.widget.ImageView
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionBolusPreCheck
import app.aaps.core.interfaces.utils.SafeParse
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
import kotlin.math.roundToInt

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -10,10 +10,10 @@ import android.widget.ImageView
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionECarbsPreCheck
import app.aaps.core.interfaces.utils.SafeParse
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
class CarbActivity : ViewSelectorActivity() {

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -11,10 +11,10 @@ import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionECarbsPreCheck
import app.aaps.core.interfaces.utils.SafeParse.stringToDouble
import app.aaps.core.interfaces.utils.SafeParse.stringToInt
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
class ECarbActivity : ViewSelectorActivity() {

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -10,10 +10,10 @@ import android.widget.ImageView
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionFillPreCheck
import app.aaps.core.interfaces.utils.SafeParse.stringToDouble
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
class FillActivity : ViewSelectorActivity() {

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -10,10 +10,10 @@ import android.widget.ImageView
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionProfileSwitchPreCheck
import app.aaps.core.interfaces.utils.SafeParse
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
class ProfileSwitchActivity : ViewSelectorActivity() {

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.content.Intent
import android.content.pm.PackageManager
@ -9,8 +9,8 @@ import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.shared.impl.extensions.safeGetPackageInfo
import app.aaps.wear.R
import dagger.android.DaggerActivity
import info.nightscout.androidaps.R
import javax.inject.Inject
/**

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -10,10 +10,10 @@ import android.widget.ImageView
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionTempTargetPreCheck
import app.aaps.core.interfaces.utils.SafeParse
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
class TempTargetActivity : ViewSelectorActivity() {

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -11,10 +11,10 @@ import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionBolusPreCheck
import app.aaps.core.interfaces.utils.SafeParse.stringToDouble
import app.aaps.core.interfaces.utils.SafeParse.stringToInt
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
import kotlin.math.roundToInt

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.content.Context
import android.os.Bundle
@ -11,11 +11,11 @@ import android.widget.Toast
import androidx.wear.widget.CurvedTextView
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.wear.R
import app.aaps.wear.nondeprecated.DotsPageIndicatorNonDeprecated
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.nondeprecated.GridViewPagerNonDeprecated
import dagger.android.DaggerActivity
import info.nightscout.androidaps.R
import info.nightscout.androidaps.nondeprecated.DotsPageIndicatorNonDeprecated
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import info.nightscout.androidaps.nondeprecated.GridViewPagerNonDeprecated
import javax.inject.Inject
/**

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.interaction.actions
package app.aaps.wear.interaction.actions
import android.os.Bundle
import android.view.LayoutInflater
@ -10,10 +10,10 @@ import android.widget.ImageView
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionWizardPreCheck
import app.aaps.core.interfaces.utils.SafeParse
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter
import info.nightscout.androidaps.interaction.utils.PlusMinusEditText
import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter
import app.aaps.wear.interaction.utils.PlusMinusEditText
import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated
import java.text.DecimalFormat
class WizardActivity : ViewSelectorActivity() {

View file

@ -1,12 +1,12 @@
package info.nightscout.androidaps.interaction.menus
package app.aaps.wear.interaction.menus
import android.content.Intent
import android.os.Bundle
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.actions.FillActivity
import info.nightscout.androidaps.interaction.utils.MenuListActivity
import app.aaps.wear.R
import app.aaps.wear.interaction.actions.FillActivity
import app.aaps.wear.interaction.utils.MenuListActivity
class FillMenuActivity : MenuListActivity() {

View file

@ -1,16 +1,16 @@
package info.nightscout.androidaps.interaction.menus
package app.aaps.wear.interaction.menus
import android.content.Intent
import android.os.Bundle
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.actions.ECarbActivity
import info.nightscout.androidaps.interaction.actions.TempTargetActivity
import info.nightscout.androidaps.interaction.actions.TreatmentActivity
import info.nightscout.androidaps.interaction.actions.WizardActivity
import info.nightscout.androidaps.interaction.utils.MenuListActivity
import app.aaps.wear.R
import app.aaps.wear.interaction.actions.ECarbActivity
import app.aaps.wear.interaction.actions.TempTargetActivity
import app.aaps.wear.interaction.actions.TreatmentActivity
import app.aaps.wear.interaction.actions.WizardActivity
import app.aaps.wear.interaction.utils.MenuListActivity
class MainMenuActivity : MenuListActivity() {

View file

@ -1,10 +1,10 @@
package info.nightscout.androidaps.interaction.menus
package app.aaps.wear.interaction.menus
import android.content.Intent
import android.os.Bundle
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.WatchfaceConfigurationActivity
import info.nightscout.androidaps.interaction.utils.MenuListActivity
import app.aaps.wear.R
import app.aaps.wear.interaction.WatchfaceConfigurationActivity
import app.aaps.wear.interaction.utils.MenuListActivity
class PreferenceMenuActivity : MenuListActivity() {
@ -24,23 +24,27 @@ class PreferenceMenuActivity : MenuListActivity() {
override fun doAction(position: String) {
when (position) {
getString(R.string.pref_display_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply {
getString(R.string.pref_display_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(getString(R.string.key_preference_id), R.xml.display_preferences)
})
getString(R.string.pref_graph_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(getString(R.string.key_preference_id), R.xml.graph_preferences)
})
getString(R.string.pref_interface_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(getString(R.string.key_preference_id), R.xml.interface_preferences)
})
getString(R.string.pref_complication_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(getString(R.string.key_preference_id), R.xml.complication_preferences)
})
getString(R.string.pref_others_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply {
getString(R.string.pref_others_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(getString(R.string.key_preference_id), R.xml.others_preferences)
})

View file

@ -1,12 +1,12 @@
package info.nightscout.androidaps.interaction.menus
package app.aaps.wear.interaction.menus
import android.os.Bundle
import app.aaps.core.interfaces.rx.events.EventWearToMobile
import app.aaps.core.interfaces.rx.weardata.EventData.ActionLoopStatus
import app.aaps.core.interfaces.rx.weardata.EventData.ActionPumpStatus
import app.aaps.core.interfaces.rx.weardata.EventData.ActionTddStatus
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.MenuListActivity
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.MenuListActivity
class StatusMenuActivity : MenuListActivity() {

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
@Suppress("unused")
object Constants {

View file

@ -1,10 +1,10 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.content.Context
import app.aaps.core.interfaces.sharedPreferences.SP
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.RawDisplayData
import info.nightscout.androidaps.interaction.utils.Pair.Companion.create
import app.aaps.wear.R
import app.aaps.wear.data.RawDisplayData
import app.aaps.wear.interaction.utils.Pair.Companion.create
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.math.max

View file

@ -1,17 +1,17 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import app.aaps.core.interfaces.sharedPreferences.SP
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActionEditplusminBinding
import info.nightscout.androidaps.databinding.ActionEditplusminMultiBinding
import info.nightscout.androidaps.databinding.ActionEditplusminQuickleftyBinding
import info.nightscout.androidaps.databinding.ActionEditplusminQuickleftyMultiBinding
import info.nightscout.androidaps.databinding.ActionEditplusminQuickrightyBinding
import info.nightscout.androidaps.databinding.ActionEditplusminQuickrightyMultiBinding
import info.nightscout.androidaps.databinding.ActionEditplusminViktoriaBinding
import app.aaps.wear.R
import app.aaps.wear.databinding.ActionEditplusminBinding
import app.aaps.wear.databinding.ActionEditplusminMultiBinding
import app.aaps.wear.databinding.ActionEditplusminQuickleftyBinding
import app.aaps.wear.databinding.ActionEditplusminQuickleftyMultiBinding
import app.aaps.wear.databinding.ActionEditplusminQuickrightyBinding
import app.aaps.wear.databinding.ActionEditplusminQuickrightyMultiBinding
import app.aaps.wear.databinding.ActionEditplusminViktoriaBinding
/**
* EditPlusMinusViewAdapter binds both ActionEditplusminBinding variants shared attributes to one common view adapter.

View file

@ -1,10 +1,10 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.os.SystemClock
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.utils.DateUtil
import info.nightscout.androidaps.BuildConfig
import app.aaps.wear.BuildConfig
import java.util.concurrent.ConcurrentHashMap
import javax.inject.Inject
import javax.inject.Singleton
@ -25,19 +25,19 @@ class Inevitable @Inject internal constructor() {
@Inject lateinit var dateUtil: DateUtil
private val tasks = ConcurrentHashMap<String, Task>()
fun task(id: String, idle_for: Long, runnable: Runnable?) {
if (idle_for > MAX_QUEUE_TIME) {
throw RuntimeException("$id Requested time: $idle_for beyond max queue time")
fun task(id: String, idleFor: Long, runnable: Runnable?) {
if (idleFor > MAX_QUEUE_TIME) {
throw RuntimeException("$id Requested time: $idleFor beyond max queue time")
}
val task = tasks[id]
if (task != null) {
// if it already exists then extend the time
task.extendTime(idle_for)
task.extendTime(idleFor)
if (debug) aapsLogger.debug(LTag.WEAR, "Extending time for: " + id + " to " + dateUtil.dateAndTimeAndSecondsString(task.`when`))
} else {
// otherwise create new task
if (runnable == null) return // extension only if already exists
tasks[id] = Task(id, idle_for, runnable)
tasks[id] = Task(id, idleFor, runnable)
if (debug) {
aapsLogger.debug(
LTag.WEAR,

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.os.Bundle
import android.view.LayoutInflater
@ -14,9 +14,9 @@ import androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback
import androidx.wear.widget.WearableRecyclerView
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.wear.R
import app.aaps.wear.interaction.utils.MenuListActivity.MenuAdapter.ItemViewHolder
import dagger.android.DaggerActivity
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.utils.MenuListActivity.MenuAdapter.ItemViewHolder
import javax.inject.Inject
import kotlin.math.abs
import kotlin.math.min

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import java.util.*
import java.util.Objects
/**
* Same as android Pair, but clean room java class - does not require Android SDK for tests

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import app.aaps.annotations.OpenForTesting
import app.aaps.core.interfaces.logging.AAPSLogger

View file

@ -1,7 +1,14 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.content.Context
import android.os.*
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.os.VibrationEffect
import android.os.Vibrator
import android.os.VibratorManager
import android.view.KeyEvent
import android.view.MotionEvent
import android.view.View

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import kotlin.jvm.JvmOverloads
import java.math.RoundingMode
import java.text.DecimalFormat
import java.util.regex.Pattern

View file

@ -1,10 +1,10 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.content.Context
import android.util.AttributeSet
import preference.WearListPreference
import android.widget.Toast
import info.nightscout.androidaps.BuildConfig
import app.aaps.wear.BuildConfig
import preference.WearListPreference
/**
* Created by adrian on 07/08/17.

View file

@ -1,9 +1,9 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.content.Context
import android.util.AttributeSet
import android.widget.Toast
import info.nightscout.androidaps.R
import app.aaps.wear.R
import preference.WearListPreference
@Suppress("unused")

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.interaction.utils
package app.aaps.wear.interaction.utils
import android.content.Context
import android.os.PowerManager

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.nondeprecated
package app.aaps.wear.nondeprecated
import android.content.Context
import android.support.wearable.view.DotsPageIndicator

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.nondeprecated
package app.aaps.wear.nondeprecated
import android.support.wearable.view.GridPagerAdapter

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.nondeprecated
package app.aaps.wear.nondeprecated
import android.content.Context
import android.support.wearable.view.GridViewPager

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.tile
package app.aaps.wear.tile
import app.aaps.wear.tile.source.ActionSource
import dagger.android.AndroidInjection
import info.nightscout.androidaps.tile.source.ActionSource
import javax.inject.Inject
class ActionsTileService : TileBase() {

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.tile
package app.aaps.wear.tile
import app.aaps.wear.tile.source.QuickWizardSource
import dagger.android.AndroidInjection
import info.nightscout.androidaps.tile.source.QuickWizardSource
import javax.inject.Inject
class QuickWizardTileService : TileBase() {

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.tile
package app.aaps.wear.tile
import app.aaps.wear.tile.source.TempTargetSource
import dagger.android.AndroidInjection
import info.nightscout.androidaps.tile.source.TempTargetSource
import javax.inject.Inject
class TempTargetTileService : TileBase() {

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.tile
package app.aaps.wear.tile
import androidx.annotation.DrawableRes
import androidx.core.content.ContextCompat
@ -38,10 +38,10 @@ import androidx.wear.tiles.TimelineBuilders.TimelineEntry
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.wear.R
import app.aaps.wear.comm.DataLayerListenerServiceWear
import com.google.common.util.concurrent.ListenableFuture
import dagger.android.AndroidInjection
import info.nightscout.androidaps.R
import info.nightscout.androidaps.comm.DataLayerListenerServiceWear
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job

View file

@ -1,16 +1,16 @@
package info.nightscout.androidaps.tile.source
package app.aaps.wear.tile.source
import android.content.Context
import android.content.res.Resources
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.sharedPreferences.SP
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.actions.BolusActivity
import info.nightscout.androidaps.interaction.actions.CarbActivity
import info.nightscout.androidaps.interaction.actions.ECarbActivity
import info.nightscout.androidaps.interaction.actions.TempTargetActivity
import info.nightscout.androidaps.interaction.actions.TreatmentActivity
import info.nightscout.androidaps.interaction.actions.WizardActivity
import app.aaps.wear.R
import app.aaps.wear.interaction.actions.BolusActivity
import app.aaps.wear.interaction.actions.CarbActivity
import app.aaps.wear.interaction.actions.ECarbActivity
import app.aaps.wear.interaction.actions.TempTargetActivity
import app.aaps.wear.interaction.actions.TreatmentActivity
import app.aaps.wear.interaction.actions.WizardActivity
import javax.inject.Inject
import javax.inject.Singleton

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.tile.source
package app.aaps.wear.tile.source
import android.content.Context
import android.content.res.Resources
@ -6,10 +6,10 @@ import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.sharedPreferences.SP
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.actions.BackgroundActionActivity
import info.nightscout.androidaps.tile.Action
import info.nightscout.androidaps.tile.TileSource
import app.aaps.wear.R
import app.aaps.wear.interaction.actions.BackgroundActionActivity
import app.aaps.wear.tile.Action
import app.aaps.wear.tile.TileSource
import java.util.Calendar
import javax.inject.Inject
import javax.inject.Singleton

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.tile.source
package app.aaps.wear.tile.source
import android.content.Context
import android.content.res.Resources
@ -6,8 +6,8 @@ import androidx.annotation.DrawableRes
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.sharedPreferences.SP
import info.nightscout.androidaps.tile.Action
import info.nightscout.androidaps.tile.TileSource
import app.aaps.wear.tile.Action
import app.aaps.wear.tile.TileSource
abstract class StaticTileSource(val context: Context, val sp: SP, val aapsLogger: AAPSLogger) : TileSource {

View file

@ -1,13 +1,13 @@
package info.nightscout.androidaps.tile.source
package app.aaps.wear.tile.source
import android.content.Context
import android.content.res.Resources
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.sharedPreferences.SP
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interaction.actions.BackgroundActionActivity
import info.nightscout.androidaps.interaction.actions.TempTargetActivity
import app.aaps.wear.R
import app.aaps.wear.interaction.actions.BackgroundActionActivity
import app.aaps.wear.interaction.actions.TempTargetActivity
import javax.inject.Inject
import javax.inject.Singleton

View file

@ -1,13 +1,13 @@
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.graphics.Color
import android.view.LayoutInflater
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityHomeLargeBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import com.ustwo.clockwise.common.WatchMode
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityHomeLargeBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
class AapsLargeWatchface : BaseWatchFace() {

View file

@ -1,14 +1,14 @@
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.graphics.Color
import android.view.LayoutInflater
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityHome2Binding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import com.ustwo.clockwise.common.WatchMode
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityHome2Binding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
class AapsV2Watchface : BaseWatchFace() {

View file

@ -1,13 +1,13 @@
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.graphics.Color
import android.view.LayoutInflater
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityHomeBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import com.ustwo.clockwise.common.WatchMode
import info.nightscout.androidaps.R
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import info.nightscout.androidaps.databinding.ActivityHomeBinding
class AapsWatchface : BaseWatchFace() {

View file

@ -1,16 +1,16 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.annotation.SuppressLint
import android.view.LayoutInflater
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityBigchartBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import app.aaps.wear.watchfaces.utils.WatchfaceViewAdapter
import com.ustwo.clockwise.common.WatchMode
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityBigchartBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import info.nightscout.androidaps.watchfaces.utils.WatchfaceViewAdapter
class BigChartWatchface : BaseWatchFace() {
@ -53,9 +53,9 @@ class BigChartWatchface : BaseWatchFace() {
binding.status?.setTextColor(ContextCompat.getColor(this, R.color.dark_statusView))
binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background))
val color = when (singleBg.sgvLevel) {
1L -> R.color.dark_highColor
0L -> R.color.dark_midColor
-1L -> R.color.dark_lowColor
1L -> R.color.dark_highColor
0L -> R.color.dark_midColor
-1L -> R.color.dark_lowColor
else -> R.color.dark_midColor
}
binding.sgv?.setTextColor(ContextCompat.getColor(this, color))
@ -82,9 +82,9 @@ class BigChartWatchface : BaseWatchFace() {
binding.status?.setTextColor(ContextCompat.getColor(this, R.color.light_bigchart_status))
binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.light_background))
val color = when (singleBg.sgvLevel) {
1L -> R.color.light_highColor
0L -> R.color.light_midColor
-1L -> R.color.light_lowColor
1L -> R.color.light_highColor
0L -> R.color.light_midColor
-1L -> R.color.light_lowColor
else -> R.color.light_midColor
}
binding.sgv?.setTextColor(ContextCompat.getColor(this, color))

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.annotation.SuppressLint
import android.content.Intent
@ -25,13 +25,13 @@ import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData
import app.aaps.core.interfaces.rx.weardata.EventData.SingleBg
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.wear.R
import app.aaps.wear.data.RawDisplayData
import app.aaps.wear.interaction.menus.MainMenuActivity
import app.aaps.wear.interaction.utils.Persistence
import com.ustwo.clockwise.common.WatchFaceTime
import com.ustwo.clockwise.wearable.WatchFace
import dagger.android.AndroidInjection
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.RawDisplayData
import info.nightscout.androidaps.interaction.menus.MainMenuActivity
import info.nightscout.androidaps.interaction.utils.Persistence
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import java.util.*

View file

@ -1,11 +1,11 @@
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.view.LayoutInflater
import android.view.View
import androidx.viewbinding.ViewBinding
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityCockpitBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityCockpitBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
/**
* Created by andrew-warrington on 18/11/2017.
@ -24,9 +24,9 @@ class CockpitWatchface : BaseWatchFace() {
binding.mainLayout.setBackgroundResource(R.drawable.airplane_cockpit_outside_clouds)
setTextSizes()
val led = when (singleBg.sgvLevel) {
1L -> R.drawable.airplane_led_yellow_lit
0L -> R.drawable.airplane_led_grey_unlit
-1L -> R.drawable.airplane_led_red_lit
1L -> R.drawable.airplane_led_yellow_lit
0L -> R.drawable.airplane_led_grey_unlit
-1L -> R.drawable.airplane_led_red_lit
else -> R.drawable.airplane_led_grey_unlit
}

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.annotation.SuppressLint
import android.content.Context
@ -44,9 +44,9 @@ import app.aaps.core.interfaces.rx.weardata.ResFileMap
import app.aaps.core.interfaces.rx.weardata.ResFormat
import app.aaps.core.interfaces.rx.weardata.ViewKeys
import app.aaps.core.interfaces.rx.weardata.ZipWatchfaceFormat
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityCustomBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityCustomBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import org.joda.time.TimeOfDay
import org.json.JSONObject
import java.io.ByteArrayOutputStream

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.annotation.SuppressLint
import android.support.wearable.watchface.WatchFaceStyle
@ -10,9 +10,9 @@ import android.widget.LinearLayout
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import app.aaps.core.interfaces.logging.LTag
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityDigitalstyleBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityDigitalstyleBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
class DigitalStyleWatchface : BaseWatchFace() {

View file

@ -1,14 +1,13 @@
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.view.LayoutInflater
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivityNochartBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import app.aaps.wear.watchfaces.utils.WatchfaceViewAdapter
import com.ustwo.clockwise.common.WatchMode
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityBigchartBinding
import info.nightscout.androidaps.databinding.ActivityNochartBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import info.nightscout.androidaps.watchfaces.utils.WatchfaceViewAdapter
class NoChartWatchface : BaseWatchFace() {

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.watchfaces
package app.aaps.wear.watchfaces
import android.view.LayoutInflater
import android.view.animation.Animation
@ -9,9 +9,9 @@ import android.view.animation.RotateAnimation
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import app.aaps.core.interfaces.utils.SafeParse.stringToFloat
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivitySteampunkBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import app.aaps.wear.R
import app.aaps.wear.databinding.ActivitySteampunkBinding
import app.aaps.wear.watchfaces.utils.BaseWatchFace
import org.joda.time.TimeOfDay
/**

View file

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION")
package info.nightscout.androidaps.watchfaces.utils
package app.aaps.wear.watchfaces.utils
import android.annotation.SuppressLint
import android.content.Intent
@ -23,18 +23,18 @@ import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.wear.R
import app.aaps.wear.data.RawDisplayData
import app.aaps.wear.events.EventWearPreferenceChange
import app.aaps.wear.heartrate.HeartRateListener
import app.aaps.wear.interaction.menus.MainMenuActivity
import app.aaps.wear.interaction.utils.Persistence
import app.aaps.wear.interaction.utils.WearUtil
import com.ustwo.clockwise.common.WatchFaceTime
import com.ustwo.clockwise.common.WatchMode
import com.ustwo.clockwise.common.WatchShape
import com.ustwo.clockwise.wearable.WatchFace
import dagger.android.AndroidInjection
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.RawDisplayData
import info.nightscout.androidaps.events.EventWearPreferenceChange
import info.nightscout.androidaps.heartrate.HeartRateListener
import info.nightscout.androidaps.interaction.menus.MainMenuActivity
import info.nightscout.androidaps.interaction.utils.Persistence
import info.nightscout.androidaps.interaction.utils.WearUtil
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.watchfaces.utils
package app.aaps.wear.watchfaces.utils
import android.graphics.DashPathEffect
import app.aaps.core.interfaces.rx.weardata.EventData
@ -6,7 +6,7 @@ import app.aaps.core.interfaces.rx.weardata.EventData.SingleBg
import app.aaps.core.interfaces.rx.weardata.EventData.TreatmentData.Basal
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import info.nightscout.androidaps.R
import app.aaps.wear.R
import lecho.lib.hellocharts.model.Axis
import lecho.lib.hellocharts.model.AxisValue
import lecho.lib.hellocharts.model.Line

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.watchfaces.utils
package app.aaps.wear.watchfaces.utils
import android.content.BroadcastReceiver
import android.content.Context
@ -14,9 +14,9 @@ import androidx.core.content.ContextCompat
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.wear.R
import com.ustwo.clockwise.common.WatchMode
import com.ustwo.clockwise.wearable.WatchFace
import info.nightscout.androidaps.R
import javax.inject.Inject
class SimpleUi @Inject constructor(

View file

@ -1,15 +1,15 @@
package info.nightscout.androidaps.watchfaces.utils
package app.aaps.wear.watchfaces.utils
import androidx.viewbinding.ViewBinding
import info.nightscout.androidaps.databinding.ActivityHomeLargeBinding
import info.nightscout.androidaps.databinding.ActivityHome2Binding
import info.nightscout.androidaps.databinding.ActivityHomeBinding
import info.nightscout.androidaps.databinding.ActivityBigchartBinding
import info.nightscout.androidaps.databinding.ActivityCockpitBinding
import info.nightscout.androidaps.databinding.ActivityCustomBinding
import info.nightscout.androidaps.databinding.ActivityDigitalstyleBinding
import info.nightscout.androidaps.databinding.ActivityNochartBinding
import info.nightscout.androidaps.databinding.ActivitySteampunkBinding
import app.aaps.wear.databinding.ActivityBigchartBinding
import app.aaps.wear.databinding.ActivityCockpitBinding
import app.aaps.wear.databinding.ActivityCustomBinding
import app.aaps.wear.databinding.ActivityDigitalstyleBinding
import app.aaps.wear.databinding.ActivityHome2Binding
import app.aaps.wear.databinding.ActivityHomeBinding
import app.aaps.wear.databinding.ActivityHomeLargeBinding
import app.aaps.wear.databinding.ActivityNochartBinding
import app.aaps.wear.databinding.ActivitySteampunkBinding
/**
* WatchfaceViewAdapter binds all WatchFace variants shared attributes to one common view adapter.
@ -34,6 +34,7 @@ class WatchfaceViewAdapter(
}
private val errorMessage = "Missing require View Binding parameter"
// Required attributes
val mainLayout =
aL?.mainLayout ?: a2?.mainLayout ?: aa?.mainLayout ?: bC?.mainLayout ?: bC?.mainLayout ?: cp?.mainLayout ?: ds?.mainLayout ?: nC?.mainLayout ?: sP?.mainLayout ?: cU?.mainLayout
@ -87,16 +88,16 @@ class WatchfaceViewAdapter(
fun getBinding(bindLayout: ViewBinding): WatchfaceViewAdapter {
return when (bindLayout) {
is ActivityHomeLargeBinding -> WatchfaceViewAdapter(bindLayout)
is ActivityHome2Binding -> WatchfaceViewAdapter(null, bindLayout)
is ActivityHomeBinding -> WatchfaceViewAdapter(null, null, bindLayout)
is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, null, bindLayout)
is ActivityCockpitBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout)
is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout)
is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, bindLayout)
is ActivitySteampunkBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, bindLayout)
is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, null, bindLayout)
else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter")
is ActivityHomeLargeBinding -> WatchfaceViewAdapter(bindLayout)
is ActivityHome2Binding -> WatchfaceViewAdapter(null, bindLayout)
is ActivityHomeBinding -> WatchfaceViewAdapter(null, null, bindLayout)
is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, null, bindLayout)
is ActivityCockpitBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout)
is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout)
is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, bindLayout)
is ActivitySteampunkBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, bindLayout)
is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, null, bindLayout)
else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter")
}
}
}

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:id="@+id/main_layout"
android:layout_width="match_parent"
@ -11,11 +10,11 @@
android:id="@+id/background"
android:layout_width="400px"
android:layout_height="400px"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
android:visibility="visible"
android:layout_marginTop="0px"
android:orientation="vertical"
android:src="@drawable/background"
android:orientation="vertical" />
android:visibility="visible" />
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
@ -29,84 +28,84 @@
android:id="@+id/cover_chart"
android:layout_width="400px"
android:layout_height="400px"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
android:visibility="gone"
android:orientation="vertical" />
android:layout_marginTop="0px"
android:orientation="vertical"
android:visibility="gone" />
<TextView
android:id="@+id/freetext1"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
android:textSize="21px"
android:layout_marginTop="0px"
android:gravity="center"
android:visibility="gone"
android:textColor="@color/light_grey" />
android:textColor="@color/light_grey"
android:textSize="21px"
android:visibility="gone" />
<TextView
android:id="@+id/freetext2"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
android:textSize="21px"
android:layout_marginTop="0px"
android:gravity="center"
android:visibility="gone"
android:textColor="@color/light_grey" />
android:textColor="@color/light_grey"
android:textSize="21px"
android:visibility="gone" />
<TextView
android:id="@+id/freetext3"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
android:textSize="21px"
android:layout_marginTop="0px"
android:gravity="center"
android:visibility="gone"
android:textColor="@color/light_grey" />
android:textColor="@color/light_grey"
android:textSize="21px"
android:visibility="gone" />
<TextView
android:id="@+id/freetext4"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
android:textSize="21px"
android:layout_marginTop="0px"
android:gravity="center"
android:visibility="gone"
android:textColor="@color/light_grey" />
android:textColor="@color/light_grey"
android:textSize="21px"
android:visibility="gone" />
<TextView
android:id="@+id/iob1"
android:layout_width="130px"
android:layout_height="33px"
android:layout_marginTop="168px"
android:layout_marginLeft="270px"
android:textSize="21px"
android:layout_marginTop="168px"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="21px"
tools:text="@string/activity_IOB" />
<TextView
android:id="@+id/iob2"
android:layout_width="130px"
android:layout_height="33px"
android:layout_marginTop="196px"
android:layout_marginLeft="270px"
android:textSize="21px"
android:textStyle="bold"
android:layout_marginTop="196px"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="21px"
android:textStyle="bold"
tools:text="@string/no_iob_u" />
<TextView
android:id="@+id/cob1"
android:layout_width="120px"
android:layout_height="33px"
android:layout_marginTop="168px"
android:layout_marginLeft="0px"
android:layout_marginTop="168px"
android:gravity="center"
android:text="@string/activity_carb"
android:textColor="@color/light_grey"
@ -116,36 +115,36 @@
android:id="@+id/cob2"
android:layout_width="120px"
android:layout_height="33px"
android:layout_marginTop="196px"
android:layout_marginLeft="0px"
android:layout_marginTop="196px"
android:gravity="center"
android:text="@string/no_cob_g"
android:textSize="21px"
android:textColor="@color/light_grey"
android:textSize="21px"
android:textStyle="bold" />
<TextView
android:id="@+id/delta"
android:layout_width="59px"
android:layout_height="32px"
android:layout_marginTop="133px"
android:layout_marginLeft="15px"
android:layout_marginTop="133px"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="23px"
android:textStyle="bold"
android:textColor="@color/light_grey"
tools:text="+/-" />
<TextView
android:id="@+id/avg_delta"
android:layout_width="59px"
android:layout_height="32px"
android:layout_marginTop="133px"
android:layout_marginLeft="74px"
android:layout_marginTop="133px"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="23px"
android:textStyle="bold"
android:textColor="@color/light_grey"
tools:text="@string/abbreviation_average" />
@ -153,26 +152,26 @@
android:id="@+id/uploader_battery"
android:layout_width="60px"
android:layout_height="32px"
android:gravity="center"
android:layout_marginTop="133px"
android:layout_marginLeft="129px"
android:textSize="23px"
android:layout_marginTop="133px"
android:fontFamily="@font/roboto_condensed_bold"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="23px"
android:textStyle="bold"
tools:text="100%" />
<TextView
android:id="@+id/rig_battery"
android:layout_width="60px"
android:layout_height="32px"
android:gravity="center"
android:layout_marginTop="133px"
android:layout_marginLeft="189px"
android:textSize="23px"
android:layout_marginTop="133px"
android:fontFamily="@font/roboto_condensed_bold"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="23px"
android:textStyle="bold"
android:visibility="visible"
tools:text="100%" />
@ -180,25 +179,25 @@
android:id="@+id/basalRate"
android:layout_width="91px"
android:layout_height="32px"
android:layout_marginTop="133px"
android:layout_marginLeft="249px"
android:gravity="center"
android:layout_marginTop="133px"
android:fontFamily="@font/roboto_condensed_bold"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="23px"
android:textStyle="bold"
android:textColor="@color/light_grey"
tools:text="@string/no_tmp_basal_u_h" />
<TextView
android:id="@+id/bgi"
android:layout_width="60px"
android:layout_height="32px"
android:layout_marginTop="133px"
android:layout_marginLeft="340px"
android:layout_marginTop="133px"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="23px"
android:textStyle="bold"
android:textColor="@color/light_grey"
android:visibility="visible"
tools:text="bgi" />
@ -208,11 +207,11 @@
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="151px"
android:gravity="center"
android:fontFamily="@font/roboto_condensed_bold"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="70px"
android:textStyle="bold"
android:textColor="@color/light_grey"
android:visibility="gone"
tools:text="22:00" />
@ -221,13 +220,13 @@
android:id="@+id/hour"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="151px"
android:layout_marginLeft="119px"
android:layout_marginTop="151px"
android:fontFamily="@font/roboto_condensed_bold"
android:textAllCaps="true"
android:textColor="@color/light_grey"
android:textSize="70px"
android:textStyle="bold"
android:textColor="@color/light_grey"
android:visibility="gone"
tools:text="20" />
<!-- minute -->
@ -235,8 +234,8 @@
android:id="@+id/minute"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="158px"
android:layout_marginLeft="210px"
android:layout_marginTop="158px"
android:fontFamily="@font/roboto_condensed_bold"
android:textColor="@color/light_grey"
android:textSize="46px"
@ -247,8 +246,8 @@
android:id="@+id/second"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="158px"
android:layout_marginLeft="210px"
android:layout_marginTop="158px"
android:fontFamily="@font/roboto_condensed_bold"
android:textColor="@color/light_grey"
android:textSize="46px"
@ -265,9 +264,9 @@
android:layout_marginLeft="210px"
android:layout_marginTop="205px"
android:fontFamily="@font/roboto_condensed_bold"
android:textColor="@color/light_grey"
android:textSize="17px"
android:textStyle="bold"
android:textColor="@color/light_grey"
android:visibility="gone"
tools:text="AM" />
@ -275,12 +274,12 @@
android:id="@+id/day_name"
android:layout_width="56px"
android:layout_height="36px"
android:layout_marginTop="172px"
android:layout_marginLeft="120px"
android:layout_marginTop="172px"
android:gravity="center"
android:textColor="@color/white"
android:textSize="24px"
android:textStyle="bold"
android:textColor="@color/white"
android:visibility="visible"
tools:text="day" />
@ -288,24 +287,24 @@
android:id="@+id/day"
android:layout_width="56px"
android:layout_height="36px"
android:layout_marginTop="198px"
android:layout_marginLeft="120px"
android:layout_marginTop="198px"
android:gravity="center"
android:textStyle="bold"
android:textSize="24px"
android:textColor="@color/white"
android:textSize="24px"
android:textStyle="bold"
tools:text="01" />
<TextView
android:id="@+id/week_number"
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
android:layout_marginTop="0px"
android:gravity="center"
android:textStyle="bold"
android:textColor="@color/white"
android:textSize="24px"
android:textStyle="bold"
android:visibility="gone"
tools:text="ww" />
@ -313,60 +312,60 @@
android:id="@+id/month"
android:layout_width="50px"
android:layout_height="36px"
android:layout_marginTop="180px"
android:layout_marginLeft="220px"
android:layout_marginTop="180px"
android:gravity="center"
android:textStyle="bold"
android:textSize="24px"
android:textColor="@color/white"
android:textSize="24px"
android:textStyle="bold"
tools:text="févr." />
<TextView
android:id="@+id/loop"
android:layout_width="50px"
android:layout_height="50px"
android:layout_marginTop="61px"
android:layout_marginLeft="68px"
android:layout_marginTop="61px"
android:background="@drawable/loop_grey_25"
android:gravity="center"
android:textColor="@color/light_grey"
android:textSize="24px"
android:textStyle="bold"
android:textColor="@color/light_grey"
tools:text="--'" />
<ImageView
android:id="@+id/direction2"
android:layout_width="40px"
android:layout_height="40px"
android:layout_marginTop="36px"
android:layout_marginLeft="291px"
android:visibility="visible"
android:layout_marginTop="36px"
android:orientation="vertical"
android:src="@drawable/ic_invalid"
android:orientation="vertical" />
android:visibility="visible" />
<TextView
android:id="@+id/timestamp"
android:layout_width="52px"
android:layout_height="34px"
android:gravity="left"
android:layout_marginTop="79px"
android:layout_marginLeft="291px"
android:layout_marginTop="79px"
android:gravity="left"
android:textColor="@color/light_grey"
android:textSize="25px"
android:textStyle="bold"
android:textColor="@color/light_grey"
tools:text="--'" />
<TextView
android:id="@+id/sgv"
android:layout_width="400px"
android:layout_height="100px"
android:layout_marginLeft="0px"
android:layout_marginTop="26px"
android:fontFamily="@font/roboto_condensed_bold"
android:gravity="center"
android:lines="1"
android:layout_marginTop="26px"
android:layout_marginLeft="0px"
android:fontFamily="@font/roboto_condensed_bold"
android:textSize="74px"
android:textColor="@color/light_grey"
android:textSize="74px"
tools:text="200" />
<ImageView
@ -374,8 +373,8 @@
android:layout_width="400px"
android:layout_height="400px"
android:orientation="vertical"
android:visibility="visible"
android:src="@drawable/simplified_dial" />
android:src="@drawable/simplified_dial"
android:visibility="visible" />
<ImageView
android:id="@+id/hour_hand"

View file

@ -24,13 +24,13 @@
android:textSize="18sp"
tools:text="Title" />
<info.nightscout.androidaps.nondeprecated.GridViewPagerNonDeprecated
<app.aaps.wear.nondeprecated.GridViewPagerNonDeprecated
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true" />
<info.nightscout.androidaps.nondeprecated.DotsPageIndicatorNonDeprecated
<app.aaps.wear.nondeprecated.DotsPageIndicatorNonDeprecated
android:id="@+id/page_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -1,14 +1,14 @@
package info.nightscout.androidaps
package app.aaps.wear
import android.content.Context
import android.content.SharedPreferences
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.shared.tests.TestBase
import info.nightscout.androidaps.interaction.utils.Constants
import info.nightscout.androidaps.interaction.utils.Persistence
import info.nightscout.androidaps.interaction.utils.WearUtil
import info.nightscout.androidaps.testing.mocks.SharedPreferencesMock
import app.aaps.wear.interaction.utils.Constants
import app.aaps.wear.interaction.utils.Persistence
import app.aaps.wear.interaction.utils.WearUtil
import app.aaps.wear.testing.mocks.SharedPreferencesMock
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import org.junit.jupiter.api.BeforeEach

Some files were not shown because too many files have changed in this diff Show more