diff --git a/plugins/configuration/src/main/assets/AAPS.zip b/plugins/configuration/src/main/assets/AAPS.zip new file mode 100644 index 0000000000..fa1c9a7df8 Binary files /dev/null and b/plugins/configuration/src/main/assets/AAPS.zip differ diff --git a/wear/src/main/AndroidManifest.xml b/wear/src/main/AndroidManifest.xml index 78b8b21191..e78e3571a2 100644 --- a/wear/src/main/AndroidManifest.xml +++ b/wear/src/main/AndroidManifest.xml @@ -70,31 +70,6 @@ - - - - - - - - - - - - - - - diff --git a/wear/src/main/kotlin/app/aaps/wear/di/WearServicesModule.kt b/wear/src/main/kotlin/app/aaps/wear/di/WearServicesModule.kt index e1be969b11..cfcda2146f 100644 --- a/wear/src/main/kotlin/app/aaps/wear/di/WearServicesModule.kt +++ b/wear/src/main/kotlin/app/aaps/wear/di/WearServicesModule.kt @@ -20,7 +20,6 @@ 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.AapsWatchface import app.aaps.wear.watchfaces.BigChartWatchface import app.aaps.wear.watchfaces.CircleWatchface import app.aaps.wear.watchfaces.CustomWatchface @@ -51,7 +50,6 @@ abstract class WearServicesModule { @ContributesAndroidInjector abstract fun contributesWallpaperComplication(): WallpaperComplication @ContributesAndroidInjector abstract fun contributesBaseWatchFace(): BaseWatchFace - @ContributesAndroidInjector abstract fun contributesAapsWatchface(): AapsWatchface @ContributesAndroidInjector abstract fun contributesAapsLargeWatchface(): AapsLargeWatchface @ContributesAndroidInjector abstract fun contributesDigitalStyleWatchface(): DigitalStyleWatchface @ContributesAndroidInjector abstract fun contributesBIGChart(): BigChartWatchface diff --git a/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsWatchface.kt deleted file mode 100644 index 5523e06b88..0000000000 --- a/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsWatchface.kt +++ /dev/null @@ -1,107 +0,0 @@ -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 - -class AapsWatchface : BaseWatchFace() { - - private lateinit var binding: ActivityHomeBinding - - override fun inflateLayout(inflater: LayoutInflater): ViewBinding { - binding = ActivityHomeBinding.inflate(inflater) - return binding - } - - override fun setColorDark() { - binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background)) - binding.secondaryLayout.setBackgroundColor(ContextCompat.getColor(this, if (dividerMatchesBg) R.color.dark_background else R.color.dark_statusView)) - binding.time.setTextColor(ContextCompat.getColor(this, R.color.dark_mTime)) - val color = when (singleBg.sgvLevel) { - 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)) - binding.delta.setTextColor(ContextCompat.getColor(this, color)) - binding.direction.setTextColor(ContextCompat.getColor(this, color)) - - val colorTime = if (ageLevel == 1) if (dividerMatchesBg) R.color.dark_midColor else R.color.dark_mTimestamp1_home else R.color.dark_TimestampOld - binding.timestamp.setTextColor(ContextCompat.getColor(this, colorTime)) - - val colourBat = if (status.batteryLevel == 1) if (dividerMatchesBg) R.color.dark_midColor else R.color.dark_uploaderBattery else R.color.dark_uploaderBatteryEmpty - binding.uploaderBattery.setTextColor(ContextCompat.getColor(this, colourBat)) - - binding.status.setTextColor(ContextCompat.getColor(this, if (dividerMatchesBg) R.color.dark_midColor else R.color.dark_mStatus_home)) - - highColor = ContextCompat.getColor(this, R.color.dark_highColor) - lowColor = ContextCompat.getColor(this, R.color.dark_lowColor) - midColor = ContextCompat.getColor(this, R.color.dark_midColor) - gridColor = ContextCompat.getColor(this, R.color.dark_gridColor) - basalBackgroundColor = ContextCompat.getColor(this, R.color.basal_dark) - basalCenterColor = ContextCompat.getColor(this, R.color.basal_light) - pointSize = 2 - setupCharts() - - } - - override fun setColorLowRes() { - binding.time.setTextColor(ContextCompat.getColor(this, R.color.dark_mTime)) - binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background)) - binding.sgv.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor)) - binding.delta.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor)) - binding.timestamp.setTextColor(ContextCompat.getColor(this, R.color.dark_Timestamp)) - - highColor = ContextCompat.getColor(this, R.color.dark_midColor) - lowColor = ContextCompat.getColor(this, R.color.dark_midColor) - midColor = ContextCompat.getColor(this, R.color.dark_midColor) - gridColor = ContextCompat.getColor(this, R.color.dark_gridColor) - basalBackgroundColor = ContextCompat.getColor(this, R.color.basal_dark_lowres) - basalCenterColor = ContextCompat.getColor(this, R.color.basal_light_lowres) - pointSize = 2 - setupCharts() - } - - override fun setColorBright() { - if (currentWatchMode == WatchMode.INTERACTIVE) { - binding.secondaryLayout.setBackgroundColor(ContextCompat.getColor(this, if (dividerMatchesBg) R.color.light_background else R.color.light_stripe_background)) - 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 - else -> R.color.light_midColor - } - binding.sgv.setTextColor(ContextCompat.getColor(this, color)) - binding.delta.setTextColor(ContextCompat.getColor(this, color)) - binding.direction.setTextColor(ContextCompat.getColor(this, color)) - - val colorTime = if (ageLevel == 1) if (dividerMatchesBg) Color.BLACK else Color.WHITE else Color.RED - binding.timestamp.setTextColor(colorTime) - - val colourBat = if (status.batteryLevel == 1) if (dividerMatchesBg) Color.BLACK else Color.WHITE else Color.RED - binding.uploaderBattery.setTextColor(colourBat) - - binding.status.setTextColor(if (dividerMatchesBg) Color.BLACK else Color.WHITE) - binding.time.setTextColor(Color.BLACK) - - highColor = ContextCompat.getColor(this, R.color.light_highColor) - lowColor = ContextCompat.getColor(this, R.color.light_lowColor) - midColor = ContextCompat.getColor(this, R.color.light_midColor) - gridColor = ContextCompat.getColor(this, R.color.light_gridColor) - basalBackgroundColor = ContextCompat.getColor(this, R.color.basal_light) - basalCenterColor = ContextCompat.getColor(this, R.color.basal_dark) - pointSize = 2 - setupCharts() - - } else { - setColorDark() - } - } -} diff --git a/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/WatchfaceViewAdapter.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/WatchfaceViewAdapter.kt index 8e89ddc8e2..70748075b8 100644 --- a/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/WatchfaceViewAdapter.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/WatchfaceViewAdapter.kt @@ -4,7 +4,6 @@ import androidx.viewbinding.ViewBinding import app.aaps.wear.databinding.ActivityBigchartBinding import app.aaps.wear.databinding.ActivityCustomBinding import app.aaps.wear.databinding.ActivityDigitalstyleBinding -import app.aaps.wear.databinding.ActivityHomeBinding import app.aaps.wear.databinding.ActivityHomeLargeBinding import app.aaps.wear.databinding.ActivityNochartBinding @@ -14,7 +13,6 @@ import app.aaps.wear.databinding.ActivityNochartBinding */ class WatchfaceViewAdapter( aL: ActivityHomeLargeBinding? = null, - aa: ActivityHomeBinding? = null, bC: ActivityBigchartBinding? = null, ds: ActivityDigitalstyleBinding? = null, nC: ActivityNochartBinding? = null, @@ -22,7 +20,7 @@ class WatchfaceViewAdapter( ) { init { - if (aL == null && aa == null && bC == null && ds == null && nC == null && cU == null) { + if (aL == null && bC == null && ds == null && nC == null && cU == null) { throw IllegalArgumentException("Require at least on Binding parameter") } } @@ -31,29 +29,29 @@ class WatchfaceViewAdapter( // Required attributes val mainLayout = - aL?.mainLayout ?: aa?.mainLayout ?: bC?.mainLayout ?: bC?.mainLayout ?: ds?.mainLayout ?: nC?.mainLayout ?: cU?.mainLayout + aL?.mainLayout ?: bC?.mainLayout ?: bC?.mainLayout ?: ds?.mainLayout ?: nC?.mainLayout ?: cU?.mainLayout ?: throw IllegalArgumentException(errorMessage) val timestamp = - aL?.timestamp ?: aa?.timestamp ?: bC?.timestamp ?: bC?.timestamp ?: ds?.timestamp ?: nC?.timestamp ?: cU?.timestamp + aL?.timestamp ?: bC?.timestamp ?: bC?.timestamp ?: ds?.timestamp ?: nC?.timestamp ?: cU?.timestamp ?: throw IllegalArgumentException(errorMessage) val root = - aL?.root ?: aa?.root ?: bC?.root ?: bC?.root ?: ds?.root ?: nC?.root ?: cU?.root + aL?.root ?: bC?.root ?: bC?.root ?: ds?.root ?: nC?.root ?: cU?.root ?: throw IllegalArgumentException(errorMessage) // Optional attributes - val sgv = aL?.sgv ?: aa?.sgv ?: bC?.sgv ?: bC?.sgv ?: ds?.sgv ?: nC?.sgv ?: cU?.sgv - val direction = aL?.direction ?: aa?.direction ?: ds?.direction + val sgv = aL?.sgv ?: bC?.sgv ?: bC?.sgv ?: ds?.sgv ?: nC?.sgv ?: cU?.sgv + val direction = aL?.direction ?: ds?.direction val loop = cU?.loop - val delta = aL?.delta ?: aa?.delta ?: bC?.delta ?: bC?.delta ?: ds?.delta ?: nC?.delta ?: cU?.delta + val delta = aL?.delta ?: bC?.delta ?: bC?.delta ?: ds?.delta ?: nC?.delta ?: cU?.delta val avgDelta = bC?.avgDelta ?: bC?.avgDelta ?: ds?.avgDelta ?: nC?.avgDelta ?: cU?.avgDelta - val uploaderBattery = aL?.uploaderBattery ?: aa?.uploaderBattery ?: ds?.uploaderBattery ?: cU?.uploaderBattery + val uploaderBattery = aL?.uploaderBattery ?: ds?.uploaderBattery ?: cU?.uploaderBattery val rigBattery = ds?.rigBattery ?: cU?.rigBattery val basalRate = ds?.basalRate ?: cU?.basalRate val bgi = ds?.bgi ?: cU?.bgi val AAPSv2 = ds?.AAPSv2 ?: cU?.AAPSv2 val cob1 = ds?.cob1 ?: cU?.cob1 val cob2 = ds?.cob2 ?: cU?.cob2 - val time = aL?.time ?: aa?.time ?: bC?.time ?: bC?.time ?: nC?.time ?: cU?.time + val time = aL?.time ?: bC?.time ?: bC?.time ?: nC?.time ?: cU?.time val second = cU?.second val minute = ds?.minute ?: cU?.minute val hour = ds?.hour ?: cU?.hour @@ -61,8 +59,8 @@ class WatchfaceViewAdapter( val month = ds?.month ?: cU?.month val iob1 = ds?.iob1 ?: cU?.iob1 val iob2 = ds?.iob2 ?: cU?.iob2 - val chart = aa?.chart ?: bC?.chart ?: bC?.chart ?: ds?.chart ?: cU?.chart - val status = aL?.status ?: aa?.status ?: bC?.status ?: bC?.status ?: nC?.status + val chart = bC?.chart ?: bC?.chart ?: ds?.chart ?: cU?.chart + val status = aL?.status ?: bC?.status ?: bC?.status ?: nC?.status val timePeriod = ds?.timePeriod ?: aL?.timePeriod ?: nC?.timePeriod ?: bC?.timePeriod ?: cU?.timePeriod val dayName = ds?.dayName ?: cU?.dayName val mainMenuTap = ds?.mainMenuTap @@ -70,7 +68,7 @@ class WatchfaceViewAdapter( val dateTime = ds?.dateTime val weekNumber = ds?.weekNumber ?: cU?.weekNumber // val minuteHand = cU?.minuteHand - // val secondaryLayout = aL?.secondaryLayout ?: aa?.secondaryLayout ?: ds?.secondaryLayout + // val secondaryLayout = aL?.secondaryLayout ?: ds?.secondaryLayout // val hourHand = cU?.hourHand companion object { @@ -78,11 +76,10 @@ class WatchfaceViewAdapter( fun getBinding(bindLayout: ViewBinding): WatchfaceViewAdapter { return when (bindLayout) { is ActivityHomeLargeBinding -> WatchfaceViewAdapter(bindLayout) - is ActivityHomeBinding -> WatchfaceViewAdapter(null, bindLayout) - is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, bindLayout) - is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, bindLayout) - is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout) - is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout) + is ActivityBigchartBinding -> WatchfaceViewAdapter(null, bindLayout) + is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, bindLayout) + is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, bindLayout) + is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout) else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter") } } diff --git a/wear/src/main/res/drawable/watchface_graph.png b/wear/src/main/res/drawable/watchface_graph.png deleted file mode 100644 index af9e88a227..0000000000 Binary files a/wear/src/main/res/drawable/watchface_graph.png and /dev/null differ diff --git a/wear/src/main/res/drawable/watchface_graph_2.png b/wear/src/main/res/drawable/watchface_graph_2.png deleted file mode 100644 index de0aab2d42..0000000000 Binary files a/wear/src/main/res/drawable/watchface_graph_2.png and /dev/null differ diff --git a/wear/src/main/res/layout/activity_home.xml b/wear/src/main/res/layout/activity_home.xml deleted file mode 100644 index 6a046da239..0000000000 --- a/wear/src/main/res/layout/activity_home.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wear/src/main/res/values/strings.xml b/wear/src/main/res/values/strings.xml index 285977b53a..b346d4010c 100644 --- a/wear/src/main/res/values/strings.xml +++ b/wear/src/main/res/values/strings.xml @@ -2,7 +2,6 @@ AAPS AAPS - AAPS AAPS(Large) AAPS(BigChart) AAPS(NoChart) diff --git a/wear/src/main/res/xml/watch_face_configuration_home.xml b/wear/src/main/res/xml/watch_face_configuration_home.xml deleted file mode 100644 index a5e1feef89..0000000000 --- a/wear/src/main/res/xml/watch_face_configuration_home.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - -