From 37c657d5e3a466bd2b3aa6a3394a49c6acaabee9 Mon Sep 17 00:00:00 2001 From: Sha Sha Chu Date: Thu, 20 Jun 2019 14:22:42 -0700 Subject: [PATCH 1/3] Fixing view highlighting on Android P Fixes https://github.com/facebook/stetho/issues/648 --- .../inspector/elements/android/ViewHighlightOverlays.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java index fdf2a54f..628e5a05 100644 --- a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java +++ b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java @@ -140,7 +140,9 @@ public void draw(Canvas canvas) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { canvas.clipRect(newRect, Region.Op.REPLACE); } else { - canvas.clipOutRect(newRect); + canvas.save(); + canvas.clipRect(newRect); + canvas.restore(); } super.draw(canvas); } From b6a6412a2be52d80a036db1942e3565d72dc0d3e Mon Sep 17 00:00:00 2001 From: Sha Sha Chu Date: Mon, 24 Jun 2019 13:24:34 -0700 Subject: [PATCH 2/3] added comment --- .../stetho/inspector/elements/android/ViewHighlightOverlays.java | 1 + 1 file changed, 1 insertion(+) diff --git a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java index 628e5a05..6e703a4a 100644 --- a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java +++ b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java @@ -140,6 +140,7 @@ public void draw(Canvas canvas) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { canvas.clipRect(newRect, Region.Op.REPLACE); } else { + // Android P deprecated calls to clipRect with Ops other than INTERSECT and DIFFERENCE canvas.save(); canvas.clipRect(newRect); canvas.restore(); From 0f7f8636e5233e16caf317e712367620ad05f684 Mon Sep 17 00:00:00 2001 From: Sha Sha Chu Date: Tue, 6 Aug 2019 15:28:07 -0700 Subject: [PATCH 3/3] update comment --- .../stetho/inspector/elements/android/ViewHighlightOverlays.java | 1 + 1 file changed, 1 insertion(+) diff --git a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java index 6e703a4a..97375daa 100644 --- a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java +++ b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java @@ -140,6 +140,7 @@ public void draw(Canvas canvas) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { canvas.clipRect(newRect, Region.Op.REPLACE); } else { + // https://github.com/facebook/stetho/issues/648 // Android P deprecated calls to clipRect with Ops other than INTERSECT and DIFFERENCE canvas.save(); canvas.clipRect(newRect);