From 608cd69805e359b320cad6323438009ebc8b18a2 Mon Sep 17 00:00:00 2001 From: Stefan Andonian Date: Mon, 15 Aug 2022 22:12:47 +0000 Subject: [PATCH] Get elevation in time-lapse View Hierarchy capture. Bug: 234032088 Test: Verified that elevation attributes from device are captured and show up correctly on go/web-hv UI. Change-Id: Id4c5a5c5a003cc38d332edc99365b160f17c52a6 --- protos/view_capture.proto | 2 ++ src/com/android/launcher3/util/ViewCapture.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/protos/view_capture.proto b/protos/view_capture.proto index 98574dd172..349ff36d15 100644 --- a/protos/view_capture.proto +++ b/protos/view_capture.proto @@ -51,4 +51,6 @@ message ViewNode { optional int32 visibility = 16; repeated ViewNode children = 17; + + optional float elevation = 18; } diff --git a/src/com/android/launcher3/util/ViewCapture.java b/src/com/android/launcher3/util/ViewCapture.java index cf4e84a84b..58c8269f97 100644 --- a/src/com/android/launcher3/util/ViewCapture.java +++ b/src/com/android/launcher3/util/ViewCapture.java @@ -240,6 +240,7 @@ public class ViewCapture implements OnDrawListener { public float translateX, translateY; public float scaleX, scaleY; public float alpha; + public float elevation; public int visibility; public boolean willNotDraw; @@ -271,6 +272,7 @@ public class ViewCapture implements OnDrawListener { visibility = view.getVisibility(); willNotDraw = view.willNotDraw(); + elevation = view.getElevation(); } /** @@ -303,6 +305,7 @@ public class ViewCapture implements OnDrawListener { .setAlpha(alpha) .setVisibility(visibility) .setWillNotDraw(willNotDraw) + .setElevation(elevation) .setClipChildren(clipChildren); ViewPropertyRef result = next;