Skip to content

RUM-721 treat scroll on non scrollable view as tap#1622

Merged
xgouchet merged 4 commits into
developfrom
xgouchet/RUM-721/detect_scrolling_tap
Sep 19, 2023
Merged

RUM-721 treat scroll on non scrollable view as tap#1622
xgouchet merged 4 commits into
developfrom
xgouchet/RUM-721/detect_scrolling_tap

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

What does this PR do?

A brief description of the change being made with this pull request.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@codecov-commenter

codecov-commenter commented Sep 18, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1622 (f3c6383) into develop (206dcd2) will decrease coverage by 0.05%.
Report is 2 commits behind head on develop.
The diff coverage is 83.33%.

@@             Coverage Diff             @@
##           develop    #1622      +/-   ##
===========================================
- Coverage    83.57%   83.52%   -0.05%     
===========================================
  Files          452      452              
  Lines        15652    15661       +9     
  Branches      2324     2326       +2     
===========================================
- Hits         13081    13080       -1     
- Misses        1950     1955       +5     
- Partials       621      626       +5     
Files Changed Coverage Δ
...essionreplay/internal/recorder/LayerDrawableExt.kt 100.00% <ø> (ø)
...ernal/instrumentation/gestures/GesturesListener.kt 93.06% <83.33%> (-0.28%) ⬇️

... and 25 files with indirect coverage changes

mariusc83
mariusc83 previously approved these changes Sep 18, 2023
@xgouchet
xgouchet force-pushed the xgouchet/RUM-721/detect_scrolling_tap branch from 3dd49a3 to 1a96e81 Compare September 18, 2023 11:26
@xgouchet
xgouchet force-pushed the xgouchet/RUM-721/detect_scrolling_tap branch from 1a96e81 to ed67bed Compare September 18, 2023 11:49
Comment thread build.gradle.kts
result += File(androidJarFilePath.joinToString(File.separator))
}

val envSdkHome = System.getenv("ANDROID_SDK_ROOT")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This ensures that in CI (where no local.properties file exists) we still include the android.jar for type resolution.

return ScrollingView::class.java.isAssignableFrom(view.javaClass) ||
AbsListView::class.java.isAssignableFrom(view.javaClass)
AbsListView::class.java.isAssignableFrom(view.javaClass) ||
ScrollView::class.java.isAssignableFrom(view.javaClass)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This one was missing from our supported Views

@xgouchet
xgouchet marked this pull request as ready for review September 18, 2023 11:57
@xgouchet
xgouchet requested a review from a team as a code owner September 18, 2023 11:57
@xgouchet xgouchet changed the title Update shared static analysis pipeline RUM-721 treat scroll on non scrollable view as tap Sep 18, 2023
@xgouchet
xgouchet requested a review from mariusc83 September 18, 2023 15:26
mariusc83
mariusc83 previously approved these changes Sep 19, 2023

@mariusc83 mariusc83 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nicely done

0xnm
0xnm previously approved these changes Sep 19, 2023

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm! I've added few suggestions.

val downTarget = findTargetForTap(decorView, onTouchDownXPos, onTouchDownYPos)
val upTarget = findTargetForTap(decorView, onUpEvent.x, onUpEvent.y)

if (downTarget == upTarget && downTarget != null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would suggest to use === operator here to highlight that we want exactly same instance by reference (because who knows, maybe it will be some View which redefines equals).

GesturesListener.SCROLL_DIRECTION_RIGHT
]
)
fun `M send a tap rum event if target is a non scrollabld`(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo here, should be scrollable (I don't have suggestion button available, because reviewing individual commit)

jonathanmos
jonathanmos previously approved these changes Sep 19, 2023
@xgouchet
xgouchet merged commit 85087f3 into develop Sep 19, 2023
@xgouchet
xgouchet deleted the xgouchet/RUM-721/detect_scrolling_tap branch September 19, 2023 11:46
@xgouchet

Copy link
Copy Markdown
Contributor Author

This fixes #1389

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.

5 participants