From 21cbd245661598fd77e5d67b3d763706d7a28e4b Mon Sep 17 00:00:00 2001 From: Darrell Shi Date: Mon, 28 Nov 2022 16:07:02 +0000 Subject: [PATCH] Add a y translation to clock complication. The clock complication comes with internal paddings that make the spacing with the complications below too large, even without any layout engine margin. Without a better solution, add a y translation to the clock so reduce the spacing, and also change its text size to dp unit so it doesn't respond to system text size change, which would mess up the translation. Test: https://screenshot.googleplex.com/BLfQEhA6i2t4qyu Test: https://screenshot.googleplex.com/BbuvDvfmahtNy5U Bug: 257553229 Change-Id: I7350981a28af590f6e70fb4fab004d5180cda502 --- .../dream_overlay_complication_clock_time.xml | 45 +++++++++++-------- packages/SystemUI/res/values/dimens.xml | 3 +- .../DreamClockTimeComplicationModule.java | 5 ++- 3 files changed, 31 insertions(+), 22 deletions(-) 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 2d67d95ab17e0..efcb6f3435b9d 100644 --- a/packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml +++ b/packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml @@ -14,25 +14,32 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + android:layout_height="wrap_content"> + + + + diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 89cc56d828363..4f2ff228e8e88 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1500,7 +1500,8 @@ 8dp - 86sp + 86dp + 28dp 28dp 24sp 36sp diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/dagger/DreamClockTimeComplicationModule.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/dagger/DreamClockTimeComplicationModule.java index 7d9f1059f3b83..5290e44aa7fb9 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/complication/dagger/DreamClockTimeComplicationModule.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/complication/dagger/DreamClockTimeComplicationModule.java @@ -45,11 +45,12 @@ public interface DreamClockTimeComplicationModule { @Provides @Named(DREAM_CLOCK_TIME_COMPLICATION_VIEW) static View provideComplicationView(LayoutInflater layoutInflater) { - final TextClock view = Preconditions.checkNotNull((TextClock) + final View view = Preconditions.checkNotNull( layoutInflater.inflate(R.layout.dream_overlay_complication_clock_time, null, false), "R.layout.dream_overlay_complication_clock_time did not properly inflated"); - view.setFontVariationSettings(TAG_WEIGHT + WEIGHT); + ((TextClock) view.findViewById(R.id.time_view)).setFontVariationSettings( + TAG_WEIGHT + WEIGHT); return view; } }