Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7db86120 authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Skip translating the x coordinate of the large clock

It turns out this wasn't a pivot problem like we thought. Instead the
large clock shouldn't be translated in the x direction. Comparing to the
version in KeyguardStatusViewController & KeyguardClockSwitchController
shows that only the small clock is translated in that direction.
Everything is still translated in the y direction, as that translation
was applied at the parent level directly to KeyguardStatusView.

Bug: 322199646
Test: Manually verified translation matched unflagged translation
Flag: ACONFIG com.android.systemui.migrate_clocks_to_blueprint STAGING
Change-Id: I27a6afb38538e128c600bcbd0c324fbad3b3e84c
parent 5cdd221f
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ import kotlinx.coroutines.launch
/** Bind occludingAppDeviceEntryMessageViewModel to run whenever the keyguard view is attached. */
@OptIn(ExperimentalCoroutinesApi::class)
object KeyguardRootViewBinder {

    @SuppressLint("ClickableViewAccessibility")
    @JvmStatic
    fun bind(
@@ -102,14 +101,6 @@ object KeyguardRootViewBinder {
    ): DisposableHandle {
        var onLayoutChangeListener: OnLayoutChange? = null
        val childViews = mutableMapOf<Int, View>()
        val statusViewId = R.id.keyguard_status_view
        val burnInLayerId = R.id.burn_in_layer
        val aodNotificationIconContainerId = R.id.aod_notification_icon_container
        val largeClockId = R.id.lockscreen_clock_view_large
        val indicationArea = R.id.keyguard_indication_area
        val startButton = R.id.start_button
        val endButton = R.id.end_button
        val lockIcon = R.id.lock_icon_view

        if (KeyguardBottomAreaRefactor.isEnabled) {
            view.setOnTouchListener { _, event ->
@@ -214,7 +205,7 @@ object KeyguardRootViewBinder {
                                val px = state.value ?: return@collect
                                when {
                                    state.isToOrFrom(KeyguardState.AOD) -> {
                                        childViews[largeClockId]?.translationX = px
                                        // Large Clock is not translated in the x direction
                                        childViews[burnInLayerId]?.translationX = px
                                        childViews[aodNotificationIconContainerId]?.translationX =
                                            px
@@ -436,7 +427,7 @@ object KeyguardRootViewBinder {
            oldRight: Int,
            oldBottom: Int
        ) {
            childViews[R.id.nssl_placeholder]?.let { notificationListPlaceholder ->
            childViews[nsslPlaceholderId]?.let { notificationListPlaceholder ->
                // After layout, ensure the notifications are positioned correctly
                viewModel.onNotificationContainerBoundsChanged(
                    notificationListPlaceholder.top.toFloat(),
@@ -460,14 +451,14 @@ object KeyguardRootViewBinder {
                                )
                            }
                        } else {
                            childViews[R.id.keyguard_status_view]?.top ?: 0
                            childViews[statusViewId]?.top ?: 0
                        }
                )
            }
        }

        private fun isUserVisible(view: View): Boolean {
            return view.id != R.id.burn_in_layer &&
            return view.id != burnInLayerId &&
                view.visibility == VISIBLE &&
                view.width > 0 &&
                view.height > 0
@@ -589,6 +580,17 @@ object KeyguardRootViewBinder {
    private fun ViewPropertyAnimator.animateInIconTranslation(): ViewPropertyAnimator =
        setInterpolator(Interpolators.DECELERATE_QUINT).translationY(0f)

    private val statusViewId = R.id.keyguard_status_view
    private val burnInLayerId = R.id.burn_in_layer
    private val aodNotificationIconContainerId = R.id.aod_notification_icon_container
    private val largeClockId = R.id.lockscreen_clock_view_large
    private val smallClockId = R.id.lockscreen_clock_view
    private val indicationArea = R.id.keyguard_indication_area
    private val startButton = R.id.start_button
    private val endButton = R.id.end_button
    private val lockIcon = R.id.lock_icon_view
    private val nsslPlaceholderId = R.id.nssl_placeholder

    private const val ID = "occluding_app_device_entry_unlock_msg"
    private const val AOD_ICONS_APPEAR_DURATION: Long = 200
}