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

Commit 957495fe authored by Sherry Zhou's avatar Sherry Zhou Committed by Android (Google) Code Review
Browse files

Merge "Fix Calligraphy Clock overlapping with UDFPS in preview" into main

parents bfa15e86 00fcd67b
Loading
Loading
Loading
Loading
+30 −11
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ import android.widget.TextView
import android.window.InputTransferToken
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.constraintlayout.widget.ConstraintSet.PARENT_ID
import androidx.constraintlayout.widget.ConstraintSet.START
import androidx.constraintlayout.widget.ConstraintSet.TOP
import androidx.constraintlayout.widget.ConstraintSet.WRAP_CONTENT
import androidx.core.view.isInvisible
import com.android.keyguard.ClockEventController
import com.android.keyguard.KeyguardClockSwitch
@@ -393,7 +397,7 @@ constructor(
            ),
        )

        setUpUdfps(previewContext, rootView)
        setUpUdfps(previewContext, if (migrateClocksToBlueprint()) keyguardRootView else rootView)

        if (keyguardBottomAreaRefactor()) {
            setupShortcuts(keyguardRootView)
@@ -468,7 +472,28 @@ constructor(
            return
        }

        val finger =
            LayoutInflater.from(previewContext)
                .inflate(
                    R.layout.udfps_keyguard_preview,
                    parentView,
                    false,
                ) as View

        // Place the UDFPS view in the proper sensor location
        if (migrateClocksToBlueprint()) {
            finger.id = R.id.lock_icon_view
            parentView.addView(finger)
            val cs = ConstraintSet()
            cs.clone(parentView as ConstraintLayout)
            cs.apply {
                constrainWidth(R.id.lock_icon_view, sensorBounds.width())
                constrainHeight(R.id.lock_icon_view, sensorBounds.height())
                connect(R.id.lock_icon_view, TOP, PARENT_ID, TOP, sensorBounds.top)
                connect(R.id.lock_icon_view, START, PARENT_ID, START, sensorBounds.left)
            }
            cs.applyTo(parentView)
        } else {
            val fingerprintLayoutParams =
                FrameLayout.LayoutParams(sensorBounds.width(), sensorBounds.height())
            fingerprintLayoutParams.setMarginsRelative(
@@ -477,15 +502,9 @@ constructor(
                sensorBounds.right,
                sensorBounds.bottom
            )
        val finger =
            LayoutInflater.from(previewContext)
                .inflate(
                    R.layout.udfps_keyguard_preview,
                    parentView,
                    false,
                ) as View
            parentView.addView(finger, fingerprintLayoutParams)
        }
    }

    private fun setUpClock(previewContext: Context, parentView: ViewGroup) {
        val resources = parentView.resources