-
Notifications
You must be signed in to change notification settings - Fork 46
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
[RUM-8908] SR: Fixed Android build issue for RN <= 0.68 #819
[RUM-8908] SR: Fixed Android build issue for RN <= 0.68 #819
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 651 Passed, 1 Skipped, 12.35s Total Time |
1d36c99
to
e6eecb4
Compare
.../rn69/kotlin/com.datadog.reactnative.sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt
Show resolved
Hide resolved
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.
Looks good to me!, just left a minor suggestion.
val borderRgb = reflectionUtils.getDeclaredField( | ||
backgroundDrawable, | ||
BORDER_RGB_FIELD_NAME | ||
) as Spacing? | ||
|
||
val borderAlpha = reflectionUtils.getDeclaredField( | ||
backgroundDrawable, | ||
BORDER_ALPHA_FIELD_NAME | ||
) as Spacing? |
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.
val borderRgb = reflectionUtils.getDeclaredField( | |
backgroundDrawable, | |
BORDER_RGB_FIELD_NAME | |
) as Spacing? | |
val borderAlpha = reflectionUtils.getDeclaredField( | |
backgroundDrawable, | |
BORDER_ALPHA_FIELD_NAME | |
) as Spacing? | |
val borderRgb = reflectionUtils.getDeclaredField( | |
backgroundDrawable, | |
BORDER_RGB_FIELD_NAME | |
) as? Spacing | |
val borderAlpha = reflectionUtils.getDeclaredField( | |
backgroundDrawable, | |
BORDER_ALPHA_FIELD_NAME | |
) as? Spacing |
return reflectionUtils.getDeclaredField( | ||
backgroundDrawable, | ||
COLOR_FIELD_NAME | ||
) as Int? |
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.
) as Int? | |
) as? Int |
95556de
to
7a08174
Compare
7a08174
to
e6eecb4
Compare
What does this PR do?
Fixes a Session Replay Android build error that occurs for RN <= 0.68.
The issue is caused by
ReactViewBackgroundDrawable
methodgetBorderColor
being private prior to RN 0.69. In order to fix it we leverage reflection to access the private attributes and resolve the border color on our side.Review checklist (to be filled by reviewers)