From c99947d7bb77228ecc25b5b9cca63ae0734c81fe Mon Sep 17 00:00:00 2001 From: Sherry Zhou Date: Mon, 15 Jul 2024 23:31:56 +0000 Subject: Fix default large clock too high in portrait mode Bug: 353332374 Flag: com.android.systemui.migrate_clocks_to_blueprint Test: manually test large clock in Tangor, observe clock is in the center in portrait mode; double check large clocks in the largest display in Felix to make sure it's not clipped or overlapping with smartspace Change-Id: Iccc71d402d894c18a5abcad0a3080bb3f31a371f --- .../systemui/keyguard/ui/view/layout/sections/ClockSection.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt index 91e48b56b4f5..c8fe55d2a7c4 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt @@ -25,7 +25,6 @@ import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet.BOTTOM import androidx.constraintlayout.widget.ConstraintSet.END import androidx.constraintlayout.widget.ConstraintSet.GONE -import androidx.constraintlayout.widget.ConstraintSet.MATCH_CONSTRAINT import androidx.constraintlayout.widget.ConstraintSet.PARENT_ID import androidx.constraintlayout.widget.ConstraintSet.START import androidx.constraintlayout.widget.ConstraintSet.TOP @@ -184,7 +183,11 @@ constructor( getDimen(ENHANCED_SMARTSPACE_HEIGHT) connect(R.id.lockscreen_clock_view_large, TOP, PARENT_ID, TOP, largeClockTopMargin) constrainWidth(R.id.lockscreen_clock_view_large, WRAP_CONTENT) - constrainHeight(R.id.lockscreen_clock_view_large, MATCH_CONSTRAINT) + + // The following two lines make lockscreen_clock_view_large is constrained to available + // height when it goes beyond constraints; otherwise, it use WRAP_CONTENT + constrainHeight(R.id.lockscreen_clock_view_large, WRAP_CONTENT) + constrainMaxHeight(R.id.lockscreen_clock_view_large, 0) constrainWidth(R.id.lockscreen_clock_view, WRAP_CONTENT) constrainHeight( R.id.lockscreen_clock_view, -- cgit v1.2.3-59-g8ed1b