Commit 5d669d4
authored
feat: take transformed coordinates, which are more precise in animation (#309)
## Summary
Take transformed coordinates, which are more precise in animation for
both XML and Compose case using 4 points method.
<img width="1239" height="1416" alt="image"
src="https://github.com/user-attachments/assets/80de7635-98c0-48f4-ad66-2c2725a05efd"
/>
## How did you test this change?
<!--
Frontend - Leave a screencast or a screenshot to visually describe the
changes.
-->
## Are there any deployment considerations?
<!--
Backend - Do we need to consider migrations or backfilling data?
-->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Use transformed 4-point polygons for masking (more accurate under
animations), update masking APIs, and add an animated demo section in
the sample app.
>
> - **SDK/Masking**:
> - Introduce `MaskContext` (matrix, root offsets, matchers) and change
`MaskTarget.mask(...)` to accept context.
> - Compute transformed 4-point polygons in
`NativeMaskTarget.points(...)` and `ComposeMaskTarget.points(...)` (API
≥ Q), include as `Mask.points`.
> - Add `Mask.draw(...)` and update `CaptureSource.drawMasks(...)` to
render polygon paths (fallback to rects).
> - Refactor `MaskCollector` traversal to pass `MaskContext` and use
root screen offsets.
> - **E2E Sample**:
> - Wrap credit card inputs in `credit_card_section` and add continuous
Y-rotation animation in `XMLUserFormActivity` to exercise masking during
animations.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
16a967c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent a93645f commit 5d669d4
File tree
8 files changed
+238
-128
lines changed- e2e/android/app/src/main
- java/com/example/androidobservability/masking
- res/layout
- sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay
- capture
- masking
8 files changed
+238
-128
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
16 | 27 | | |
17 | 28 | | |
18 | 29 | | |
| |||
Lines changed: 85 additions & 78 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 93 | + | |
| 94 | + | |
107 | 95 | | |
108 | 96 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 97 | + | |
117 | 98 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
126 | 105 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
133 | 110 | | |
134 | | - | |
135 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
136 | 114 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
140 | 118 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
145 | 123 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
153 | 132 | | |
154 | 133 | | |
155 | | - | |
| 134 | + | |
156 | 135 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
160 | 139 | | |
161 | | - | |
162 | | - | |
| 140 | + | |
| 141 | + | |
163 | 142 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
169 | 162 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
173 | 180 | | |
174 | | - | |
175 | 181 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
180 | 186 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
| |||
Lines changed: 30 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
107 | | - | |
108 | | - | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| 174 | + | |
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| |||
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| 287 | + | |
284 | 288 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
292 | 312 | | |
293 | 313 | | |
294 | 314 | | |
Lines changed: 41 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | | - | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
106 | 145 | | |
107 | 146 | | |
108 | 147 | | |
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | | - | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
| 26 | + | |
0 commit comments