Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt +2 −9 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.graphics.Rect import android.icu.text.NumberFormat import android.util.TypedValue import android.view.LayoutInflater import android.view.View import android.widget.FrameLayout import androidx.annotation.VisibleForTesting import com.android.systemui.customization.R Loading Loading @@ -152,15 +151,9 @@ class DefaultClockController( view: AnimatableClockView, ) : DefaultClockFaceController(view) { override fun recomputePadding(targetRegion: Rect?) { // We center the view within the targetRegion instead of within the parent // view by computing the difference and adding that to the padding. val parent = view.parent val yDiff = if (targetRegion != null && parent is View && parent.isLaidOut()) targetRegion.centerY() - parent.height / 2f else 0f // Ignore Target Region until top padding fixed in aod val lp = view.getLayoutParams() as FrameLayout.LayoutParams lp.topMargin = (-0.5f * view.bottom + yDiff).toInt() lp.topMargin = (-0.5f * view.bottom).toInt() view.setLayoutParams(lp) } Loading packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ android:visibility="invisible" /> <FrameLayout android:id="@+id/lockscreen_clock_view_large" android:layout_marginTop="@dimen/keyguard_large_clock_top_margin" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false" Loading Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt +2 −9 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.graphics.Rect import android.icu.text.NumberFormat import android.util.TypedValue import android.view.LayoutInflater import android.view.View import android.widget.FrameLayout import androidx.annotation.VisibleForTesting import com.android.systemui.customization.R Loading Loading @@ -152,15 +151,9 @@ class DefaultClockController( view: AnimatableClockView, ) : DefaultClockFaceController(view) { override fun recomputePadding(targetRegion: Rect?) { // We center the view within the targetRegion instead of within the parent // view by computing the difference and adding that to the padding. val parent = view.parent val yDiff = if (targetRegion != null && parent is View && parent.isLaidOut()) targetRegion.centerY() - parent.height / 2f else 0f // Ignore Target Region until top padding fixed in aod val lp = view.getLayoutParams() as FrameLayout.LayoutParams lp.topMargin = (-0.5f * view.bottom + yDiff).toInt() lp.topMargin = (-0.5f * view.bottom).toInt() view.setLayoutParams(lp) } Loading
packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ android:visibility="invisible" /> <FrameLayout android:id="@+id/lockscreen_clock_view_large" android:layout_marginTop="@dimen/keyguard_large_clock_top_margin" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false" Loading