Merge "Add temporary logging for stuck nav button feedback" into rvc-dev

This commit is contained in:
Winson Chung
2020-06-11 17:33:55 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 4 deletions

View File

@@ -28,6 +28,7 @@ import android.graphics.PixelFormat;
import android.graphics.RecordingCanvas;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.util.Log;
import android.view.RenderNodeAnimator;
import android.view.View;
import android.view.ViewConfiguration;
@@ -220,7 +221,7 @@ public class KeyButtonRipple extends Drawable {
@Override
public void jumpToCurrentState() {
cancelAnimations();
cancelAnimations("jumpToCurrentState");
}
@Override
@@ -234,6 +235,7 @@ public class KeyButtonRipple extends Drawable {
}
public void setPressed(boolean pressed) {
Log.d("b/63783866", "KeyButtonRipple.setPressed: pressed=" + pressed);
if (mDark != mLastDark && pressed) {
mRipplePaint = null;
mLastDark = mDark;
@@ -253,7 +255,8 @@ public class KeyButtonRipple extends Drawable {
mHandler.removeCallbacksAndMessages(null);
}
private void cancelAnimations() {
private void cancelAnimations(String reason) {
Log.d("b/63783866", "KeyButtonRipple.cancelAnimations: reason=" + reason);
mVisible = false;
mTmpArray.addAll(mRunningAnimations);
int size = mTmpArray.size();
@@ -284,7 +287,7 @@ public class KeyButtonRipple extends Drawable {
}
private void enterSoftware() {
cancelAnimations();
cancelAnimations("enterSoftware");
mVisible = true;
mGlowAlpha = getMaxGlowAlpha();
ObjectAnimator scaleAnimator = ObjectAnimator.ofFloat(this, "glowScale",
@@ -370,7 +373,8 @@ public class KeyButtonRipple extends Drawable {
}
private void enterHardware() {
cancelAnimations();
Log.d("b/63783866", "enterHardware");
cancelAnimations("enterHardware");
mVisible = true;
mDrawingHardwareGlow = true;
setExtendStart(CanvasProperty.createFloat(getExtendSize() / 2));
@@ -422,6 +426,7 @@ public class KeyButtonRipple extends Drawable {
}
private void exitHardware() {
Log.d("b/63783866", "exitHardware");
mPaintProp = CanvasProperty.createPaint(getRipplePaint());
final RenderNodeAnimator opacityAnim = new RenderNodeAnimator(mPaintProp,
RenderNodeAnimator.PAINT_ALPHA, 0);

View File

@@ -441,6 +441,7 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
@Override
public void abortCurrentGesture() {
Log.d("b/63783866", "KeyButtonView.abortCurrentGesture");
setPressed(false);
mRipple.abortDelayedRipple();
mGestureAborted = true;