Disable Clock View Layer and ignore assigned alpha

The Software Layer is causing clipping. Instead of that approach, we'll
ignore the set alpha and compute our own alpha from the view's
properties This prevents regressing in edge cases where onSetAlpha(255)
is called from View.

Bug: 291300765
Test: Manually checked many clocks and re-verified double clock bug
Change-Id: I7f4813673cc6b61d7bc93d4984500c19bce41936
Merged-In: I7f4813673cc6b61d7bc93d4984500c19bce41936
This commit is contained in:
Hawkwood Glazier
2023-07-14 20:12:47 +00:00
parent 00bcb90df3
commit d1d45d4c31

View File

@@ -12,12 +12,9 @@ class KeyguardClockFrame(
) : FrameLayout(context, attrs) {
private var drawAlpha: Int = 255
init {
setLayerType(View.LAYER_TYPE_SOFTWARE, null)
}
protected override fun onSetAlpha(alpha: Int): Boolean {
drawAlpha = alpha
// Ignore alpha passed from View, prefer to compute it from set values
drawAlpha = (255 * this.alpha * transitionAlpha).toInt()
return true
}