chore: wear wf ConstraintLayout and depended dimensions

This commit is contained in:
Andries Smit 2022-12-28 13:59:15 +01:00
parent ef7ebb8c6e
commit 0fa80b5ffe
22 changed files with 412 additions and 699 deletions

View file

@ -52,7 +52,7 @@ class AapsV2Watchface : BaseWatchFace() {
binding.rigBattery.setTextColor(dividerTxtColor)
binding.delta.setTextColor(dividerTxtColor)
binding.avgDelta.setTextColor(dividerTxtColor)
binding.basalRate?.setTextColor(dividerTxtColor)
binding.basalRate.setTextColor(dividerTxtColor)
binding.bgi.setTextColor(dividerTxtColor)
when (loopLevel) {
-1 -> binding.loop.setBackgroundResource(R.drawable.loop_grey_25)
@ -85,7 +85,7 @@ class AapsV2Watchface : BaseWatchFace() {
binding.avgDelta.setTextColor(dividerTxtColor)
binding.rigBattery.setTextColor(dividerTxtColor)
binding.uploaderBattery.setTextColor(dividerTxtColor)
binding.basalRate?.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))
@ -138,7 +138,7 @@ class AapsV2Watchface : BaseWatchFace() {
binding.rigBattery.setTextColor(dividerTxtColor)
binding.delta.setTextColor(dividerTxtColor)
binding.avgDelta.setTextColor(dividerTxtColor)
binding.basalRate?.setTextColor(dividerTxtColor)
binding.basalRate.setTextColor(dividerTxtColor)
binding.bgi.setTextColor(dividerTxtColor)
when (loopLevel) {
-1 -> binding.loop.setBackgroundResource(R.drawable.loop_grey_25)

View file

@ -19,6 +19,7 @@ class AapsWatchface : BaseWatchFace() {
}
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) {

View file

@ -9,7 +9,6 @@ import androidx.viewbinding.ViewBinding
import com.ustwo.clockwise.common.WatchMode
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityBigchartBinding
import info.nightscout.androidaps.databinding.ActivityBigchartSmallBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import info.nightscout.androidaps.watchfaces.utils.WatchfaceViewAdapter
@ -18,11 +17,6 @@ class BigChartWatchface : BaseWatchFace() {
private lateinit var binding: WatchfaceViewAdapter
override fun inflateLayout(inflater: LayoutInflater): ViewBinding {
if (resources.displayMetrics.widthPixels < SCREEN_SIZE_SMALL || resources.displayMetrics.heightPixels < SCREEN_SIZE_SMALL) {
val layoutBinding = ActivityBigchartSmallBinding.inflate(inflater)
binding = WatchfaceViewAdapter.getBinding(layoutBinding)
return layoutBinding
}
val layoutBinding = ActivityBigchartBinding.inflate(inflater)
binding = WatchfaceViewAdapter.getBinding(layoutBinding)
return layoutBinding
@ -42,6 +36,7 @@ class BigChartWatchface : BaseWatchFace() {
binding.delta?.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
binding.avgDelta?.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
binding.timestamp.setTextColor(ContextCompat.getColor(this, R.color.dark_Timestamp))
binding.timePeriod?.setTextColor(ContextCompat.getColor(this, R.color.dark_Timestamp))
highColor = ContextCompat.getColor(this, R.color.dark_midColor)
lowColor = ContextCompat.getColor(this, R.color.dark_midColor)
@ -69,6 +64,7 @@ class BigChartWatchface : BaseWatchFace() {
val colorTime = if (ageLevel == 1) R.color.dark_Timestamp else R.color.dark_TimestampOld
binding.timestamp.setTextColor(ContextCompat.getColor(this, colorTime))
binding.timePeriod?.setTextColor(ContextCompat.getColor(this, colorTime))
highColor = ContextCompat.getColor(this, R.color.dark_highColor)
lowColor = ContextCompat.getColor(this, R.color.dark_lowColor)
@ -97,6 +93,7 @@ class BigChartWatchface : BaseWatchFace() {
val colorTime = if (ageLevel == 1) R.color.light_mTimestamp1 else R.color.light_mTimestamp
binding.timestamp.setTextColor(ContextCompat.getColor(this, colorTime))
binding.timePeriod?.setTextColor(ContextCompat.getColor(this, colorTime))
highColor = ContextCompat.getColor(this, R.color.light_highColor)
lowColor = ContextCompat.getColor(this, R.color.light_lowColor)

View file

@ -67,18 +67,17 @@ class DigitalStyleWatchface : BaseWatchFace() {
/* frame styles*/
val mShapesElements = layoutView?.findViewById<LinearLayout>(R.id.shapes_elements)
if (mShapesElements != null) {
val displayFormatType = if (mShapesElements.contentDescription.toString().startsWith("round")) "round" else "rect"
val displayStyle = sp.getString(R.string.key_digital_style_frame_style, "full")
val displayFrameColor = sp.getString(R.string.key_digital_style_frame_color, "red")
val displayFrameColorSaturation = sp.getString(R.string.key_digital_style_frame_color_saturation, "500")
val displayFrameColorOpacity = sp.getString(R.string.key_digital_style_frame_color_opacity, "1")
// Load image with shapes
val styleDrawableName = "digitalstyle_bg_" + displayStyle + "_" + displayFormatType
val styleDrawableName = "digital_style_bg_" + displayStyle
try {
mShapesElements.background = ContextCompat.getDrawable(this, resources.getIdentifier(styleDrawableName, "drawable", this.packageName))
} catch (e: Exception) {
aapsLogger.error("digitalstyle_frameStyle", "RESOURCE NOT FOUND >> $styleDrawableName")
aapsLogger.error("digital_style_frameStyle", "RESOURCE NOT FOUND >> $styleDrawableName")
}
// set background-tint-color
@ -86,13 +85,13 @@ class DigitalStyleWatchface : BaseWatchFace() {
mShapesElements.backgroundTintList = null
} else {
val strColorName = if (displayFrameColor == "white" || displayFrameColor == "black") displayFrameColor else displayFrameColor + "_" + displayFrameColorSaturation
aapsLogger.debug(LTag.WEAR, "digitalstyle_strColorName", strColorName)
aapsLogger.debug(LTag.WEAR, "digital_style_strColorName", strColorName)
try {
val colorStateList = ContextCompat.getColorStateList(this, resources.getIdentifier(strColorName, "color", this.packageName))
mShapesElements.backgroundTintList = colorStateList
} catch (e: Exception) {
mShapesElements.backgroundTintList = null
aapsLogger.error("digitalstyle_colorName", "COLOR NOT FOUND >> $strColorName")
aapsLogger.error("digital_style_colorName", "COLOR NOT FOUND >> $strColorName")
}
}

View file

@ -6,9 +6,7 @@ import androidx.viewbinding.ViewBinding
import com.ustwo.clockwise.common.WatchMode
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityBigchartBinding
import info.nightscout.androidaps.databinding.ActivityBigchartSmallBinding
import info.nightscout.androidaps.databinding.ActivityNochartBinding
import info.nightscout.androidaps.databinding.ActivityNochartSmallBinding
import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace
import info.nightscout.androidaps.watchfaces.utils.WatchfaceViewAdapter
@ -17,11 +15,6 @@ class NoChartWatchface : BaseWatchFace() {
private lateinit var binding: WatchfaceViewAdapter
override fun inflateLayout(inflater: LayoutInflater): ViewBinding {
if (resources.displayMetrics.widthPixels < SCREEN_SIZE_SMALL || resources.displayMetrics.heightPixels < SCREEN_SIZE_SMALL) {
val layoutBinding = ActivityNochartSmallBinding.inflate(inflater)
binding = WatchfaceViewAdapter.getBinding(layoutBinding)
return layoutBinding
}
val layoutBinding = ActivityNochartBinding.inflate(inflater)
binding = WatchfaceViewAdapter.getBinding(layoutBinding)
return layoutBinding
@ -35,6 +28,7 @@ class NoChartWatchface : BaseWatchFace() {
binding.delta?.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
binding.avgDelta?.setTextColor(ContextCompat.getColor(this, R.color.dark_midColor))
binding.timestamp.setTextColor(ContextCompat.getColor(this, R.color.dark_Timestamp))
binding.timePeriod?.setTextColor(ContextCompat.getColor(this, R.color.dark_Timestamp))
}
override fun setColorDark() {
@ -52,6 +46,7 @@ class NoChartWatchface : BaseWatchFace() {
binding.avgDelta?.setTextColor(ContextCompat.getColor(this, color))
val colorTime = if (ageLevel == 1) R.color.dark_Timestamp else R.color.dark_TimestampOld
binding.timestamp.setTextColor(ContextCompat.getColor(this, colorTime))
binding.timePeriod?.setTextColor(ContextCompat.getColor(this, colorTime))
}
override fun setColorBright() {
@ -70,6 +65,7 @@ class NoChartWatchface : BaseWatchFace() {
binding.avgDelta?.setTextColor(ContextCompat.getColor(this, color))
val colorTime = if (ageLevel == 1) R.color.light_mTimestamp1 else R.color.light_mTimestamp
binding.timestamp.setTextColor(ContextCompat.getColor(this, colorTime))
binding.timePeriod?.setTextColor(ContextCompat.getColor(this, colorTime))
} else {
setColorDark()

View file

@ -423,7 +423,7 @@ abstract class BaseWatchFace : WatchFace() {
}
private fun setDateAndTime() {
binding.time?.text = dateUtil.timeString()
binding.time?.text = if(binding.timePeriod == null) dateUtil.timeString() else dateUtil.hourString() + ":" + dateUtil.minuteString()
binding.hour?.text = dateUtil.hourString()
binding.minute?.text = dateUtil.minuteString()
binding.dateTime?.visibility = sp.getBoolean(R.string.key_show_date, false).toVisibility()
@ -524,6 +524,5 @@ abstract class BaseWatchFace : WatchFace() {
var iFilter = IntentFilter(Intent.ACTION_BATTERY_CHANGED)
val NORMAL_TYPEFACE: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL)
val BOLD_TYPEFACE: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD)
const val SCREEN_SIZE_SMALL = 280
}
}

View file

@ -5,7 +5,6 @@ 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.ActivityBigchartSmallBinding
import info.nightscout.androidaps.databinding.ActivityCockpitBinding
import info.nightscout.androidaps.databinding.ActivityDigitalstyleBinding
import info.nightscout.androidaps.databinding.ActivityNochartBinding
@ -20,7 +19,6 @@ class WatchfaceViewAdapter(
a2: ActivityHome2Binding? = null,
aa: ActivityHomeBinding? = null,
bC: ActivityBigchartBinding? = null,
bCs: ActivityBigchartSmallBinding? = null,
cp: ActivityCockpitBinding? = null,
ds: ActivityDigitalstyleBinding? = null,
nC: ActivityNochartBinding? = null,
@ -28,7 +26,7 @@ class WatchfaceViewAdapter(
) {
init {
if (aL == null && a2 == null && aa == null && bC == null && bCs == null && cp == null && ds == null && nC == null && sP == null) {
if (aL == null && a2 == null && aa == null && bC == null && cp == null && ds == null && nC == null && sP == null) {
throw IllegalArgumentException("Require at least on Binding parameter")
}
}
@ -67,7 +65,7 @@ class WatchfaceViewAdapter(
val iob2 = a2?.iob2 ?: cp?.iob2 ?: ds?.iob2 ?: sP?.iob2
val chart = a2?.chart ?: aa?.chart ?: bC?.chart ?: bC?.chart ?: ds?.chart ?: sP?.chart
val status = aL?.status ?: aa?.status ?: bC?.status ?: bC?.status ?: nC?.status
val timePeriod = ds?.timePeriod
val timePeriod = ds?.timePeriod ?: aL?.timePeriod ?: nC?.timePeriod ?: bC?.timePeriod
val dayName = ds?.dayName
val mainMenuTap = ds?.mainMenuTap ?: sP?.mainMenuTap
val chartZoomTap = ds?.chartZoomTap ?: sP?.chartZoomTap
@ -89,11 +87,10 @@ class WatchfaceViewAdapter(
is ActivityHome2Binding -> WatchfaceViewAdapter(null, bindLayout)
is ActivityHomeBinding -> WatchfaceViewAdapter(null, null, bindLayout)
is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, null, bindLayout)
is ActivityBigchartSmallBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout)
is ActivityCockpitBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout)
is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, bindLayout)
is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, bindLayout)
is ActivitySteampunkBinding -> WatchfaceViewAdapter(null, null, null, null, null, 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)
else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter")
}
}

View file

@ -11,11 +11,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10sp"
android:layout_margin="10dp"
android:background="@drawable/circle"
android:backgroundTint="@color/white"
android:contentDescription="@string/action_confirm"
android:padding="25sp"
android:padding="25dp"
android:src="@drawable/ic_confirm"
app:tint="@color/white" />

View file

@ -1,60 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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:background="@color/black"
android:orientation="vertical"
android:textAlignment="center"
tools:context=".watchfaces.AapsWatchface"
tools:deviceIds="wear_square"
tools:ignore="MissingDefaultResource">
tools:context=".watchfaces.BigChartWatchface">
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-2dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp"
android:textAlignment="center">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/delta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginEnd="5dp"
android:gravity="center_horizontal|bottom"
android:text="---"
android:textColor="@color/white"
android:textSize="30sp"
tools:ignore="HardcodedText" />
android:gravity="bottom"
android:textSize="@dimen/watch_face_big_chart_delta_text_size"
tools:text="---" />
<TextView
android:id="@+id/sgv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="---"
android:textColor="@color/white"
android:textSize="41sp"
tools:ignore="HardcodedText" />
android:layout_marginHorizontal="4dp"
android:textSize="@dimen/watch_face_big_chart_svg_text_size"
tools:text="---" />
<TextView
android:id="@+id/avg_delta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginStart="5dp"
android:gravity="center_horizontal|bottom"
android:text="---"
android:textColor="@color/white"
android:textSize="30sp"
tools:ignore="HardcodedText" />
android:textSize="@dimen/watch_face_big_chart_delta_text_size"
tools:text="---" />
</LinearLayout>
@ -62,46 +48,63 @@
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_weight="1"
android:gravity="center_horizontal" />
app:layout_constraintBottom_toTopOf="@+id/status"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3" />
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="18sp"
android:layout_marginBottom="-5dp"
android:textSize="@dimen/watch_face_status_text_size"
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="E xU/h IOB: x (x+x)" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
android:paddingBottom="6dp"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginEnd="6dp"
android:textColor="@color/white"
android:textSize="35sp"
android:layout_marginEnd="5dp"
android:textSize="@dimen/watch_face_time_text_size"
tools:text="12:00" />
<TextView
android:id="@+id/timestamp"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="-- '"
android:textColor="@color/white"
android:textSize="26sp"
tools:ignore="HardcodedText" />
android:orientation="vertical">
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:textSize="@dimen/watch_face_timestamp_text_size"
tools:text="5'" />
<TextView
android:id="@+id/timePeriod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="-4dp"
android:textSize="@dimen/watch_face_time_period_text_size"
android:textStyle="bold"
tools:text="AM" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,113 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:orientation="vertical"
android:textAlignment="center"
tools:context=".watchfaces.AapsWatchface"
tools:deviceIds="wear_square"
tools:ignore="MissingDefaultResource">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-5dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp"
android:textAlignment="center">
<TextView
android:id="@+id/delta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal|center"
android:layout_marginEnd="5dp"
android:gravity="center_horizontal|bottom"
android:text="---"
android:textColor="@color/white"
android:textSize="24sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/sgv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="---"
android:textColor="@color/white"
android:textSize="34sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/avg_delta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal|center"
android:layout_marginStart="5dp"
android:gravity="center_horizontal|bottom"
android:text="---"
android:textColor="@color/white"
android:textSize="24sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-5sp"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="18sp"
tools:text="E xU/h IOB: x (x+x)" />
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_weight="1"
android:gravity="center_horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-5sp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:textAlignment="center">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginEnd="6dp"
android:paddingTop="-5sp"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="34sp"
tools:text="12:00" />
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal|center"
android:text="--'"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="24sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>

View file

@ -6,7 +6,8 @@
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical">
android:orientation="vertical"
tools:context=".watchfaces.CircleWatchface">
<TextView
android:id="@+id/agoString"

View file

@ -5,9 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/airplane_cockpit_outside_clouds"
tools:context=".watchfaces.CockpitWatchface"
tools:deviceIds="wear_round"
tools:ignore="MissingDefaultResource">
tools:context=".watchfaces.CockpitWatchface">
<LinearLayout
android:id="@+id/inside"

View file

@ -5,18 +5,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:deviceIds="wear_round"
tools:ignore="MissingDefaultResource">
tools:context=".watchfaces.DigitalStyleWatchface">
<!-- background-image with shapes elements-->
<LinearLayout
android:id="@+id/shapes_elements"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/digitalstyle_bg_full_round"
android:contentDescription="round-shape-elements"
android:orientation="horizontal"
tools:ignore="HardcodedText" />
android:background="@drawable/digital_style_bg_full"
android:orientation="horizontal" />
<!-- root-element-->
<LinearLayout
@ -66,6 +63,7 @@
android:id="@+id/cob1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="1dp"
android:layout_weight="2"
android:fontFamily="@font/roboto_slab_light"
android:gravity="bottom|center_horizontal"
@ -78,6 +76,7 @@
android:id="@+id/cob2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="-1dp"
android:layout_weight="3"
android:fontFamily="@font/roboto_slab_light"
android:gravity="top|center_horizontal"
@ -85,7 +84,7 @@
android:lines="1"
android:text="@string/cob_000g"
android:textColor="@color/white"
android:textSize="14sp" />
android:textSize="@dimen/watch_face_digital_sub_text_size" />
</LinearLayout>
@ -150,7 +149,7 @@
android:text="--"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="16sp"
android:textSize="@dimen/watch_face_digital_direction_text_size"
android:textStyle="bold"
tools:ignore="HardcodedText" />
@ -163,9 +162,10 @@
android:layout_marginBottom="2dp"
android:layout_weight="3"
android:fontFamily="sans-serif-condensed-light"
android:maxLines="1"
android:text="--'"
android:textColor="@color/light_grey"
android:textSize="10sp"
android:textSize="@dimen/watch_face_digital_timestamp_text_size"
tools:ignore="HardcodedText,SmallSp" />
<View
@ -196,7 +196,7 @@
android:lines="1"
android:text="@string/svg_00_0"
android:textColor="@color/white"
android:textSize="20sp"
android:textSize="@dimen/watch_face_digital_svg_text_size"
android:textStyle="bold" />
</LinearLayout>
@ -240,6 +240,7 @@
android:id="@+id/iob1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="1dp"
android:layout_weight="2"
android:fontFamily="@font/roboto_slab_light"
android:gravity="bottom|center_horizontal"
@ -252,14 +253,16 @@
android:id="@+id/iob2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="-1dp"
android:layout_weight="3"
android:fontFamily="@font/roboto_slab_light"
android:gravity="top|center_horizontal"
android:letterSpacing="-0.075"
android:lines="1"
android:text="@string/iob_0_00u"
android:textColor="@color/white"
android:textSize="14sp" />
android:textSize="@dimen/watch_face_digital_sub_text_size" />
</LinearLayout>
@ -342,7 +345,6 @@
android:textColor="@color/light_grey"
android:textFontWeight="400"
android:textSize="18sp"
android:visibility="gone"
tools:text="ww" />
<View
@ -439,8 +441,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="6sp"
android:layout_marginBottom="-8sp"
android:layout_marginStart="6dp"
android:layout_marginTop="-2dp"
android:layout_marginBottom="-8dp"
android:fontFamily="@font/roboto_condensed_bold"
android:textColor="@color/light_grey"
android:textSize="26sp"
@ -452,7 +455,7 @@
android:id="@+id/timePeriod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8sp"
android:layout_marginStart="8dp"
android:fontFamily="@font/roboto_condensed_bold"
android:gravity="top"
android:textColor="@color/light_grey"

View file

@ -1,78 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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:background="@color/black"
android:orientation="vertical"
android:textAlignment="center"
android:weightSum="1"
tools:context=".watchfaces.AapsWatchface"
tools:deviceIds="wear_round"
tools:ignore="MissingDefaultResource">
tools:context=".watchfaces.AapsWatchface">
<LinearLayout
android:layout_width="fill_parent"
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-5dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="15dp"
android:textAlignment="center"
android:weightSum="1">
app:layout_constraintBottom_toTopOf="@+id/secondary_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/sgv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="-2dp"
android:gravity="bottom|end"
android:paddingStart="0dp"
android:paddingTop="-2dp"
android:paddingEnd="5dp"
android:text="---"
android:textColor="@color/white"
android:layout_marginEnd="5dp"
android:gravity="bottom"
android:textSize="41sp"
tools:ignore="HardcodedText" />
tools:text="---" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:baselineAligned="false"
android:orientation="vertical"
android:textAlignment="center"
android:weightSum="1">
android:orientation="vertical">
<TextView
android:id="@+id/direction"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginTop="-2dp"
android:layout_marginBottom="-5dp"
android:gravity="center_horizontal|bottom"
android:text="--"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="30sp"
android:layout_gravity="center_horizontal"
android:textSize="25sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
tools:text="--" />
<TextView
android:id="@+id/delta"
android:layout_width="fill_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:gravity="center_horizontal|bottom"
android:text="@string/delta_na"
android:textColor="@color/white"
android:textSize="10sp"
android:layout_gravity="center_horizontal"
android:textSize="11sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
tools:text="1" />
</LinearLayout>
@ -80,65 +53,59 @@
<LinearLayout
android:id="@+id/secondary_layout"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/light_grey"
android:orientation="vertical"
android:padding="1dp">
android:layout_gravity="center_horizontal"
android:background="?android:colorForeground"
android:gravity="center_horizontal"
android:paddingVertical="1dp"
app:layout_constraintBottom_toTopOf="@+id/time">
<LinearLayout
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
android:textAlignment="center"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="11sp"
android:textStyle="bold"
tools:text="@string/time_stamp_na_min_ago" />
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/time_stamp_na_min_ago"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="8sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/uploader_battery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:textAlignment="center"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="11sp"
android:textStyle="bold"
tools:text="@string/uploader_na" />
<TextView
android:id="@+id/uploader_battery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:text="@string/uploader_na"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="8sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/raw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:textAlignment="center"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="11sp"
android:textStyle="bold"
tools:text="" />
<TextView
android:id="@+id/raw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:text=""
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="8sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:text="@string/no_status"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="8sp"
tools:ignore="SmallSp" />
</LinearLayout>
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:textAlignment="center"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="11sp"
android:textStyle="bold"
tools:text="@string/no_status" />
</LinearLayout>
@ -146,19 +113,23 @@
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-2dp"
android:layout_marginBottom="-3dp"
android:layout_gravity="center_horizontal|top"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="30sp"
android:textSize="35sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="12:00" />
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="77dp"
android:layout_gravity="bottom"
android:gravity="center_horizontal|top" />
android:layout_height="0dp"
android:layout_marginTop="-5dp"
android:paddingBottom="7dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/time" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,96 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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:background="@color/black"
android:orientation="vertical"
android:textAlignment="center"
android:weightSum="1.1"
tools:context=".watchfaces.AapsV2Watchface"
tools:deviceIds="wear_round"
tools:ignore="MissingDefaultResource">
<View
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_weight="0.05"
android:orientation="vertical" />
tools:context=".watchfaces.AapsV2Watchface">
<LinearLayout
android:id="@+id/primary_layout"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_gravity="center_horizontal"
android:layout_weight="0.27"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:textAlignment="center">
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|center"
android:layout_gravity="bottom"
android:background="@drawable/loop_grey_25"
android:gravity="center"
android:text="--'"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
tools:text="--'" />
<TextView
android:id="@+id/sgv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_gravity=""
android:layout_marginBottom="-2dp"
android:gravity="bottom|end"
android:paddingStart="5dp"
android:paddingTop="-2dp"
android:paddingEnd="5dp"
android:text="---"
android:textColor="@color/white"
android:paddingHorizontal="5dp"
android:textSize="38sp"
tools:ignore="HardcodedText" />
tools:text="---" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingStart="0dp"
android:paddingEnd="4dp">
android:orientation="vertical">
<TextView
android:id="@+id/direction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:gravity="center_horizontal|bottom"
android:text="--"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="22sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
tools:text="--" />
<TextView
android:id="@+id/timestamp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:gravity="center"
android:text="--'"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
tools:text="--'" />
</LinearLayout>
@ -99,50 +67,39 @@
<LinearLayout
android:id="@+id/secondary_layout"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.10"
android:background="@color/light_grey"
android:gravity="center"
android:orientation="vertical"
android:padding="1dp">
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:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textAlignment="center">
android:paddingHorizontal="5dp">
<TextView
android:id="@+id/delta"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="+/-"
android:textAlignment="center"
android:textColor="@color/black"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="13sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
tools:text="+/-" />
<TextView
android:id="@+id/avg_delta"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="@string/abbreviation_average"
android:textAlignment="center"
android:textColor="@color/black"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="13sp"
android:textStyle="bold" />
android:textStyle="bold"
tools:text="@string/abbreviation_average" />
<TextView
android:id="@+id/uploader_battery"
@ -151,12 +108,11 @@
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="--%"
android:textAlignment="center"
android:textColor="@color/black"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="13sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
tools:text="--%" />
<TextView
android:id="@+id/rig_battery"
@ -165,39 +121,34 @@
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="--%"
android:textAlignment="center"
android:textColor="@color/black"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="13sp"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="HardcodedText" />
android:visibility="visible"
tools:text="--%" />
<TextView
android:id="@+id/basalRate"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1.7"
android:gravity="center"
android:text="@string/no_tmp_basal_u_h"
android:textAlignment="center"
android:textColor="@color/black"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="13sp"
android:textStyle="bold" />
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_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/black"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="13sp"
android:textStyle="bold"
android:visibility="gone"
android:visibility="visible"
tools:text="bgi" />
<View
@ -213,46 +164,30 @@
<LinearLayout
android:id="@+id/tertiary_layout"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_gravity="center"
android:layout_weight="0.22"
android:background="@color/black"
android:baselineAligned="false"
android:gravity="center"
android:orientation="horizontal"
android:padding="1dp"
android:weightSum="7">
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:layout_gravity="center"
android:baselineAligned="false"
android:gravity="center"
android:orientation="vertical"
android:textAlignment="center">
android:orientation="vertical">
<TextView
android:id="@+id/cob1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/activity_carb"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
android:textSize="11sp" />
<TextView
android:id="@+id/cob2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/no_cob_g"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
@ -268,10 +203,7 @@
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="30sp"
tools:text="12:00" />
@ -279,10 +211,8 @@
android:id="@+id/date_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:textAlignment="center"
android:visibility="gone">
<TextView
@ -292,7 +222,6 @@
android:layout_gravity="center"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="12sp"
tools:text="day" />
@ -302,7 +231,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/white"
android:textSize="12sp"
tools:text="mth" />
@ -327,12 +255,9 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/activity_IOB"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
android:textSize="11sp"
tools:text="@string/activity_IOB" />
<TextView
android:id="@+id/iob2"
@ -340,28 +265,21 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/no_iob_u"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
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="0px"
android:layout_gravity="bottom"
android:layout_weight="0.41"
android:gravity="center_horizontal|top" />
android:layout_height="0dp"
android:layout_marginTop="-5dp"
android:layout_marginBottom="7dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tertiary_layout" />
<View
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_weight="0.05"
android:orientation="vertical" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,24 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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:background="@color/black"
android:orientation="vertical"
android:textAlignment="center"
tools:context=".watchfaces.AapsWatchface"
tools:deviceIds="wear_round"
tools:ignore="MissingDefaultResource">
tools:context=".watchfaces.AapsLargeWatchface">
<LinearLayout
android:layout_width="147dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal"
android:paddingTop="30dp"
android:textAlignment="center">
app:layout_constraintBottom_toTopOf="@+id/secondary_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/sgv"
@ -26,45 +20,29 @@
android:layout_height="wrap_content"
android:paddingStart="0dp"
android:paddingEnd="10dp"
android:paddingBottom="3dp"
android:text="8.8"
android:textColor="@color/white"
android:textSize="50sp"
tools:ignore="HardcodedText" />
tools:text="18.8" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:baselineAligned="false"
android:orientation="vertical"
android:textAlignment="center"
android:weightSum="1">
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/direction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:gravity="center_horizontal|bottom"
android:paddingTop="1dp"
android:text="--"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="27sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
tools:text="--" />
<TextView
android:id="@+id/delta"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:gravity="center_horizontal"
android:text="@string/delta_na"
android:textColor="@color/white"
android:textSize="10sp"
tools:ignore="SmallSp" />
android:textSize="11sp"
tools:text="@string/delta_na" />
</LinearLayout>
@ -72,23 +50,23 @@
<LinearLayout
android:id="@+id/secondary_layout"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@color/light_grey"
android:background="?android:colorForeground"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:padding="2dp">
android:padding="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="--'"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="HardcodedText" />
android:textColor="?android:textColorPrimaryInverse"
android:textSize="@dimen/watch_face_large_status_size"
tools:text="--'" />
<TextView
android:id="@+id/uploader_battery"
@ -96,10 +74,9 @@
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:text="@string/uploader_na"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="14sp" />
android:textColor="?android:textColorPrimaryInverse"
android:textSize="@dimen/watch_face_large_status_size"
tools:text="@string/uploader_na" />
<TextView
android:id="@+id/raw"
@ -107,10 +84,9 @@
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:text=""
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="14sp" />
android:textColor="?android:textColorPrimaryInverse"
android:textSize="@dimen/watch_face_large_status_size"
tools:text="" />
<TextView
android:id="@+id/status"
@ -118,21 +94,36 @@
android:layout_height="wrap_content"
android:paddingStart="10sp"
android:paddingEnd="0sp"
android:text="@string/no_status"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="14sp" />
android:textColor="?android:textColorPrimaryInverse"
android:textSize="14sp"
tools:text="@string/no_status" />
</LinearLayout>
<TextView
android:id="@+id/time"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="55sp"
tools:text="12:00" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/secondary_layout">
</LinearLayout>
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/watch_face_large_time_text_size"
tools:text="01:00" />
<TextView
android:id="@+id/timePeriod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="15sp"
android:layout_gravity="start"
android:textSize="@dimen/watch_face_large_time_period_text_size"
android:textStyle="bold"
tools:text="AM" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,60 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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:background="@color/black"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical"
android:textAlignment="center"
tools:context=".watchfaces.NoChartWatchface"
tools:deviceIds="wear_square"
tools:ignore="MissingDefaultResource">
tools:context=".watchfaces.NoChartWatchface">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-15dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:textAlignment="center">
android:paddingBottom="5dp"
app:layout_constraintBottom_toTopOf="@+id/status"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/delta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginEnd="5dp"
android:gravity="center_horizontal|bottom"
android:text="---"
android:textColor="@color/white"
android:textSize="40sp"
tools:ignore="HardcodedText" />
android:maxLines="1"
android:textSize="@dimen/watch_face_delta_text_size"
tools:text="+0.0" />
<TextView
android:id="@+id/sgv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="---"
android:textColor="@color/white"
android:textSize="55sp"
tools:ignore="HardcodedText" />
android:maxLines="1"
android:paddingHorizontal="3dp"
android:textSize="@dimen/watch_face_svg_text_size"
tools:text="10.1" />
<TextView
android:id="@+id/avg_delta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginStart="5dp"
android:gravity="center_horizontal|bottom"
android:text="---"
android:textColor="@color/white"
android:textSize="40sp"
tools:ignore="HardcodedText" />
android:maxLines="1"
android:textSize="@dimen/watch_face_delta_text_size"
tools:text="+0.0" />
</LinearLayout>
@ -62,40 +48,55 @@
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="24sp"
android:maxLines="1"
android:textSize="@dimen/watch_face_no_chart_status_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="E xU/h IOB: x (x+x)" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal|bottom"
android:orientation="horizontal"
android:textAlignment="center">
android:paddingTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/status">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginEnd="6dp"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="47sp"
android:textSize="@dimen/watch_face_time_text_size"
tools:text="12:00" />
<TextView
android:id="@+id/timestamp"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="-- '"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="35sp"
tools:ignore="HardcodedText" />
android:orientation="vertical">
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:maxLines="1"
android:textSize="@dimen/watch_face_timestamp_text_size"
tools:text="5'" />
<TextView
android:id="@+id/timePeriod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-4dp"
android:textSize="11sp"
android:textStyle="bold"
tools:text="AM" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,114 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical"
tools:context=".watchfaces.AapsWatchface"
tools:deviceIds="wear_square"
tools:ignore="MissingDefaultResource">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-15dp"
android:layout_marginBottom="5dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp"
android:textAlignment="center">
<TextView
android:id="@+id/delta"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:layout_marginEnd="5dp"
android:layout_marginBottom="-15dp"
android:gravity="center_vertical|center_horizontal|center"
android:text="---"
android:textColor="@color/white"
android:textSize="22sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/sgv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="---"
android:textColor="@color/white"
android:textSize="42sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/avg_delta"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginStart="5dp"
android:layout_marginBottom="-15dp"
android:gravity="center_vertical|center_horizontal|center"
android:text=" ---"
android:textColor="@color/white"
android:textSize="22sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<View
android:id="@+id/dummy1"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_gravity="bottom"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingBottom="2dp"
android:text="@string/no_loop_status"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="21sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal|bottom"
android:orientation="horizontal"
android:textAlignment="center">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginEnd="6dp"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="43sp"
tools:text="23:24" />
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:text="--'"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="24sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>

View file

@ -4,9 +4,7 @@
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".watchfaces.SteampunkWatchface"
tools:deviceIds="wear_round"
tools:ignore="MissingDefaultResource">
tools:context=".watchfaces.SteampunkWatchface">
<LinearLayout
android:layout_width="match_parent"
@ -173,14 +171,14 @@
<View
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_weight="0.2"
tools:ignore="NestedWeights" />
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="0.5" />
android:layout_weight="0.55" />
<View
android:layout_width="0px"

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Watch face sizes for bigger larger screen sizes -->
<dimen name="watch_face_svg_text_size">50sp</dimen>
<dimen name="watch_face_delta_text_size">25sp</dimen>
<dimen name="watch_face_time_text_size">45sp</dimen>
<dimen name="watch_face_timestamp_text_size">25sp</dimen>
<dimen name="watch_face_time_period_text_size">12sp</dimen>
<dimen name="watch_face_status_text_size">18sp</dimen>
<!-- Watch face specific-->
<dimen name="watch_face_no_chart_status_size">24sp</dimen>
<dimen name="watch_face_big_chart_svg_text_size">35sp</dimen>
<dimen name="watch_face_big_chart_delta_text_size">29sp</dimen>
<dimen name="watch_face_digital_svg_text_size">23sp</dimen>
<dimen name="watch_face_digital_direction_text_size">17sp</dimen>
<dimen name="watch_face_digital_timestamp_text_size">14sp</dimen>
<dimen name="watch_face_digital_sub_text_size">15sp</dimen>
<dimen name="watch_face_large_svg_text_size">55sp</dimen>
<dimen name="watch_face_large_direction_text_size">29sp</dimen>
<dimen name="watch_face_large_delta_text_size">13sp</dimen>
<dimen name="watch_face_large_time_text_size">55sp</dimen>
<dimen name="watch_face_large_time_period_text_size">13sp</dimen>
</resources>

View file

@ -1,8 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Watch Resources list of common watches with DP
Screen density = Screen width (or height) in pixels / Screen width (or height) in inches
dp = (width in pixels * 160) / screen density
Galaxy Watch 4 40mm: 1.2", 396 x 396 px = 192 dp
Galaxy Watch 4 44mm: 1.4", 450 x 450 px = 224 dp
Galaxy Watch 4 Classic 42mm: 1.19", 396 x 396 px = 190 dp
Galaxy Watch 4 Classic 46mm: 1.4", 450 x 450 px = 224 dp
Samsung Galaxy Watch 5 40mm: 1.2", 396 x 396 px = 192 dp
Samsung Galaxy Watch 5 44mm: 1.4", 450 x 450 px = 224 dp
TicWatch Pro 3: 1.39", 454 x 454 px = 222.4 dp
Fossil Gen 5: 1.28", 416 x 416 px = 204.8
Google Pixel Watch: 1.2", 450 x 450 px = 192 dp
-->
<resources>
<dimen name="simple_ui_svg_text_size">50sp</dimen>
<dimen name="simple_ui_direction_text_size">35sp</dimen>
<dimen name="simple_ui_time_text_size">35sp</dimen>
<dimen name="simple_ui_y_offset">5dp</dimen>
<!-- Watch face sizes for small screen sizes -->
<dimen name="watch_face_svg_text_size">40sp</dimen>
<dimen name="watch_face_delta_text_size">20sp</dimen>
<dimen name="watch_face_time_text_size">35sp</dimen>
<dimen name="watch_face_timestamp_text_size">17sp</dimen>
<dimen name="watch_face_time_period_text_size">11sp</dimen>
<dimen name="watch_face_status_text_size">16sp</dimen>
<!-- Watch face specific-->
<dimen name="watch_face_no_chart_status_size">20sp</dimen>
<dimen name="watch_face_big_chart_svg_text_size">30sp</dimen>
<dimen name="watch_face_big_chart_delta_text_size">25sp</dimen>
<dimen name="watch_face_digital_svg_text_size">20sp</dimen>
<dimen name="watch_face_digital_direction_text_size">16sp</dimen>
<dimen name="watch_face_digital_timestamp_text_size">10sp</dimen>
<dimen name="watch_face_digital_sub_text_size">14sp</dimen>
<dimen name="watch_face_large_svg_text_size">50sp</dimen>
<dimen name="watch_face_large_direction_text_size">27sp</dimen>
<dimen name="watch_face_large_delta_text_size">11sp</dimen>
<dimen name="watch_face_large_time_text_size">50sp</dimen>
<dimen name="watch_face_large_time_period_text_size">11sp</dimen>
<dimen name="watch_face_large_status_size">14sp</dimen>
</resources>

View file

@ -216,9 +216,9 @@
<string name="no_iob_u">--U</string>
<string name="no_cob_g">--g</string>
<string name="no_tmp_basal_u_h">-.--U/h</string>
<string name="uploader_na">Uploader: ---%</string>
<string name="no_status">S: no status</string>
<string name="time_stamp_na_min_ago">-- Minutes ago</string>
<string name="uploader_na">U: --%</string>
<string name="no_status">S: --</string>
<string name="time_stamp_na_min_ago">-- Min. ago</string>
<string name="delta_na">--- mg/dl</string>
<string name="no_loop_status">No Loop Status</string>
<string name="cob_000g">000g</string>