Skip to content
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-4148 Add support to the Toolbar in Session Replay #2024

Merged
merged 3 commits into from
May 3, 2024

Conversation

xgouchet
Copy link
Member

@xgouchet xgouchet commented May 2, 2024

What does this PR do?

This PR allows sessin replay to capture the content of a Toolbar.

  • it let's the default mapping handle all the toolbar's children
  • it capture's the ActionBarContainer's background

@xgouchet xgouchet requested review from a team as code owners May 2, 2024 15:01
@codecov-commenter
Copy link

codecov-commenter commented May 2, 2024

Codecov Report

Attention: Patch coverage is 95.91837% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 83.51%. Comparing base (5e0f0f2) to head (562efbf).
Report is 20 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2024      +/-   ##
===========================================
- Coverage    83.55%   83.51%   -0.04%     
===========================================
  Files          478      482       +4     
  Lines        17576    17586      +10     
  Branches      2672     2671       -1     
===========================================
+ Hits         14684    14686       +2     
- Misses        2164     2171       +7     
- Partials       728      729       +1     
Files Coverage Δ
...compat/widget/DatadogActionBarContainerAccessor.kt 100.00% <100.00%> (ø)
.../sessionreplay/internal/DefaultRecorderProvider.kt 84.91% <100.00%> (-0.68%) ⬇️
...ssionreplay/internal/recorder/TraversalStrategy.kt 100.00% <100.00%> (ø)
...ssionreplay/internal/recorder/TreeViewTraversal.kt 100.00% <ø> (ø)
...ay/internal/recorder/mapper/BaseViewGroupMapper.kt 100.00% <100.00%> (ø)
...ay/internal/recorder/mapper/ViewWireframeMapper.kt 100.00% <100.00%> (ø)
...ternal/recorder/mapper/ActionBarContainerMapper.kt 90.48% <90.48%> (ø)

... and 26 files with indirect coverage changes

import android.annotation.SuppressLint
import android.graphics.drawable.Drawable

internal class ActionBarContainerDrawableAccessor(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: maybe add Datadog to the name? unlikely that the class named ActionBarContainerDrawableAccessor will ever appear in Android codebase, but who knows.

// ActionBarContainer class.
// Fortunately, the mBackground field we're interested in is package private,
// which allows us to access it.
// val background = backgroundField?.get(view) as? Drawable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

val shapeStyle = background?.let { resolveShapeStyle(it, view.alpha) }
val id = viewIdentifierResolver.resolveChildUniqueIdentifier(view, PREFIX_BACKGROUND_DRAWABLE)

if ((shapeStyle != null) && (id != null)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: extra brackets

}

@SuppressLint("RestrictedApi")
fun setBackgroundDrawabal(drawable: Drawable) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in the method name

Suggested change
fun setBackgroundDrawabal(drawable: Drawable) {
fun setBackgroundDrawable(drawable: Drawable) {

@xgouchet xgouchet merged commit 3d0a4d2 into develop May 3, 2024
21 checks passed
@xgouchet xgouchet deleted the xgouchet/RUM-4148/sr_toolbar branch May 3, 2024 08:54
@xgouchet xgouchet added this to the 2.10.x milestone Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants