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:
@@ -12,12 +12,9 @@ class KeyguardClockFrame(
|
|||||||
) : FrameLayout(context, attrs) {
|
) : FrameLayout(context, attrs) {
|
||||||
private var drawAlpha: Int = 255
|
private var drawAlpha: Int = 255
|
||||||
|
|
||||||
init {
|
|
||||||
setLayerType(View.LAYER_TYPE_SOFTWARE, null)
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override fun onSetAlpha(alpha: Int): Boolean {
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user