This PR adds support for scroll and swipe autocapture. The functionality is enabled by default when userInteractions is set to true in DefaultTrackingOptions.
[Amplitude] Element Scrolled: Emitted when a user scrolls on a scrollable element in the legacy Android View system or a tagged scrollable @Composable functions in Compose.
[Amplitude] Element Swiped: Emitted when a user flings on a UI element that was previously scrolled/moved.
Note: To capture the event in Compose, the scrollable @Composable functions must include a Modifier.testTag, otherwise the event will not be captured. Scrollable @Composable functions have an ScrollBy lambda or a Modifier.scrollable modifier (for Jetpack Compose > 1.5).
New automatically captured properties
[Amplitude] Direction: (Android Views and Compose) The direction of the scroll or swipe (Up, Right, Down, Left).
Optimizations around Autocapture implementations
Resource name has a fallback now in case a resourceEntryName does not exist.
Reflection is done lazily for Compose internals.
Checklist
[x] Does your PR title have the correct title format?
Summary
This PR adds support for scroll and swipe autocapture. The functionality is enabled by default when
userInteractions
is set totrue
inDefaultTrackingOptions
.New automatically captured event
[Amplitude] Element Scrolled
: Emitted when a user scrolls on a scrollable element in the legacy Android View system or a tagged scrollable@Composable
functions in Compose.[Amplitude] Element Swiped
: Emitted when a user flings on a UI element that was previously scrolled/moved.Note: To capture the event in Compose, the scrollable
@Composable
functions must include a Modifier.testTag, otherwise the event will not be captured. Scrollable@Composable
functions have an ScrollBy lambda or a Modifier.scrollable modifier (for Jetpack Compose > 1.5).New automatically captured properties
[Amplitude] Direction
: (Android Views and Compose) The direction of the scroll or swipe (Up
,Right
,Down
,Left
).Optimizations around Autocapture implementations
resourceEntryName
does not exist.Checklist