WearPlugin -> SYNC
This commit is contained in:
parent
c050313ebb
commit
d054ed3d1f
25 changed files with 167 additions and 159 deletions
|
@ -44,7 +44,7 @@ import app.aaps.plugins.constraints.safety.SafetyPlugin
|
|||
import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin
|
||||
import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin
|
||||
import app.aaps.plugins.sync.garmin.GarminPlugin
|
||||
import app.aaps.plugins.main.general.wear.WearPlugin
|
||||
import app.aaps.plugins.sync.wear.WearPlugin
|
||||
import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin
|
||||
import app.aaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import app.aaps.plugins.sensitivity.SensitivityWeightedAveragePlugin
|
||||
|
|
|
@ -27,7 +27,7 @@ import app.aaps.plugins.main.general.overview.OverviewPlugin
|
|||
import app.aaps.plugins.main.general.persistentNotification.PersistentNotificationPlugin
|
||||
import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin
|
||||
import app.aaps.plugins.main.general.themes.ThemeSwitcherPlugin
|
||||
import app.aaps.plugins.main.general.wear.WearPlugin
|
||||
import app.aaps.plugins.sync.wear.WearPlugin
|
||||
import app.aaps.plugins.main.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import app.aaps.plugins.main.profile.ProfilePlugin
|
||||
import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin
|
||||
|
@ -310,12 +310,6 @@ abstract class PluginsListModule {
|
|||
@IntKey(320)
|
||||
abstract fun bindFoodPlugin(plugin: FoodPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@AllConfigs
|
||||
@IntoMap
|
||||
@IntKey(330)
|
||||
abstract fun bindWearPlugin(plugin: WearPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@AllConfigs
|
||||
@IntoMap
|
||||
|
@ -341,16 +335,28 @@ abstract class PluginsListModule {
|
|||
abstract fun bindXdripPlugin(plugin: XdripPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@AllConfigs
|
||||
@NotNSClient
|
||||
@IntoMap
|
||||
@IntKey(366)
|
||||
abstract fun bindsOpenHumansPlugin(plugin: OpenHumansUploaderPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@AllConfigs
|
||||
@IntoMap
|
||||
@IntKey(367)
|
||||
abstract fun bindWearPlugin(plugin: WearPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@AllConfigs
|
||||
@IntoMap
|
||||
@IntKey(368)
|
||||
abstract fun bindDataBroadcastPlugin(plugin: DataBroadcastPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@NotNSClient
|
||||
@AllConfigs
|
||||
@IntoMap
|
||||
@IntKey(368)
|
||||
abstract fun bindsOpenHumansPlugin(plugin: OpenHumansUploaderPlugin): PluginBase
|
||||
@IntKey(369)
|
||||
abstract fun bindGarminPlugin(plugin: GarminPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@AllConfigs
|
||||
|
@ -466,12 +472,6 @@ abstract class PluginsListModule {
|
|||
@IntKey(610)
|
||||
abstract fun bindAvgSmoothingPlugin(plugin: AvgSmoothingPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@AllConfigs
|
||||
@IntoMap
|
||||
@IntKey(623)
|
||||
abstract fun bindGarminPlugin(plugin: GarminPlugin): PluginBase
|
||||
|
||||
@Qualifier
|
||||
annotation class AllConfigs
|
||||
|
||||
|
|
|
@ -45,7 +45,4 @@ dependencies {
|
|||
|
||||
// Food
|
||||
api "androidx.work:work-runtime-ktx:$work_version"
|
||||
|
||||
// DataLayerListenerService
|
||||
api "com.google.android.gms:play-services-wearable:$play_services_wearable_version"
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".general.wear.activities.CwfInfosActivity"
|
||||
android:name="app.aaps.plugins.sync.wear.activities.CwfInfosActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme" />
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
android:exported="false" />
|
||||
|
||||
<service
|
||||
android:name=".general.wear.wearintegration.DataLayerListenerServiceMobile"
|
||||
android:name="app.aaps.plugins.sync.wear.wearintegration.DataLayerListenerServiceMobile"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.wearable.CHANNEL_EVENT" />
|
||||
|
|
|
@ -4,7 +4,6 @@ import app.aaps.core.interfaces.iob.IobCobCalculator
|
|||
import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator
|
||||
import app.aaps.plugins.main.general.persistentNotification.DummyService
|
||||
import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin
|
||||
import app.aaps.plugins.main.general.wear.WearFragment
|
||||
import app.aaps.plugins.main.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import app.aaps.plugins.main.iob.iobCobCalculator.data.AutosensDataObject
|
||||
import dagger.Binds
|
||||
|
@ -21,7 +20,6 @@ import dagger.android.ContributesAndroidInjector
|
|||
SkinsModule::class,
|
||||
SkinsUiModule::class,
|
||||
ActionsModule::class,
|
||||
WearModule::class,
|
||||
OverviewModule::class,
|
||||
]
|
||||
)
|
||||
|
@ -29,7 +27,6 @@ import dagger.android.ContributesAndroidInjector
|
|||
@Suppress("unused")
|
||||
abstract class PluginsModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment
|
||||
@ContributesAndroidInjector abstract fun contributesDummyService(): DummyService
|
||||
@ContributesAndroidInjector abstract fun autosensDataObjectInjector(): AutosensDataObject
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
package app.aaps.plugins.main.di
|
||||
|
||||
import app.aaps.plugins.main.general.wear.activities.CwfInfosActivity
|
||||
import app.aaps.plugins.main.general.wear.wearintegration.DataLayerListenerServiceMobile
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class WearModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): DataLayerListenerServiceMobile
|
||||
@ContributesAndroidInjector abstract fun contributesCustomWatchfaceInfosActivity(): CwfInfosActivity
|
||||
}
|
|
@ -330,76 +330,9 @@
|
|||
<string name="send_logfiles">Send today\'s log files to developers along with this time. Unexpected situation.</string>
|
||||
<string name="iob_cob_calculator" translatable="false">IobCobCalculator</string>
|
||||
|
||||
<!-- Wear-->
|
||||
<string name="wear_shortname">WEAR</string>
|
||||
<string name="description_wear">Monitor and control AAPS using your WearOS watch.</string>
|
||||
<string name="no_watch_connected">(No Watch Connected)</string>
|
||||
<string name="pump_status">Pump status</string>
|
||||
<string name="loop_status">Loop status</string>
|
||||
<string name="wizard_result">Calc. Wizard:\nInsulin: %1$.2fU\nCarbs: %2$dg</string>
|
||||
<string name="quick_wizard_not_available">Selected quickwizard no longer available, please refresh your tile</string>
|
||||
<string name="quick_wizard_message">QuickWizard: %1$s\nInsulin: %2$.2fU\nCarbs: %3$dg</string>
|
||||
<string name="wear_action_tempt_preset_error">Temptarget unknown preset: %1$s</string>
|
||||
<string name="wear_action_tempt_cancel_message">Cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_unit_error">Different units used on watch and phone!</string>
|
||||
<string name="wear_action_tempt_zero_message">Zero-Temp-Target - cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_min_bg_error">Min-BG out of range!</string>
|
||||
<string name="wear_action_tempt_max_bg_error">Max-BG out of range!</string>
|
||||
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDuration: %3$s</string>
|
||||
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDuration: %2$s</string>
|
||||
<string name="wear_action_tempt_preset_message">Temptarget:\nReason: %1$s\nTarget: %2$s\nDuration: %3$s</string>
|
||||
<string name="no_success">not successful - please check phone</string>
|
||||
<string name="wear_settings">Wear settings</string>
|
||||
<string name="wearcontrol_title">Controls from Watch</string>
|
||||
<string name="wearcontrol_summary">Set Temp-Targets and enter Treatments from the watch.</string>
|
||||
<string name="wear_wizard_settings_summary">Calculations included in the Wizard result:</string>
|
||||
<string name="wear_general_settings">General Settings</string>
|
||||
<string name="wear_notifysmb_title">Notify on SMB</string>
|
||||
<string name="wear_notifysmb_summary">Show SMB on the watch like a standard bolus.</string>
|
||||
<string name="wear_custom_watchface_settings">Custom Watchface Settings</string>
|
||||
<string name="wear_custom_watchface_authorization_title">Custom Watchface Authorization</string>
|
||||
<string name="wear_custom_watchface_authorization_summary">Authorize loaded custom watchface to change and lock some watch display settings to suit watchface design</string>
|
||||
<string name="wear_custom_watchface">Custom Watchface: %1$s</string>
|
||||
<string name="wear_load_watchface">Load Watchface</string>
|
||||
<string name="wear_infos_watchface">Infos Watchface</string>
|
||||
<string name="wear_export_watchface">Export template</string>
|
||||
<string name="wear_new_custom_watchface_exported">Custom watchface template exported</string>
|
||||
<string name="resend_all_data">Resend All Data</string>
|
||||
<string name="open_settings_on_wear">Open Settings on Wear</string>
|
||||
<string name="cwf_infos_pref_locked">List of prefs locked by the Watchface</string>
|
||||
<string name="cwf_infos_pref_required">List of prefs required for the Watchface</string>
|
||||
<string name="cwf_infos_view_title">List of fields included into the Watchface</string>
|
||||
|
||||
|
||||
<!-- PersistentNotification-->
|
||||
<string name="ongoingnotificaction" translatable="false">Ongoing Notification</string>
|
||||
<string name="description_persistent_notification">Shows an ongoing notification with a short overview of what your loop is doing</string>
|
||||
<string name="old_data">OLD DATA</string>
|
||||
<string name="pump_fetching_data">trying to fetch data from pump.</string>
|
||||
<string name="pump_old_data">TDD: Still old data! Cannot load from pump.</string>
|
||||
<string name="grams_short">g</string>
|
||||
<string name="hour_short">h</string>
|
||||
<string name="no_active_profile">No active profile switch!</string>
|
||||
<string name="profile_message">Profile:\n\nTimeshift: %1$d\nPercentage: %2$d%%\"</string>
|
||||
<string name="tdd_line">%1$.2fU %1$.0f%%</string>
|
||||
<string name="no_profile">No profile loaded</string>
|
||||
<string name="aps_only">Only apply in APS mode!</string>
|
||||
<string name="last_aps_result_na">Last result not available!</string>
|
||||
<string name="loop_status_closed">CLOSED LOOP</string>
|
||||
<string name="loop_status_open">OPEN LOOP</string>
|
||||
<string name="loop_status_disabled">LOOP DISABLED</string>
|
||||
<string name="aps">APS</string>
|
||||
<string name="last_run">Last run</string>
|
||||
<string name="last_enact">Last Enact</string>
|
||||
<string name="today">Today</string>
|
||||
<string name="weighted">weighted</string>
|
||||
<string name="target_only_aps_mode">Targets only apply in APS mode!</string>
|
||||
<string name="no_history">No history data!</string>
|
||||
<string name="units_short">U</string>
|
||||
<string name="temp_target">Temp Target</string>
|
||||
<string name="until">until</string>
|
||||
<string name="default_range">DEFAULT RANGE</string>
|
||||
<string name="target">target</string>
|
||||
<string name="rate_duration">Rate: %1$.2fU/h (%2$.2f%%) \nDuration %3$d min</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -19,8 +19,9 @@ dependencies {
|
|||
implementation project(':shared:impl')
|
||||
implementation project(':database:entities')
|
||||
implementation project(':database:impl')
|
||||
implementation project(':core:main')
|
||||
implementation project(':core:graphview')
|
||||
implementation project(':core:interfaces')
|
||||
implementation project(':core:main')
|
||||
implementation project(':core:nssdk')
|
||||
implementation project(':core:ui')
|
||||
implementation project(':core:utils')
|
||||
|
@ -44,9 +45,11 @@ dependencies {
|
|||
api("io.socket:socket.io-client:2.1.0")
|
||||
api "com.squareup.okhttp3:okhttp:$okhttp3_version"
|
||||
api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version"
|
||||
//api "com.squareup.retrofit2:retrofit:$retrofit2_version"
|
||||
api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version"
|
||||
api "com.squareup.retrofit2:converter-gson:$retrofit2_version"
|
||||
|
||||
api "com.google.code.gson:gson:$gson_version"
|
||||
|
||||
// DataLayerListenerService
|
||||
api "com.google.android.gms:play-services-wearable:$play_services_wearable_version"
|
||||
}
|
|
@ -63,7 +63,9 @@ class DataBroadcastPlugin @Inject constructor(
|
|||
) : PluginBase(
|
||||
PluginDescription()
|
||||
.mainType(PluginType.SYNC)
|
||||
.pluginIcon(app.aaps.core.main.R.drawable.ic_watch)
|
||||
.pluginName(R.string.data_broadcaster)
|
||||
.shortName(R.string.data_broadcaster_short)
|
||||
.description(R.string.data_broadcaster_description),
|
||||
aapsLogger, rh, injector
|
||||
) {
|
||||
|
|
|
@ -27,6 +27,9 @@ import app.aaps.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker
|
|||
import app.aaps.plugins.sync.nsclientV3.workers.LoadStatusWorker
|
||||
import app.aaps.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker
|
||||
import app.aaps.plugins.sync.tidepool.TidepoolFragment
|
||||
import app.aaps.plugins.sync.wear.WearFragment
|
||||
import app.aaps.plugins.sync.wear.activities.CwfInfosActivity
|
||||
import app.aaps.plugins.sync.wear.wearintegration.DataLayerListenerServiceMobile
|
||||
import app.aaps.plugins.sync.xdrip.DataSyncSelectorXdripImpl
|
||||
import app.aaps.plugins.sync.xdrip.XdripFragment
|
||||
import app.aaps.plugins.sync.xdrip.XdripPlugin
|
||||
|
@ -67,6 +70,9 @@ abstract class SyncModule {
|
|||
@ContributesAndroidInjector abstract fun contributesTidepoolFragment(): TidepoolFragment
|
||||
@ContributesAndroidInjector abstract fun contributesXdripFragment(): XdripFragment
|
||||
@ContributesAndroidInjector abstract fun contributesXdripDataSyncWorker(): XdripDataSyncWorker
|
||||
@ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment
|
||||
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): DataLayerListenerServiceMobile
|
||||
@ContributesAndroidInjector abstract fun contributesCustomWatchfaceInfosActivity(): CwfInfosActivity
|
||||
|
||||
@Module
|
||||
open class Provide {
|
||||
|
|
|
@ -4,9 +4,21 @@ import android.os.StrictMode
|
|||
import androidx.annotation.VisibleForTesting
|
||||
import app.aaps.core.interfaces.logging.AAPSLogger
|
||||
import app.aaps.core.interfaces.logging.LTag
|
||||
import java.io.*
|
||||
import java.io.BufferedOutputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.Closeable
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import java.lang.Thread.UncaughtExceptionHandler
|
||||
import java.net.*
|
||||
import java.net.HttpURLConnection
|
||||
import java.net.Inet4Address
|
||||
import java.net.InetSocketAddress
|
||||
import java.net.ServerSocket
|
||||
import java.net.Socket
|
||||
import java.net.SocketAddress
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.URI
|
||||
import java.nio.charset.Charset
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.time.Duration
|
||||
|
@ -18,10 +30,11 @@ import java.util.regex.Pattern
|
|||
import kotlin.concurrent.withLock
|
||||
|
||||
/** Basic HTTP server to communicate with Garmin device via localhost. */
|
||||
class HttpServer internal constructor(private var aapsLogger: AAPSLogger, val port: Int): Closeable {
|
||||
class HttpServer internal constructor(private var aapsLogger: AAPSLogger, val port: Int) : Closeable {
|
||||
|
||||
private val serverThread: Thread
|
||||
private val workerExecutor: Executor = Executors.newCachedThreadPool()
|
||||
private val endpoints: MutableMap<String, (SocketAddress, URI, String?)->CharSequence> =
|
||||
private val endpoints: MutableMap<String, (SocketAddress, URI, String?) -> CharSequence> =
|
||||
ConcurrentHashMap()
|
||||
private var serverSocket: ServerSocket? = null
|
||||
private val readyLock = ReentrantLock()
|
||||
|
@ -63,18 +76,18 @@ class HttpServer internal constructor(private var aapsLogger: AAPSLogger, val po
|
|||
}
|
||||
|
||||
/** Register an endpoint (path) to handle requests. */
|
||||
fun registerEndpoint(path: String, endpoint: (SocketAddress, URI, String?)->CharSequence) {
|
||||
aapsLogger.info(LTag.GARMIN,"Register: '$path'")
|
||||
fun registerEndpoint(path: String, endpoint: (SocketAddress, URI, String?) -> CharSequence) {
|
||||
aapsLogger.info(LTag.GARMIN, "Register: '$path'")
|
||||
endpoints[path] = endpoint
|
||||
}
|
||||
|
||||
|
||||
// @Suppress("all")
|
||||
private fun respond(
|
||||
@Suppress("SameParameterValue") code: Int,
|
||||
body: CharSequence,
|
||||
@Suppress("SameParameterValue") contentType: String,
|
||||
out: OutputStream) {
|
||||
out: OutputStream
|
||||
) {
|
||||
respond(code, body.toString().toByteArray(Charset.forName("UTF8")), contentType, out)
|
||||
}
|
||||
|
||||
|
@ -143,12 +156,14 @@ class HttpServer internal constructor(private var aapsLogger: AAPSLogger, val po
|
|||
// Garmin will only connect to IP4 localhost. Therefore, we need to explicitly listen
|
||||
// on that loopback interface and cannot use InetAddress.getLoopbackAddress(). That
|
||||
// gives ::1 (IP6 localhost).
|
||||
InetSocketAddress(Inet4Address.getByAddress(byteArrayOf(127, 0, 0, 1)), port))
|
||||
readyCond.signalAll() }
|
||||
aapsLogger.info(LTag.GARMIN,"accept connections on " + serverSocket!!.localSocketAddress)
|
||||
InetSocketAddress(Inet4Address.getByAddress(byteArrayOf(127, 0, 0, 1)), port)
|
||||
)
|
||||
readyCond.signalAll()
|
||||
}
|
||||
aapsLogger.info(LTag.GARMIN, "accept connections on " + serverSocket!!.localSocketAddress)
|
||||
while (true) {
|
||||
val socket = serverSocket!!.accept()
|
||||
aapsLogger.info(LTag.GARMIN,"accept " + socket.remoteSocketAddress)
|
||||
aapsLogger.info(LTag.GARMIN, "accept " + socket.remoteSocketAddress)
|
||||
workerExecutor.execute {
|
||||
Thread.currentThread().name = "worker" + Thread.currentThread().id
|
||||
try {
|
||||
|
@ -173,14 +188,16 @@ class HttpServer internal constructor(private var aapsLogger: AAPSLogger, val po
|
|||
}
|
||||
|
||||
companion object {
|
||||
|
||||
private val REQUEST_HEADER = Pattern.compile("(GET|POST) (\\S*) HTTP/1.1")
|
||||
private val HEADER_LINE = Pattern.compile("([A-Za-z-]+)\\s*:\\s*(.*)")
|
||||
|
||||
private fun readLine(input: InputStream, charset: Charset): String {
|
||||
val buffer = ByteArrayOutputStream(input.available())
|
||||
loop@while (true) {
|
||||
loop@ while (true) {
|
||||
when (val c = input.read()) {
|
||||
'\r'.code -> {}
|
||||
|
||||
-1 -> break@loop
|
||||
'\n'.code -> break@loop
|
||||
else -> buffer.write(c)
|
||||
|
@ -224,10 +241,7 @@ class HttpServer internal constructor(private var aapsLogger: AAPSLogger, val po
|
|||
}
|
||||
var body: String?
|
||||
if (post) {
|
||||
var contentLength = Int.MAX_VALUE
|
||||
if (headers.containsKey("Content-Length")) {
|
||||
contentLength = headers["Content-Length"]!!.toInt()
|
||||
}
|
||||
val contentLength = headers["Content-Length"]?.toInt() ?: Int.MAX_VALUE
|
||||
val keepAlive = ("Keep-Alive" == headers["Connection"])
|
||||
val contentType = headers["Content-Type"]
|
||||
if (keepAlive && contentLength == Int.MAX_VALUE) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package app.aaps.plugins.main.general.wear
|
||||
package app.aaps.plugins.sync.wear
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
|
@ -21,9 +21,9 @@ import app.aaps.core.interfaces.sharedPreferences.SP
|
|||
import app.aaps.core.interfaces.utils.DateUtil
|
||||
import app.aaps.core.interfaces.utils.fabric.FabricPrivacy
|
||||
import app.aaps.core.ui.toast.ToastUtils
|
||||
import app.aaps.plugins.main.R
|
||||
import app.aaps.plugins.main.databinding.WearFragmentBinding
|
||||
import app.aaps.plugins.main.general.wear.activities.CwfInfosActivity
|
||||
import app.aaps.plugins.sync.R
|
||||
import app.aaps.plugins.sync.databinding.WearFragmentBinding
|
||||
import app.aaps.plugins.sync.wear.activities.CwfInfosActivity
|
||||
import dagger.android.support.DaggerFragment
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
|
@ -1,4 +1,4 @@
|
|||
package app.aaps.plugins.main.general.wear
|
||||
package app.aaps.plugins.sync.wear
|
||||
|
||||
import android.content.Context
|
||||
import app.aaps.core.interfaces.logging.AAPSLogger
|
||||
|
@ -20,9 +20,9 @@ import app.aaps.core.interfaces.rx.weardata.CwfMetadataKey
|
|||
import app.aaps.core.interfaces.rx.weardata.EventData
|
||||
import app.aaps.core.interfaces.sharedPreferences.SP
|
||||
import app.aaps.core.interfaces.utils.fabric.FabricPrivacy
|
||||
import app.aaps.plugins.main.R
|
||||
import app.aaps.plugins.main.general.wear.wearintegration.DataHandlerMobile
|
||||
import app.aaps.plugins.main.general.wear.wearintegration.DataLayerListenerServiceMobileHelper
|
||||
import app.aaps.plugins.sync.R
|
||||
import app.aaps.plugins.sync.wear.wearintegration.DataHandlerMobile
|
||||
import app.aaps.plugins.sync.wear.wearintegration.DataLayerListenerServiceMobileHelper
|
||||
import dagger.android.HasAndroidInjector
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
|
@ -44,7 +44,7 @@ class WearPlugin @Inject constructor(
|
|||
|
||||
) : PluginBase(
|
||||
PluginDescription()
|
||||
.mainType(PluginType.GENERAL)
|
||||
.mainType(PluginType.SYNC)
|
||||
.fragmentClass(WearFragment::class.java.name)
|
||||
.pluginIcon(app.aaps.core.main.R.drawable.ic_watch)
|
||||
.pluginName(app.aaps.core.ui.R.string.wear)
|
|
@ -1,4 +1,4 @@
|
|||
package app.aaps.plugins.main.general.wear.activities
|
||||
package app.aaps.plugins.sync.wear.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
|
@ -24,11 +24,11 @@ import app.aaps.core.interfaces.sharedPreferences.SP
|
|||
import app.aaps.core.interfaces.utils.fabric.FabricPrivacy
|
||||
import app.aaps.core.interfaces.versionChecker.VersionCheckerUtils
|
||||
import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity
|
||||
import app.aaps.plugins.main.R
|
||||
import app.aaps.plugins.main.databinding.CwfInfosActivityBinding
|
||||
import app.aaps.plugins.main.databinding.CwfInfosActivityPrefItemBinding
|
||||
import app.aaps.plugins.main.databinding.CwfInfosActivityViewItemBinding
|
||||
import app.aaps.plugins.main.general.wear.WearPlugin
|
||||
import app.aaps.plugins.sync.R
|
||||
import app.aaps.plugins.sync.databinding.CwfInfosActivityBinding
|
||||
import app.aaps.plugins.sync.databinding.CwfInfosActivityPrefItemBinding
|
||||
import app.aaps.plugins.sync.databinding.CwfInfosActivityViewItemBinding
|
||||
import app.aaps.plugins.sync.wear.WearPlugin
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import org.json.JSONObject
|
||||
|
@ -192,7 +192,7 @@ class CwfInfosActivity : TranslatedDaggerAppCompatActivity() {
|
|||
|
||||
val visibleKeyPairs = mutableListOf<Pair<ViewKeys, Boolean>>()
|
||||
|
||||
for (viewKey in ViewKeys.values()) {
|
||||
for (viewKey in ViewKeys.entries) {
|
||||
try {
|
||||
val jsonValue = json.optJSONObject(viewKey.key)
|
||||
if (jsonValue != null) {
|
|
@ -1,4 +1,4 @@
|
|||
package app.aaps.plugins.main.general.wear.wearintegration
|
||||
package app.aaps.plugins.sync.wear.wearintegration
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
|
@ -67,11 +67,10 @@ import app.aaps.database.impl.AppRepository
|
|||
import app.aaps.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
||||
import app.aaps.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction
|
||||
import app.aaps.database.impl.transactions.InsertOrUpdateHeartRateTransaction
|
||||
import app.aaps.plugins.main.R
|
||||
import app.aaps.plugins.sync.R
|
||||
import dagger.android.HasAndroidInjector
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import org.json.JSONObject
|
||||
import java.text.DateFormat
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
|
@ -1,4 +1,4 @@
|
|||
package app.aaps.plugins.main.general.wear.wearintegration
|
||||
package app.aaps.plugins.sync.wear.wearintegration
|
||||
|
||||
import android.os.Binder
|
||||
import android.os.Handler
|
||||
|
@ -20,8 +20,8 @@ import app.aaps.core.interfaces.rx.weardata.EventData
|
|||
import app.aaps.core.interfaces.sharedPreferences.SP
|
||||
import app.aaps.core.interfaces.utils.fabric.FabricPrivacy
|
||||
import app.aaps.database.impl.AppRepository
|
||||
import app.aaps.plugins.main.R
|
||||
import app.aaps.plugins.main.general.wear.WearPlugin
|
||||
import app.aaps.plugins.sync.R
|
||||
import app.aaps.plugins.sync.wear.WearPlugin
|
||||
import com.google.android.gms.tasks.Tasks
|
||||
import com.google.android.gms.wearable.CapabilityClient
|
||||
import com.google.android.gms.wearable.CapabilityInfo
|
|
@ -1,4 +1,4 @@
|
|||
package app.aaps.plugins.main.general.wear.wearintegration
|
||||
package app.aaps.plugins.sync.wear.wearintegration
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
|
@ -6,7 +6,7 @@
|
|||
android:scrollbarStyle="outsideOverlay"
|
||||
android:scrollbars="vertical"
|
||||
android:paddingTop="2dp"
|
||||
tools:context=".general.wear.activities.CwfInfosActivity">
|
||||
tools:context="app.aaps.plugins.sync.wear.activities.CwfInfosActivity">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -58,7 +58,8 @@
|
|||
android:text="Author: Name"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?attr/importListFileNameColor"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/created_at"
|
||||
|
@ -71,7 +72,8 @@
|
|||
android:text="created at: "
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?attr/importListFileNameColor"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cwf_version"
|
||||
|
@ -85,7 +87,8 @@
|
|||
android:textAlignment="viewStart"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?attr/importListFileNameColor"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cwf_comment"
|
||||
|
@ -99,7 +102,8 @@
|
|||
android:textAlignment="viewStart"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?attr/importListFileNameColor"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pref_layout"
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/pref_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="0dp"
|
|
@ -3,7 +3,6 @@
|
|||
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/careportal_cardview"
|
||||
style="@style/Widget.MaterialComponents.CardView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -43,7 +42,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/view_comment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="0dp"
|
|
@ -5,7 +5,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="2dp"
|
||||
tools:context=".general.wear.WearFragment">
|
||||
tools:context="app.aaps.plugins.sync.wear.WearFragment">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/log"
|
|
@ -180,10 +180,78 @@
|
|||
|
||||
<!-- DataBroadcast-->
|
||||
<string name="data_broadcaster">Data Broadcaster</string>
|
||||
<string name="data_broadcaster_description" translatable="false">Broadcast data to other apps like Garmin watch</string>
|
||||
<string name="data_broadcaster_short">DBRO</string>
|
||||
<string name="data_broadcaster_description">Broadcast data to Garmin\'s G-Watch Wear App</string>
|
||||
|
||||
<!-- GarminPlugin -->
|
||||
<string name="garmin">Garmin</string>
|
||||
<string name="garmin_description">Connection to Garmin device (Fenix, Edge, …)</string>
|
||||
<string name="key_garmin_settings">Garmin settings</string>
|
||||
|
||||
<!-- Wear-->
|
||||
<string name="wear_shortname">WEAR</string>
|
||||
<string name="description_wear">Monitor and control AAPS using your WearOS watch.</string>
|
||||
<string name="no_watch_connected">(No Watch Connected)</string>
|
||||
<string name="pump_status">Pump status</string>
|
||||
<string name="loop_status">Loop status</string>
|
||||
<string name="wizard_result">Calc. Wizard:\nInsulin: %1$.2fU\nCarbs: %2$dg</string>
|
||||
<string name="quick_wizard_not_available">Selected quickwizard no longer available, please refresh your tile</string>
|
||||
<string name="quick_wizard_message">QuickWizard: %1$s\nInsulin: %2$.2fU\nCarbs: %3$dg</string>
|
||||
<string name="wear_action_tempt_preset_error">Temptarget unknown preset: %1$s</string>
|
||||
<string name="wear_action_tempt_cancel_message">Cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_unit_error">Different units used on watch and phone!</string>
|
||||
<string name="wear_action_tempt_zero_message">Zero-Temp-Target - cancelling running Temp-Targets?</string>
|
||||
<string name="wear_action_tempt_min_bg_error">Min-BG out of range!</string>
|
||||
<string name="wear_action_tempt_max_bg_error">Max-BG out of range!</string>
|
||||
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDuration: %3$s</string>
|
||||
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDuration: %2$s</string>
|
||||
<string name="wear_action_tempt_preset_message">Temptarget:\nReason: %1$s\nTarget: %2$s\nDuration: %3$s</string>
|
||||
<string name="no_success">not successful - please check phone</string>
|
||||
<string name="wear_settings">Wear settings</string>
|
||||
<string name="wearcontrol_title">Controls from Watch</string>
|
||||
<string name="wearcontrol_summary">Set Temp-Targets and enter Treatments from the watch.</string>
|
||||
<string name="wear_wizard_settings_summary">Calculations included in the Wizard result:</string>
|
||||
<string name="wear_general_settings">General Settings</string>
|
||||
<string name="wear_notifysmb_title">Notify on SMB</string>
|
||||
<string name="wear_notifysmb_summary">Show SMB on the watch like a standard bolus.</string>
|
||||
<string name="wear_custom_watchface_settings">Custom Watchface Settings</string>
|
||||
<string name="wear_custom_watchface_authorization_title">Custom Watchface Authorization</string>
|
||||
<string name="wear_custom_watchface_authorization_summary">Authorize loaded custom watchface to change and lock some watch display settings to suit watchface design</string>
|
||||
<string name="wear_custom_watchface">Custom Watchface: %1$s</string>
|
||||
<string name="wear_load_watchface">Load Watchface</string>
|
||||
<string name="wear_infos_watchface">Infos Watchface</string>
|
||||
<string name="wear_export_watchface">Export template</string>
|
||||
<string name="wear_new_custom_watchface_exported">Custom watchface template exported</string>
|
||||
<string name="resend_all_data">Resend All Data</string>
|
||||
<string name="open_settings_on_wear">Open Settings on Wear</string>
|
||||
<string name="cwf_infos_pref_locked">List of prefs locked by the Watchface</string>
|
||||
<string name="cwf_infos_pref_required">List of prefs required for the Watchface</string>
|
||||
<string name="cwf_infos_view_title">List of fields included into the Watchface</string>
|
||||
<string name="pump_fetching_data">trying to fetch data from pump.</string>
|
||||
<string name="pump_old_data">TDD: Still old data! Cannot load from pump.</string>
|
||||
<string name="units_short">U</string>
|
||||
<string name="grams_short">g</string>
|
||||
<string name="hour_short">h</string>
|
||||
<string name="no_active_profile">No active profile switch!</string>
|
||||
<string name="profile_message">Profile:\n\nTimeshift: %1$d\nPercentage: %2$d%%\"</string>
|
||||
<string name="target_only_aps_mode">Targets only apply in APS mode!</string>
|
||||
<string name="no_history">No history data!</string>
|
||||
<string name="temp_target">Temp Target</string>
|
||||
<string name="until">until</string>
|
||||
<string name="default_range">DEFAULT RANGE</string>
|
||||
<string name="target">target</string>
|
||||
<string name="rate_duration">Rate: %1$.2fU/h (%2$.2f%%) \nDuration %3$d min</string>
|
||||
<string name="no_profile">No profile loaded</string>
|
||||
<string name="aps_only">Only apply in APS mode!</string>
|
||||
<string name="last_aps_result_na">Last result not available!</string>
|
||||
<string name="loop_status_closed">CLOSED LOOP</string>
|
||||
<string name="loop_status_open">OPEN LOOP</string>
|
||||
<string name="loop_status_disabled">LOOP DISABLED</string>
|
||||
<string name="aps">APS</string>
|
||||
<string name="last_run">Last run</string>
|
||||
<string name="last_enact">Last Enact</string>
|
||||
<string name="tdd_line">%1$.2fU %1$.0f%%</string>
|
||||
<string name="today">Today</string>
|
||||
<string name="weighted">weighted</string>
|
||||
|
||||
</resources>
|
Loading…
Reference in a new issue