-
Notifications
You must be signed in to change notification settings - Fork 16
fix: compose autocapture properties update #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
android/src/main/java/com/amplitude/android/internal/ViewHierarchyScanner.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/amplitude/android/internal/locators/ComposeViewTargetLocator.java
Show resolved
Hide resolved
lastKnownTag = (String) entry.getValue(); | ||
final Modifier modifier = modifierInfo.getModifier(); | ||
if (modifier instanceof InspectableValue) { | ||
final InspectableValue inspectableValue = (InspectableValue) modifier; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be a good time to convert this to Kotlin too, to get inferred types make it more succinct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, bcos this is a java hack for reflection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand, it seems we don't use reflection here specifically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this manually, but changes LGTM!
I hope the internal implementation for Compose sticks with this approach 🤞🏽
🎉 This PR is included in version 1.20.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary
Jira ticket: https://amplitude.atlassian.net/browse/AMP-126719
With Compose update to new version it's internal implementation of testTag changed from
SemanticsModifier
toTestTagElement
The only common part is Inspectable Value params that we can iterate.
Tested on versions:
from 1.5.+
to 1.7.+
Supported tags:
Modifier.testTag("some value")
Modifier.semantics { testTag = "some value" }
Clickable nodes added support for clickable InspectableValue.
Checklist