Skip to content

Commit 6233764

Browse files
feat: Support ldMask() for Native and Compose views. (#295)
## Summary 1. Support ldMask() for Native and Compose views. a. Native ``` view.ldMask() ``` b. Compose ``` modifier = Modifier.ldMask() ``` 2. 2 XML screens: Fruta and Credit Card 3. Make Compose User form rotate ## How did you test this change? Test SR using RRWeb player on SecondaryActivity, Fruta(XML), Credit Card <img width="660" height="1294" alt="image" src="https://github.com/user-attachments/assets/f6cba822-fd59-43f1-9aac-040200e6dffb" /> <img width="324" height="655" alt="image" src="https://github.com/user-attachments/assets/7f3d98f6-601d-4e6e-8f74-b0306c026717" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds ldMask for native Views and Compose, introduces SensitiveAreasCollector to mask captured regions, and includes new Credit Card and Smoothie sample screens. > > - **SDK / Session Replay**: > - **Masking API**: Add `View.ldMask()/ldUnmask()` and `Modifier.ldMask()/ldUnmask()` in `MaskingViewAPI.kt`; define `LdMaskSemanticsKey`. > - **Sensitive Area Detection**: Introduce `SensitiveAreasCollector` to gather sensitive rects from Compose semantics and native `View` tags; add `view_tags.xml` ids. > - **Capture Pipeline**: Refactor `CaptureSource` to use `SensitiveAreasCollector` and apply gray masking over returned rects. > - **E2E App**: > - **New Screens (XML)**: Add `CreditCardActivity` and `SmoothieListActivity` with layouts (`activity_credit_card.xml`, `activity_smoothie_list.xml`, `item_smoothie.xml`) and `SmoothieAdapter`; register in `AndroidManifest.xml` and add launch buttons in `MainActivity`. > - **Compose Demo**: Update `SecondaryActivity` to use `Modifier.ldMask()` on header and animate rotation of the address card. > - **UI/Dependencies**: Switch theme to `Theme.Material3.DayNight.NoActionBar`; add `androidx.recyclerview:recyclerview` dependency. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f04c7eb. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 5f580da commit 6233764

31 files changed

+648
-139
lines changed

e2e/android/app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ dependencies {
7474
implementation("com.squareup.okhttp3:okhttp:4.12.0")
7575

7676
implementation("com.google.android.material:material:1.12.0")
77+
implementation("androidx.recyclerview:recyclerview:1.3.2")
7778
implementation(libs.androidx.core.ktx)
7879
implementation(libs.androidx.lifecycle.runtime.ktx)
7980
implementation(libs.androidx.activity.compose)

e2e/android/app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
android:exported="false"
2222
android:label="@string/title_activity_secondary"
2323
android:theme="@style/Theme.AndroidObservability" />
24+
<activity
25+
android:name=".CreditCardActivity"
26+
android:exported="false"
27+
android:theme="@style/Theme.AndroidObservability" />
28+
<activity
29+
android:name="com.smoothie.SmoothieListActivity"
30+
android:exported="false"
31+
android:theme="@style/Theme.AndroidObservability" />
2432
<service
2533
android:name=".ObservabilityForegroundService"
2634
android:exported="false" />
77.1 KB
Loading
66.9 KB
Loading
104 KB
Loading
90.4 KB
Loading
87.1 KB
Loading
88 KB
Loading
78.3 KB
Loading
81.3 KB
Loading

0 commit comments

Comments
 (0)