[Media TTT] Receiver ripple tweaks: Use an ellipse and use no sparkle
strength (so that it's a smooth ripple not a turbulent one). Bug: 203800342 Test: Trigger receiver chip and verify ripple Change-Id: Ic5ef8de206c834362746e502486d234c0cb34291
This commit is contained in:
@@ -208,13 +208,12 @@ class MediaTttChipControllerReceiver @Inject constructor(
|
||||
|
||||
private fun layoutRipple(rippleView: ReceiverChipRippleView) {
|
||||
val windowBounds = windowManager.currentWindowMetrics.bounds
|
||||
val height = windowBounds.height()
|
||||
val width = windowBounds.width()
|
||||
val height = windowBounds.height().toFloat()
|
||||
val width = windowBounds.width().toFloat()
|
||||
|
||||
val maxDiameter = height / 2.5f
|
||||
rippleView.setMaxSize(maxDiameter, maxDiameter)
|
||||
rippleView.setMaxSize(width / 2f, height / 2f)
|
||||
// Center the ripple on the bottom of the screen in the middle.
|
||||
rippleView.setCenter(width * 0.5f, height.toFloat())
|
||||
rippleView.setCenter(width * 0.5f, height)
|
||||
val color = Utils.getColorAttrDefaultColor(context, R.attr.wallpaperTextColorAccent)
|
||||
rippleView.setColor(color, 70)
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.systemui.media.taptotransfer.receiver
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.android.systemui.ripple.RippleShader
|
||||
import com.android.systemui.ripple.RippleView
|
||||
|
||||
/**
|
||||
@@ -25,9 +26,9 @@ import com.android.systemui.ripple.RippleView
|
||||
*/
|
||||
class ReceiverChipRippleView(context: Context?, attrs: AttributeSet?) : RippleView(context, attrs) {
|
||||
init {
|
||||
// TODO: use RippleShape#ELLIPSE when calling setupShader.
|
||||
setupShader()
|
||||
setupShader(RippleShader.RippleShape.ELLIPSE)
|
||||
setRippleFill(true)
|
||||
setSparkleStrength(0f)
|
||||
duration = 3000L
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user