Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockFaceLayout.kt +29 −20 Original line number Diff line number Diff line Loading @@ -111,11 +111,19 @@ class DefaultClockFaceLayout(val view: View) : ClockFaceLayout { connect(lockscreenClockViewLargeId, START, PARENT_ID, START) connect(lockscreenClockViewLargeId, END, PARENT_ID, END) // In preview, we'll show UDFPS icon for UDFPS devices // and nothing for non-UDFPS devices, // and we're not planning to add this vide in clockHostView // so we only need position of device entry icon to constrain clock // Copied calculation codes from applyConstraints in DefaultDeviceEntrySection clockPreviewConfig.udfpsTop?.let { val screenHeight = context.resources.displayMetrics.heightPixels connect( lockscreenClockViewLargeId, BOTTOM, PARENT_ID, BOTTOM, (screenHeight - it).toInt(), ) } ?: run { // Copied calculation codes from applyConstraints in // DefaultDeviceEntrySection clockPreviewConfig.lockId?.let { lockId -> connect(lockscreenClockViewLargeId, BOTTOM, lockId, TOP) } Loading @@ -134,6 +142,7 @@ class DefaultClockFaceLayout(val view: View) : ClockFaceLayout { clockBottomMargin, ) } } val smallClockViewId = context.getId("lockscreen_clock_view") constrainWidth(smallClockViewId, WRAP_CONTENT) Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockPreviewConfig.kt +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ data class ClockPreviewConfig( val isShadeLayoutWide: Boolean, val isSceneContainerFlagEnabled: Boolean = false, val lockId: Int? = null, val udfpsTop: Float? = null, ) { fun getSmallClockTopPadding( statusBarHeight: Int = SystemBarUtils.getStatusBarHeight(context) Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockFaceLayout.kt +29 −20 Original line number Diff line number Diff line Loading @@ -111,11 +111,19 @@ class DefaultClockFaceLayout(val view: View) : ClockFaceLayout { connect(lockscreenClockViewLargeId, START, PARENT_ID, START) connect(lockscreenClockViewLargeId, END, PARENT_ID, END) // In preview, we'll show UDFPS icon for UDFPS devices // and nothing for non-UDFPS devices, // and we're not planning to add this vide in clockHostView // so we only need position of device entry icon to constrain clock // Copied calculation codes from applyConstraints in DefaultDeviceEntrySection clockPreviewConfig.udfpsTop?.let { val screenHeight = context.resources.displayMetrics.heightPixels connect( lockscreenClockViewLargeId, BOTTOM, PARENT_ID, BOTTOM, (screenHeight - it).toInt(), ) } ?: run { // Copied calculation codes from applyConstraints in // DefaultDeviceEntrySection clockPreviewConfig.lockId?.let { lockId -> connect(lockscreenClockViewLargeId, BOTTOM, lockId, TOP) } Loading @@ -134,6 +142,7 @@ class DefaultClockFaceLayout(val view: View) : ClockFaceLayout { clockBottomMargin, ) } } val smallClockViewId = context.getId("lockscreen_clock_view") constrainWidth(smallClockViewId, WRAP_CONTENT) Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockPreviewConfig.kt +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ data class ClockPreviewConfig( val isShadeLayoutWide: Boolean, val isSceneContainerFlagEnabled: Boolean = false, val lockId: Int? = null, val udfpsTop: Float? = null, ) { fun getSmallClockTopPadding( statusBarHeight: Int = SystemBarUtils.getStatusBarHeight(context) Loading