Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleView.kt +2 −2 Original line number Diff line number Diff line Loading @@ -75,12 +75,12 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at } private var radius: Float = 0f set(value) { rippleShader.radius = value rippleShader.setMaxSize(value * 2f, value * 2f) field = value } private var origin: PointF = PointF() set(value) { rippleShader.origin = value rippleShader.setCenter(value.x, value.y) field = value } Loading packages/SystemUI/src/com/android/systemui/charging/WiredChargingRippleController.kt +12 −8 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.charging import android.content.Context import android.content.res.Configuration import android.graphics.PixelFormat import android.graphics.PointF import android.os.SystemProperties import android.util.DisplayMetrics import android.view.View Loading Loading @@ -85,7 +84,7 @@ class WiredChargingRippleController @Inject constructor( private var debounceLevel = 0 @VisibleForTesting var rippleView: RippleView = RippleView(context, attrs = null) var rippleView: RippleView = RippleView(context, attrs = null).also { it.setupShader() } init { pluggedIn = batteryController.isPluggedIn Loading Loading @@ -177,20 +176,25 @@ class WiredChargingRippleController @Inject constructor( context.display.getRealMetrics(displayMetrics) val width = displayMetrics.widthPixels val height = displayMetrics.heightPixels rippleView.radius = Integer.max(width, height).toFloat() rippleView.origin = when (RotationUtils.getExactRotation(context)) { val maxDiameter = Integer.max(width, height) * 2f rippleView.setMaxSize(maxDiameter, maxDiameter) when (RotationUtils.getExactRotation(context)) { RotationUtils.ROTATION_LANDSCAPE -> { PointF(width * normalizedPortPosY, height * (1 - normalizedPortPosX)) rippleView.setCenter( width * normalizedPortPosY, height * (1 - normalizedPortPosX)) } RotationUtils.ROTATION_UPSIDE_DOWN -> { PointF(width * (1 - normalizedPortPosX), height * (1 - normalizedPortPosY)) rippleView.setCenter( width * (1 - normalizedPortPosX), height * (1 - normalizedPortPosY)) } RotationUtils.ROTATION_SEASCAPE -> { PointF(width * (1 - normalizedPortPosY), height * normalizedPortPosX) rippleView.setCenter( width * (1 - normalizedPortPosY), height * normalizedPortPosX) } else -> { // ROTATION_NONE PointF(width * normalizedPortPosX, height * normalizedPortPosY) rippleView.setCenter( width * normalizedPortPosX, height * normalizedPortPosY) } } } Loading packages/SystemUI/src/com/android/systemui/charging/WirelessChargingLayout.java +8 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Color; import android.graphics.PointF; import android.util.AttributeSet; import android.util.TypedValue; import android.view.ContextThemeWrapper; Loading @@ -34,6 +33,7 @@ import android.widget.TextView; import com.android.settingslib.Utils; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.ripple.RippleShader; import com.android.systemui.ripple.RippleView; import java.text.NumberFormat; Loading Loading @@ -138,6 +138,8 @@ public class WirelessChargingLayout extends FrameLayout { animatorSetScrim.start(); mRippleView = findViewById(R.id.wireless_charging_ripple); // TODO: Make rounded box shape if the device is tablet. mRippleView.setupShader(RippleShader.RippleShape.CIRCLE); OnAttachStateChangeListener listener = new OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View view) { Loading Loading @@ -230,11 +232,11 @@ public class WirelessChargingLayout extends FrameLayout { if (mRippleView != null) { int width = getMeasuredWidth(); int height = getMeasuredHeight(); mRippleView.setColor( Utils.getColorAttr(mRippleView.getContext(), mRippleView.setCenter(width * 0.5f, height * 0.5f); float maxSize = Math.max(width, height); mRippleView.setMaxSize(maxSize, maxSize); mRippleView.setColor(Utils.getColorAttr(mRippleView.getContext(), android.R.attr.colorAccent).getDefaultColor()); mRippleView.setOrigin(new PointF(width / 2, height / 2)); mRippleView.setRadius(Math.max(width, height) * 0.5f); } super.onLayout(changed, left, top, right, bottom); Loading packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt +3 −4 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.media.taptotransfer.receiver import android.annotation.SuppressLint import android.app.StatusBarManager import android.content.Context import android.graphics.PointF import android.graphics.drawable.Drawable import android.graphics.drawable.Icon import android.media.MediaRoute2Info Loading Loading @@ -202,10 +201,10 @@ class MediaTttChipControllerReceiver @Inject constructor( val height = windowBounds.height() val width = windowBounds.width() rippleView.radius = height / 5f val maxDiameter = height / 2.5f rippleView.setMaxSize(maxDiameter, maxDiameter) // Center the ripple on the bottom of the screen in the middle. rippleView.origin = PointF(/* x= */ width / 2f, /* y= */ height.toFloat()) rippleView.setCenter(width * 0.5f, height.toFloat()) val color = Utils.getColorAttrDefaultColor(context, R.attr.wallpaperTextColorAccent) val colorWithAlpha = ColorUtils.setAlphaComponent(color, 70) rippleView.setColor(colorWithAlpha) Loading packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ReceiverChipRippleView.kt +2 −3 Original line number Diff line number Diff line Loading @@ -23,10 +23,9 @@ import com.android.systemui.ripple.RippleView /** * An expanding ripple effect for the media tap-to-transfer receiver chip. */ class ReceiverChipRippleView( context: Context?, attrs: AttributeSet? ) : RippleView(context, attrs) { class ReceiverChipRippleView(context: Context?, attrs: AttributeSet?) : RippleView(context, attrs) { init { setupShader() setRippleFill(true) duration = 3000L } Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleView.kt +2 −2 Original line number Diff line number Diff line Loading @@ -75,12 +75,12 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at } private var radius: Float = 0f set(value) { rippleShader.radius = value rippleShader.setMaxSize(value * 2f, value * 2f) field = value } private var origin: PointF = PointF() set(value) { rippleShader.origin = value rippleShader.setCenter(value.x, value.y) field = value } Loading
packages/SystemUI/src/com/android/systemui/charging/WiredChargingRippleController.kt +12 −8 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.charging import android.content.Context import android.content.res.Configuration import android.graphics.PixelFormat import android.graphics.PointF import android.os.SystemProperties import android.util.DisplayMetrics import android.view.View Loading Loading @@ -85,7 +84,7 @@ class WiredChargingRippleController @Inject constructor( private var debounceLevel = 0 @VisibleForTesting var rippleView: RippleView = RippleView(context, attrs = null) var rippleView: RippleView = RippleView(context, attrs = null).also { it.setupShader() } init { pluggedIn = batteryController.isPluggedIn Loading Loading @@ -177,20 +176,25 @@ class WiredChargingRippleController @Inject constructor( context.display.getRealMetrics(displayMetrics) val width = displayMetrics.widthPixels val height = displayMetrics.heightPixels rippleView.radius = Integer.max(width, height).toFloat() rippleView.origin = when (RotationUtils.getExactRotation(context)) { val maxDiameter = Integer.max(width, height) * 2f rippleView.setMaxSize(maxDiameter, maxDiameter) when (RotationUtils.getExactRotation(context)) { RotationUtils.ROTATION_LANDSCAPE -> { PointF(width * normalizedPortPosY, height * (1 - normalizedPortPosX)) rippleView.setCenter( width * normalizedPortPosY, height * (1 - normalizedPortPosX)) } RotationUtils.ROTATION_UPSIDE_DOWN -> { PointF(width * (1 - normalizedPortPosX), height * (1 - normalizedPortPosY)) rippleView.setCenter( width * (1 - normalizedPortPosX), height * (1 - normalizedPortPosY)) } RotationUtils.ROTATION_SEASCAPE -> { PointF(width * (1 - normalizedPortPosY), height * normalizedPortPosX) rippleView.setCenter( width * (1 - normalizedPortPosY), height * normalizedPortPosX) } else -> { // ROTATION_NONE PointF(width * normalizedPortPosX, height * normalizedPortPosY) rippleView.setCenter( width * normalizedPortPosX, height * normalizedPortPosY) } } } Loading
packages/SystemUI/src/com/android/systemui/charging/WirelessChargingLayout.java +8 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Color; import android.graphics.PointF; import android.util.AttributeSet; import android.util.TypedValue; import android.view.ContextThemeWrapper; Loading @@ -34,6 +33,7 @@ import android.widget.TextView; import com.android.settingslib.Utils; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.ripple.RippleShader; import com.android.systemui.ripple.RippleView; import java.text.NumberFormat; Loading Loading @@ -138,6 +138,8 @@ public class WirelessChargingLayout extends FrameLayout { animatorSetScrim.start(); mRippleView = findViewById(R.id.wireless_charging_ripple); // TODO: Make rounded box shape if the device is tablet. mRippleView.setupShader(RippleShader.RippleShape.CIRCLE); OnAttachStateChangeListener listener = new OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View view) { Loading Loading @@ -230,11 +232,11 @@ public class WirelessChargingLayout extends FrameLayout { if (mRippleView != null) { int width = getMeasuredWidth(); int height = getMeasuredHeight(); mRippleView.setColor( Utils.getColorAttr(mRippleView.getContext(), mRippleView.setCenter(width * 0.5f, height * 0.5f); float maxSize = Math.max(width, height); mRippleView.setMaxSize(maxSize, maxSize); mRippleView.setColor(Utils.getColorAttr(mRippleView.getContext(), android.R.attr.colorAccent).getDefaultColor()); mRippleView.setOrigin(new PointF(width / 2, height / 2)); mRippleView.setRadius(Math.max(width, height) * 0.5f); } super.onLayout(changed, left, top, right, bottom); Loading
packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt +3 −4 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.media.taptotransfer.receiver import android.annotation.SuppressLint import android.app.StatusBarManager import android.content.Context import android.graphics.PointF import android.graphics.drawable.Drawable import android.graphics.drawable.Icon import android.media.MediaRoute2Info Loading Loading @@ -202,10 +201,10 @@ class MediaTttChipControllerReceiver @Inject constructor( val height = windowBounds.height() val width = windowBounds.width() rippleView.radius = height / 5f val maxDiameter = height / 2.5f rippleView.setMaxSize(maxDiameter, maxDiameter) // Center the ripple on the bottom of the screen in the middle. rippleView.origin = PointF(/* x= */ width / 2f, /* y= */ height.toFloat()) rippleView.setCenter(width * 0.5f, height.toFloat()) val color = Utils.getColorAttrDefaultColor(context, R.attr.wallpaperTextColorAccent) val colorWithAlpha = ColorUtils.setAlphaComponent(color, 70) rippleView.setColor(colorWithAlpha) Loading
packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ReceiverChipRippleView.kt +2 −3 Original line number Diff line number Diff line Loading @@ -23,10 +23,9 @@ import com.android.systemui.ripple.RippleView /** * An expanding ripple effect for the media tap-to-transfer receiver chip. */ class ReceiverChipRippleView( context: Context?, attrs: AttributeSet? ) : RippleView(context, attrs) { class ReceiverChipRippleView(context: Context?, attrs: AttributeSet?) : RippleView(context, attrs) { init { setupShader() setRippleFill(true) duration = 3000L } Loading