Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt +9 −6 Original line number Diff line number Diff line Loading @@ -121,7 +121,10 @@ object KeyguardPreviewClockViewBinder { private fun applyClockDefaultConstraints(context: Context, constraints: ConstraintSet) { constraints.apply { constrainWidth(R.id.lockscreen_clock_view_large, ConstraintSet.WRAP_CONTENT) constrainHeight(R.id.lockscreen_clock_view_large, ConstraintSet.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) val largeClockTopMargin = SystemBarUtils.getStatusBarHeight(context) + context.resources.getDimensionPixelSize( Loading @@ -138,7 +141,7 @@ object KeyguardPreviewClockViewBinder { R.id.lockscreen_clock_view_large, ConstraintSet.END, PARENT_ID, ConstraintSet.END ConstraintSet.END, ) // In preview, we'll show UDFPS icon for UDFPS devices Loading @@ -160,14 +163,14 @@ object KeyguardPreviewClockViewBinder { BOTTOM, PARENT_ID, BOTTOM, clockBottomMargin clockBottomMargin, ) } constrainWidth(R.id.lockscreen_clock_view, WRAP_CONTENT) constrainHeight( R.id.lockscreen_clock_view, context.resources.getDimensionPixelSize(customizationR.dimen.small_clock_height) context.resources.getDimensionPixelSize(customizationR.dimen.small_clock_height), ) connect( R.id.lockscreen_clock_view, Loading @@ -175,7 +178,7 @@ object KeyguardPreviewClockViewBinder { PARENT_ID, START, context.resources.getDimensionPixelSize(customizationR.dimen.clock_padding_start) + context.resources.getDimensionPixelSize(R.dimen.status_view_margin_horizontal) context.resources.getDimensionPixelSize(R.dimen.status_view_margin_horizontal), ) val smallClockTopMargin = context.resources.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) + Loading @@ -188,7 +191,7 @@ object KeyguardPreviewClockViewBinder { context: Context, rootView: ConstraintLayout, previewClock: ClockController, viewModel: KeyguardPreviewClockViewModel viewModel: KeyguardPreviewClockViewModel, ) { val cs = ConstraintSet().apply { clone(rootView) } applyClockDefaultConstraints(context, cs) Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt +9 −6 Original line number Diff line number Diff line Loading @@ -121,7 +121,10 @@ object KeyguardPreviewClockViewBinder { private fun applyClockDefaultConstraints(context: Context, constraints: ConstraintSet) { constraints.apply { constrainWidth(R.id.lockscreen_clock_view_large, ConstraintSet.WRAP_CONTENT) constrainHeight(R.id.lockscreen_clock_view_large, ConstraintSet.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) val largeClockTopMargin = SystemBarUtils.getStatusBarHeight(context) + context.resources.getDimensionPixelSize( Loading @@ -138,7 +141,7 @@ object KeyguardPreviewClockViewBinder { R.id.lockscreen_clock_view_large, ConstraintSet.END, PARENT_ID, ConstraintSet.END ConstraintSet.END, ) // In preview, we'll show UDFPS icon for UDFPS devices Loading @@ -160,14 +163,14 @@ object KeyguardPreviewClockViewBinder { BOTTOM, PARENT_ID, BOTTOM, clockBottomMargin clockBottomMargin, ) } constrainWidth(R.id.lockscreen_clock_view, WRAP_CONTENT) constrainHeight( R.id.lockscreen_clock_view, context.resources.getDimensionPixelSize(customizationR.dimen.small_clock_height) context.resources.getDimensionPixelSize(customizationR.dimen.small_clock_height), ) connect( R.id.lockscreen_clock_view, Loading @@ -175,7 +178,7 @@ object KeyguardPreviewClockViewBinder { PARENT_ID, START, context.resources.getDimensionPixelSize(customizationR.dimen.clock_padding_start) + context.resources.getDimensionPixelSize(R.dimen.status_view_margin_horizontal) context.resources.getDimensionPixelSize(R.dimen.status_view_margin_horizontal), ) val smallClockTopMargin = context.resources.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) + Loading @@ -188,7 +191,7 @@ object KeyguardPreviewClockViewBinder { context: Context, rootView: ConstraintLayout, previewClock: ClockController, viewModel: KeyguardPreviewClockViewModel viewModel: KeyguardPreviewClockViewModel, ) { val cs = ConstraintSet().apply { clone(rootView) } applyClockDefaultConstraints(context, cs) Loading