Wear Remove AAPS V2 Watchface
This commit is contained in:
parent
5a8c9d2609
commit
b048a279ee
|
@ -95,31 +95,6 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service
|
|
||||||
android:name=".watchfaces.AapsV2Watchface"
|
|
||||||
android:allowEmbedded="true"
|
|
||||||
android:exported="false"
|
|
||||||
android:label="@string/label_watchface_v2"
|
|
||||||
android:permission="android.permission.BIND_WALLPAPER">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.service.wallpaper"
|
|
||||||
android:resource="@xml/watch_face" />
|
|
||||||
<meta-data
|
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
|
||||||
android:resource="@drawable/watchface_graph_2" />
|
|
||||||
<meta-data
|
|
||||||
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
|
||||||
android:value="watch_face_configuration_home2" />
|
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
|
||||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
|
||||||
|
|
||||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
|
||||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
|
||||||
</intent-filter>
|
|
||||||
</service>
|
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".watchfaces.AapsLargeWatchface"
|
android:name=".watchfaces.AapsLargeWatchface"
|
||||||
android:allowEmbedded="true"
|
android:allowEmbedded="true"
|
||||||
|
@ -602,7 +577,6 @@
|
||||||
<action android:name="watch_face_configuration_custom" />
|
<action android:name="watch_face_configuration_custom" />
|
||||||
<action android:name="watch_face_configuration_digitalstyle" />
|
<action android:name="watch_face_configuration_digitalstyle" />
|
||||||
<action android:name="watch_face_configuration_home" />
|
<action android:name="watch_face_configuration_home" />
|
||||||
<action android:name="watch_face_configuration_home2" />
|
|
||||||
<action android:name="watch_face_configuration_largehome" />
|
<action android:name="watch_face_configuration_largehome" />
|
||||||
<action android:name="watch_face_configuration_nochart" />
|
<action android:name="watch_face_configuration_nochart" />
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ import app.aaps.wear.tile.QuickWizardTileService
|
||||||
import app.aaps.wear.tile.TempTargetTileService
|
import app.aaps.wear.tile.TempTargetTileService
|
||||||
import app.aaps.wear.tile.TileBase
|
import app.aaps.wear.tile.TileBase
|
||||||
import app.aaps.wear.watchfaces.AapsLargeWatchface
|
import app.aaps.wear.watchfaces.AapsLargeWatchface
|
||||||
import app.aaps.wear.watchfaces.AapsV2Watchface
|
|
||||||
import app.aaps.wear.watchfaces.AapsWatchface
|
import app.aaps.wear.watchfaces.AapsWatchface
|
||||||
import app.aaps.wear.watchfaces.BigChartWatchface
|
import app.aaps.wear.watchfaces.BigChartWatchface
|
||||||
import app.aaps.wear.watchfaces.CircleWatchface
|
import app.aaps.wear.watchfaces.CircleWatchface
|
||||||
|
@ -53,7 +52,6 @@ abstract class WearServicesModule {
|
||||||
|
|
||||||
@ContributesAndroidInjector abstract fun contributesBaseWatchFace(): BaseWatchFace
|
@ContributesAndroidInjector abstract fun contributesBaseWatchFace(): BaseWatchFace
|
||||||
@ContributesAndroidInjector abstract fun contributesAapsWatchface(): AapsWatchface
|
@ContributesAndroidInjector abstract fun contributesAapsWatchface(): AapsWatchface
|
||||||
@ContributesAndroidInjector abstract fun contributesAapsV2Watchface(): AapsV2Watchface
|
|
||||||
@ContributesAndroidInjector abstract fun contributesAapsLargeWatchface(): AapsLargeWatchface
|
@ContributesAndroidInjector abstract fun contributesAapsLargeWatchface(): AapsLargeWatchface
|
||||||
@ContributesAndroidInjector abstract fun contributesDigitalStyleWatchface(): DigitalStyleWatchface
|
@ContributesAndroidInjector abstract fun contributesDigitalStyleWatchface(): DigitalStyleWatchface
|
||||||
@ContributesAndroidInjector abstract fun contributesBIGChart(): BigChartWatchface
|
@ContributesAndroidInjector abstract fun contributesBIGChart(): BigChartWatchface
|
||||||
|
|
|
@ -1,172 +0,0 @@
|
||||||
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
|
|
||||||
|
|
||||||
class AapsV2Watchface : BaseWatchFace() {
|
|
||||||
|
|
||||||
private lateinit var binding: ActivityHome2Binding
|
|
||||||
|
|
||||||
override fun inflateLayout(inflater: LayoutInflater): ViewBinding {
|
|
||||||
binding = ActivityHome2Binding.inflate(inflater)
|
|
||||||
return binding
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setColorDark() {
|
|
||||||
@ColorInt val dividerTxtColor = if (dividerMatchesBg) ContextCompat.getColor(this, R.color.dark_midColor) else Color.BLACK
|
|
||||||
@ColorInt val dividerBatteryOkColor = ContextCompat.getColor(this, if (dividerMatchesBg) R.color.dark_midColor else R.color.dark_uploaderBattery)
|
|
||||||
@ColorInt val dividerBgColor = ContextCompat.getColor(this, if (dividerMatchesBg) R.color.dark_background else R.color.dark_statusView)
|
|
||||||
binding.secondaryLayout.setBackgroundColor(dividerBgColor)
|
|
||||||
binding.tertiaryLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background))
|
|
||||||
binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background))
|
|
||||||
binding.time.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.iob1.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.iob2.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.cob1.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.cob2.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.day.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.month.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.loop.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
setTextSizes()
|
|
||||||
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.direction.setTextColor(ContextCompat.getColor(this, color))
|
|
||||||
|
|
||||||
val colorTime = if (ageLevel == 1) R.color.dark_midColor else R.color.dark_TimestampOld
|
|
||||||
binding.timestamp.setTextColor(ContextCompat.getColor(this, colorTime))
|
|
||||||
val colourBat = if (status.batteryLevel == 1) dividerBatteryOkColor else ContextCompat.getColor(this, R.color.dark_uploaderBatteryEmpty)
|
|
||||||
binding.uploaderBattery.setTextColor(colourBat)
|
|
||||||
|
|
||||||
binding.rigBattery.setTextColor(dividerTxtColor)
|
|
||||||
binding.delta.setTextColor(dividerTxtColor)
|
|
||||||
binding.avgDelta.setTextColor(dividerTxtColor)
|
|
||||||
binding.basalRate.setTextColor(dividerTxtColor)
|
|
||||||
binding.bgi.setTextColor(dividerTxtColor)
|
|
||||||
when (loopLevel) {
|
|
||||||
-1 -> binding.loop.setBackgroundResource(R.drawable.loop_grey_25)
|
|
||||||
1 -> binding.loop.setBackgroundResource(R.drawable.loop_green_25)
|
|
||||||
else -> binding.loop.setBackgroundResource(R.drawable.loop_red_25)
|
|
||||||
}
|
|
||||||
|
|
||||||
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() {
|
|
||||||
@ColorInt val dividerTxtColor = if (dividerMatchesBg) ContextCompat.getColor(this, R.color.dark_midColor) else Color.BLACK
|
|
||||||
@ColorInt val dividerBgColor = ContextCompat.getColor(this, if (dividerMatchesBg) R.color.dark_background else R.color.dark_statusView)
|
|
||||||
binding.secondaryLayout.setBackgroundColor(dividerBgColor)
|
|
||||||
binding.tertiaryLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background))
|
|
||||||
binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background))
|
|
||||||
binding.loop.setBackgroundResource(R.drawable.loop_grey_25)
|
|
||||||
binding.loop.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.sgv.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.direction.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.timestamp.setTextColor(ContextCompat.getColor(this, R.color.dark_Timestamp))
|
|
||||||
binding.delta.setTextColor(dividerTxtColor)
|
|
||||||
binding.avgDelta.setTextColor(dividerTxtColor)
|
|
||||||
binding.rigBattery.setTextColor(dividerTxtColor)
|
|
||||||
binding.uploaderBattery.setTextColor(dividerTxtColor)
|
|
||||||
binding.basalRate.setTextColor(dividerTxtColor)
|
|
||||||
binding.bgi.setTextColor(dividerTxtColor)
|
|
||||||
binding.iob1.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.iob2.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.cob1.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.cob2.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.day.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.month.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
|
|
||||||
binding.time.setTextColor(ContextCompat.getColor(this, R.color.dark_mTime))
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|
||||||
setTextSizes()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setColorBright() {
|
|
||||||
if (currentWatchMode == WatchMode.INTERACTIVE) {
|
|
||||||
@ColorInt val dividerTxtColor = if (dividerMatchesBg) Color.BLACK else ContextCompat.getColor(this, R.color.dark_midColor)
|
|
||||||
@ColorInt val dividerBgColor = ContextCompat.getColor(this, if (dividerMatchesBg) R.color.light_background else R.color.light_stripe_background)
|
|
||||||
binding.secondaryLayout.setBackgroundColor(dividerBgColor)
|
|
||||||
binding.tertiaryLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.light_background))
|
|
||||||
binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.light_background))
|
|
||||||
binding.time.setTextColor(Color.BLACK)
|
|
||||||
binding.iob1.setTextColor(Color.BLACK)
|
|
||||||
binding.iob2.setTextColor(Color.BLACK)
|
|
||||||
binding.cob1.setTextColor(Color.BLACK)
|
|
||||||
binding.cob2.setTextColor(Color.BLACK)
|
|
||||||
binding.day.setTextColor(Color.BLACK)
|
|
||||||
binding.month.setTextColor(Color.BLACK)
|
|
||||||
binding.loop.setTextColor(Color.BLACK)
|
|
||||||
setTextSizes()
|
|
||||||
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.direction.setTextColor(ContextCompat.getColor(this, color))
|
|
||||||
val colorTime = if (ageLevel == 1) Color.BLACK else Color.RED
|
|
||||||
binding.timestamp.setTextColor(colorTime)
|
|
||||||
val colourBat = if (status.batteryLevel == 1) dividerTxtColor else Color.RED
|
|
||||||
binding.uploaderBattery.setTextColor(colourBat)
|
|
||||||
binding.rigBattery.setTextColor(dividerTxtColor)
|
|
||||||
binding.delta.setTextColor(dividerTxtColor)
|
|
||||||
binding.avgDelta.setTextColor(dividerTxtColor)
|
|
||||||
binding.basalRate.setTextColor(dividerTxtColor)
|
|
||||||
binding.bgi.setTextColor(dividerTxtColor)
|
|
||||||
when (loopLevel) {
|
|
||||||
-1 -> binding.loop.setBackgroundResource(R.drawable.loop_grey_25)
|
|
||||||
1 -> binding.loop.setBackgroundResource(R.drawable.loop_green_25)
|
|
||||||
else -> binding.loop.setBackgroundResource(R.drawable.loop_red_25)
|
|
||||||
}
|
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setTextSizes() {
|
|
||||||
if (detailedIob) {
|
|
||||||
binding.iob1.textSize = 14f
|
|
||||||
binding.iob2.textSize = 10f
|
|
||||||
} else {
|
|
||||||
binding.iob1.textSize = 10f
|
|
||||||
binding.iob2.textSize = 14f
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,7 +4,6 @@ import androidx.viewbinding.ViewBinding
|
||||||
import app.aaps.wear.databinding.ActivityBigchartBinding
|
import app.aaps.wear.databinding.ActivityBigchartBinding
|
||||||
import app.aaps.wear.databinding.ActivityCustomBinding
|
import app.aaps.wear.databinding.ActivityCustomBinding
|
||||||
import app.aaps.wear.databinding.ActivityDigitalstyleBinding
|
import app.aaps.wear.databinding.ActivityDigitalstyleBinding
|
||||||
import app.aaps.wear.databinding.ActivityHome2Binding
|
|
||||||
import app.aaps.wear.databinding.ActivityHomeBinding
|
import app.aaps.wear.databinding.ActivityHomeBinding
|
||||||
import app.aaps.wear.databinding.ActivityHomeLargeBinding
|
import app.aaps.wear.databinding.ActivityHomeLargeBinding
|
||||||
import app.aaps.wear.databinding.ActivityNochartBinding
|
import app.aaps.wear.databinding.ActivityNochartBinding
|
||||||
|
@ -15,7 +14,6 @@ import app.aaps.wear.databinding.ActivityNochartBinding
|
||||||
*/
|
*/
|
||||||
class WatchfaceViewAdapter(
|
class WatchfaceViewAdapter(
|
||||||
aL: ActivityHomeLargeBinding? = null,
|
aL: ActivityHomeLargeBinding? = null,
|
||||||
a2: ActivityHome2Binding? = null,
|
|
||||||
aa: ActivityHomeBinding? = null,
|
aa: ActivityHomeBinding? = null,
|
||||||
bC: ActivityBigchartBinding? = null,
|
bC: ActivityBigchartBinding? = null,
|
||||||
ds: ActivityDigitalstyleBinding? = null,
|
ds: ActivityDigitalstyleBinding? = null,
|
||||||
|
@ -24,7 +22,7 @@ class WatchfaceViewAdapter(
|
||||||
) {
|
) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (aL == null && a2 == null && aa == null && bC == null && ds == null && nC == null && cU == null) {
|
if (aL == null && aa == null && bC == null && ds == null && nC == null && cU == null) {
|
||||||
throw IllegalArgumentException("Require at least on Binding parameter")
|
throw IllegalArgumentException("Require at least on Binding parameter")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,47 +31,46 @@ class WatchfaceViewAdapter(
|
||||||
|
|
||||||
// Required attributes
|
// Required attributes
|
||||||
val mainLayout =
|
val mainLayout =
|
||||||
aL?.mainLayout ?: a2?.mainLayout ?: aa?.mainLayout ?: bC?.mainLayout ?: bC?.mainLayout ?: ds?.mainLayout ?: nC?.mainLayout ?: cU?.mainLayout
|
aL?.mainLayout ?: aa?.mainLayout ?: bC?.mainLayout ?: bC?.mainLayout ?: ds?.mainLayout ?: nC?.mainLayout ?: cU?.mainLayout
|
||||||
?: throw IllegalArgumentException(errorMessage)
|
?: throw IllegalArgumentException(errorMessage)
|
||||||
val timestamp =
|
val timestamp =
|
||||||
aL?.timestamp ?: a2?.timestamp ?: aa?.timestamp ?: bC?.timestamp ?: bC?.timestamp ?: ds?.timestamp ?: nC?.timestamp ?: cU?.timestamp
|
aL?.timestamp ?: aa?.timestamp ?: bC?.timestamp ?: bC?.timestamp ?: ds?.timestamp ?: nC?.timestamp ?: cU?.timestamp
|
||||||
?: throw IllegalArgumentException(errorMessage)
|
?: throw IllegalArgumentException(errorMessage)
|
||||||
val root =
|
val root =
|
||||||
aL?.root ?: a2?.root ?: aa?.root ?: bC?.root ?: bC?.root ?: ds?.root ?: nC?.root ?: cU?.root
|
aL?.root ?: aa?.root ?: bC?.root ?: bC?.root ?: ds?.root ?: nC?.root ?: cU?.root
|
||||||
?: throw IllegalArgumentException(errorMessage)
|
?: throw IllegalArgumentException(errorMessage)
|
||||||
|
|
||||||
// Optional attributes
|
// Optional attributes
|
||||||
val sgv = aL?.sgv ?: a2?.sgv ?: aa?.sgv ?: bC?.sgv ?: bC?.sgv ?: ds?.sgv ?: nC?.sgv ?: cU?.sgv
|
val sgv = aL?.sgv ?: aa?.sgv ?: bC?.sgv ?: bC?.sgv ?: ds?.sgv ?: nC?.sgv ?: cU?.sgv
|
||||||
val direction = aL?.direction ?: a2?.direction ?: aa?.direction ?: ds?.direction
|
val direction = aL?.direction ?: aa?.direction ?: ds?.direction
|
||||||
val loop = a2?.loop ?: cU?.loop
|
val loop = cU?.loop
|
||||||
val delta = aL?.delta ?: a2?.delta ?: aa?.delta ?: bC?.delta ?: bC?.delta ?: ds?.delta ?: nC?.delta ?: cU?.delta
|
val delta = aL?.delta ?: aa?.delta ?: bC?.delta ?: bC?.delta ?: ds?.delta ?: nC?.delta ?: cU?.delta
|
||||||
val avgDelta = a2?.avgDelta ?: bC?.avgDelta ?: bC?.avgDelta ?: ds?.avgDelta ?: nC?.avgDelta ?: cU?.avgDelta
|
val avgDelta = bC?.avgDelta ?: bC?.avgDelta ?: ds?.avgDelta ?: nC?.avgDelta ?: cU?.avgDelta
|
||||||
val uploaderBattery = aL?.uploaderBattery ?: a2?.uploaderBattery ?: aa?.uploaderBattery ?: ds?.uploaderBattery ?: cU?.uploaderBattery
|
val uploaderBattery = aL?.uploaderBattery ?: aa?.uploaderBattery ?: ds?.uploaderBattery ?: cU?.uploaderBattery
|
||||||
val rigBattery = a2?.rigBattery ?: ds?.rigBattery ?: cU?.rigBattery
|
val rigBattery = ds?.rigBattery ?: cU?.rigBattery
|
||||||
val basalRate = a2?.basalRate ?: ds?.basalRate ?: cU?.basalRate
|
val basalRate = ds?.basalRate ?: cU?.basalRate
|
||||||
val bgi = a2?.bgi ?: ds?.bgi ?: cU?.bgi
|
val bgi = ds?.bgi ?: cU?.bgi
|
||||||
val AAPSv2 = a2?.AAPSv2 ?: ds?.AAPSv2 ?: cU?.AAPSv2
|
val AAPSv2 = ds?.AAPSv2 ?: cU?.AAPSv2
|
||||||
val cob1 = a2?.cob1 ?: ds?.cob1 ?: cU?.cob1
|
val cob1 = ds?.cob1 ?: cU?.cob1
|
||||||
val cob2 = a2?.cob2 ?: ds?.cob2 ?: cU?.cob2
|
val cob2 = ds?.cob2 ?: cU?.cob2
|
||||||
val time = aL?.time ?: a2?.time ?: aa?.time ?: bC?.time ?: bC?.time ?: nC?.time ?: cU?.time
|
val time = aL?.time ?: aa?.time ?: bC?.time ?: bC?.time ?: nC?.time ?: cU?.time
|
||||||
val second = cU?.second
|
val second = cU?.second
|
||||||
val minute = ds?.minute ?: cU?.minute
|
val minute = ds?.minute ?: cU?.minute
|
||||||
val hour = ds?.hour ?: cU?.hour
|
val hour = ds?.hour ?: cU?.hour
|
||||||
val day = a2?.day ?: ds?.day ?: cU?.day
|
val day = ds?.day ?: cU?.day
|
||||||
val month = a2?.month ?: ds?.month ?: cU?.month
|
val month = ds?.month ?: cU?.month
|
||||||
val iob1 = a2?.iob1 ?: ds?.iob1 ?: cU?.iob1
|
val iob1 = ds?.iob1 ?: cU?.iob1
|
||||||
val iob2 = a2?.iob2 ?: ds?.iob2 ?: cU?.iob2
|
val iob2 = ds?.iob2 ?: cU?.iob2
|
||||||
val chart = a2?.chart ?: aa?.chart ?: bC?.chart ?: bC?.chart ?: ds?.chart ?: cU?.chart
|
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 status = aL?.status ?: aa?.status ?: bC?.status ?: bC?.status ?: nC?.status
|
||||||
val timePeriod = ds?.timePeriod ?: aL?.timePeriod ?: nC?.timePeriod ?: bC?.timePeriod ?: cU?.timePeriod
|
val timePeriod = ds?.timePeriod ?: aL?.timePeriod ?: nC?.timePeriod ?: bC?.timePeriod ?: cU?.timePeriod
|
||||||
val dayName = ds?.dayName ?: cU?.dayName
|
val dayName = ds?.dayName ?: cU?.dayName
|
||||||
val mainMenuTap = ds?.mainMenuTap
|
val mainMenuTap = ds?.mainMenuTap
|
||||||
val chartZoomTap = ds?.chartZoomTap
|
val chartZoomTap = ds?.chartZoomTap
|
||||||
val dateTime = ds?.dateTime ?: a2?.dateTime
|
val dateTime = ds?.dateTime
|
||||||
val weekNumber = ds?.weekNumber ?: cU?.weekNumber
|
val weekNumber = ds?.weekNumber ?: cU?.weekNumber
|
||||||
// val minuteHand = cU?.minuteHand
|
// val minuteHand = cU?.minuteHand
|
||||||
// val secondaryLayout = aL?.secondaryLayout ?: a2?.secondaryLayout ?: aa?.secondaryLayout ?: ds?.secondaryLayout
|
// val secondaryLayout = aL?.secondaryLayout ?: aa?.secondaryLayout ?: ds?.secondaryLayout
|
||||||
// val tertiaryLayout = a2?.tertiaryLayout
|
|
||||||
// val hourHand = cU?.hourHand
|
// val hourHand = cU?.hourHand
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -81,12 +78,11 @@ class WatchfaceViewAdapter(
|
||||||
fun getBinding(bindLayout: ViewBinding): WatchfaceViewAdapter {
|
fun getBinding(bindLayout: ViewBinding): WatchfaceViewAdapter {
|
||||||
return when (bindLayout) {
|
return when (bindLayout) {
|
||||||
is ActivityHomeLargeBinding -> WatchfaceViewAdapter(bindLayout)
|
is ActivityHomeLargeBinding -> WatchfaceViewAdapter(bindLayout)
|
||||||
is ActivityHome2Binding -> WatchfaceViewAdapter(null, bindLayout)
|
is ActivityHomeBinding -> WatchfaceViewAdapter(null, bindLayout)
|
||||||
is ActivityHomeBinding -> WatchfaceViewAdapter(null, null, bindLayout)
|
is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, bindLayout)
|
||||||
is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, null, bindLayout)
|
is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, bindLayout)
|
||||||
is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout)
|
is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout)
|
||||||
is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout)
|
is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout)
|
||||||
is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, bindLayout)
|
|
||||||
else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter")
|
else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,285 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
tools:context=".watchfaces.AapsV2Watchface">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/primary_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/secondary_layout"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/loop"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@drawable/loop_grey_25"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="--'" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/sgv"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity=""
|
|
||||||
android:layout_marginBottom="-2dp"
|
|
||||||
android:paddingHorizontal="5dp"
|
|
||||||
android:textSize="38sp"
|
|
||||||
tools:text="---" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/direction"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textSize="22sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="--" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/timestamp"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="--'" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/secondary_layout"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?android:colorForeground"
|
|
||||||
android:paddingVertical="1dp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/tertiary_layout"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingHorizontal="5dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/delta"
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?android:textColorPrimaryInverse"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="+/-" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/avg_delta"
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?android:textColorPrimaryInverse"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="@string/abbreviation_average" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/uploader_battery"
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textColor="?android:textColorPrimaryInverse"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="--%" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/rig_battery"
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textColor="?android:textColorPrimaryInverse"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="visible"
|
|
||||||
tools:text="--%" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/basalRate"
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1.7"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?android:textColorPrimaryInverse"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="@string/no_tmp_basal_u_h" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/bgi"
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?android:textColorPrimaryInverse"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="visible"
|
|
||||||
tools:text="bgi" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/AAPSv2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/tertiary_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:weightSum="7"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/cob1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/activity_carb"
|
|
||||||
android:textSize="11sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/cob2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/no_cob_g"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
tools:ignore="NestedWeights" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/time"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="30sp"
|
|
||||||
tools:text="12:00" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/date_time"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/day"
|
|
||||||
android:layout_width="23dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="day" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/month"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="mth" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:textAlignment="center">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/iob1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="11sp"
|
|
||||||
tools:text="@string/activity_IOB" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/iob2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="@string/no_iob_u" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<lecho.lib.hellocharts.view.LineChartView
|
|
||||||
android:id="@+id/chart"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginTop="-5dp"
|
|
||||||
android:layout_marginBottom="7dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tertiary_layout" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
@ -7,7 +7,6 @@
|
||||||
<string name="label_watchface_big_chart">AAPS(BigChart)</string>
|
<string name="label_watchface_big_chart">AAPS(BigChart)</string>
|
||||||
<string name="label_watchface_no_chart">AAPS(NoChart)</string>
|
<string name="label_watchface_no_chart">AAPS(NoChart)</string>
|
||||||
<string name="label_watchface_circle">AAPS(Circle)</string>
|
<string name="label_watchface_circle">AAPS(Circle)</string>
|
||||||
<string name="label_watchface_v2">AAPS(v2)</string>
|
|
||||||
<string name="label_watchface_digital_style">AAPS(DigitalStyle)</string>
|
<string name="label_watchface_digital_style">AAPS(DigitalStyle)</string>
|
||||||
<string name="label_watchface_custom">AAPS(Custom)</string>
|
<string name="label_watchface_custom">AAPS(Custom)</string>
|
||||||
<string name="label_actions_tile">AAPS(Actions)</string>
|
<string name="label_actions_tile">AAPS(Actions)</string>
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="@string/key_dark"
|
|
||||||
android:title="@string/pref_dark"
|
|
||||||
app:wear_iconOff="@drawable/settings_off"
|
|
||||||
app:wear_iconOn="@drawable/settings_on" />
|
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="@string/key_match_divider"
|
|
||||||
android:summary="Status bar divider background matches watchface background"
|
|
||||||
android:title="@string/pref_matching_divider"
|
|
||||||
app:wear_iconOff="@drawable/settings_off"
|
|
||||||
app:wear_iconOn="@drawable/settings_on" />
|
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="@string/key_show_date"
|
|
||||||
android:title="@string/pref_show_date"
|
|
||||||
app:wear_iconOff="@drawable/settings_off"
|
|
||||||
app:wear_iconOn="@drawable/settings_on" />
|
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="@string/key_vibrate_hourly"
|
|
||||||
android:title="@string/pref_vibrate_hourly"
|
|
||||||
app:wear_iconOff="@drawable/settings_off"
|
|
||||||
app:wear_iconOn="@drawable/settings_on" />
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="off"
|
|
||||||
android:entries="@array/watchface_simplify_ui_name"
|
|
||||||
android:entryValues="@array/watchface_simplify_ui_values"
|
|
||||||
android:key="@string/key_simplify_ui"
|
|
||||||
android:summary="@string/pref_simplify_ui_sum"
|
|
||||||
android:title="@string/pref_simplify_ui" />
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
Loading…
Reference in a new issue