diff --git a/packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml b/packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml
index efcb6f3435b9d..8bff1a1353369 100644
--- a/packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml
+++ b/packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml
@@ -29,9 +29,10 @@
android:format12Hour="@string/dream_time_complication_12_hr_time_format"
android:format24Hour="@string/dream_time_complication_24_hr_time_format"
android:fontFeatureSettings="pnum, lnum"
+ android:includeFontPadding="false"
android:letterSpacing="0.02"
+ android:maxLines="1"
android:textSize="@dimen/dream_overlay_complication_clock_time_text_size"
- android:translationY="@dimen/dream_overlay_complication_clock_time_translation_y"
app:keyShadowBlur="@dimen/dream_overlay_clock_key_text_shadow_radius"
app:keyShadowOffsetX="@dimen/dream_overlay_clock_key_text_shadow_dx"
app:keyShadowOffsetY="@dimen/dream_overlay_clock_key_text_shadow_dy"
@@ -40,6 +41,7 @@
app:ambientShadowOffsetX="@dimen/dream_overlay_clock_ambient_text_shadow_dx"
app:ambientShadowOffsetY="@dimen/dream_overlay_clock_ambient_text_shadow_dy"
app:ambientShadowAlpha="0.3"
- />
+ app:removeTextDescent="true"
+ app:textDescentExtraPadding="@dimen/dream_overlay_clock_text_descent_extra_padding" />
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 91459825f5e0f..127d67ea1d6df 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1591,7 +1591,6 @@
32dp
14dp
86dp
- 28dp
24sp
36sp
28dp
@@ -1692,6 +1691,7 @@
0dp
0dp
1dp
+ 1dp
0.5dp
diff --git a/packages/SystemUI/shared/res/values/attrs.xml b/packages/SystemUI/shared/res/values/attrs.xml
index f3aeaef4cfe76..84ea6b7eecf4a 100644
--- a/packages/SystemUI/shared/res/values/attrs.xml
+++ b/packages/SystemUI/shared/res/values/attrs.xml
@@ -40,6 +40,9 @@
+
+
+
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/shadow/DoubleShadowTextClock.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/shadow/DoubleShadowTextClock.kt
index f2db129120e9a..5a6f1840bc95d 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/shadow/DoubleShadowTextClock.kt
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/shadow/DoubleShadowTextClock.kt
@@ -22,6 +22,7 @@ import android.widget.TextClock
import com.android.systemui.shared.R
import com.android.systemui.shared.shadow.DoubleShadowTextHelper.ShadowInfo
import com.android.systemui.shared.shadow.DoubleShadowTextHelper.applyShadows
+import kotlin.math.floor
/** Extension of [TextClock] which draws two shadows on the text (ambient and key shadows) */
class DoubleShadowTextClock
@@ -89,6 +90,21 @@ constructor(
ambientShadowOffsetY.toFloat(),
ambientShadowAlpha
)
+ val removeTextDescent =
+ attributes.getBoolean(R.styleable.DoubleShadowTextClock_removeTextDescent, false)
+ val textDescentExtraPadding =
+ attributes.getDimensionPixelSize(
+ R.styleable.DoubleShadowTextClock_textDescentExtraPadding,
+ 0
+ )
+ if (removeTextDescent) {
+ setPaddingRelative(
+ 0,
+ 0,
+ 0,
+ textDescentExtraPadding - floor(paint.fontMetrics.descent.toDouble()).toInt()
+ )
+ }
} finally {
attributes.recycle()
}