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

Support gesture margin for default Scroll #51

Merged
merged 4 commits into from
Jul 24, 2024
Merged

Conversation

dshiroma
Copy link
Contributor

@dshiroma dshiroma commented Jul 23, 2024

  • Applying Scroll margin property to all RPC calls to scroll.

Example usage now works as expected:

ad.ui(res='com.android.chrome:id/compositor_view_holder')
    .scroll(margin=100)  # <--- wouldn't have done anything before
    .down(percent=70, speed=700)

This change is Reviewable

@dshiroma dshiroma marked this pull request as draft July 23, 2024 21:49
@dshiroma dshiroma marked this pull request as ready for review July 23, 2024 21:49
@ko1in1u ko1in1u requested review from eric100lin and ko1in1u July 23, 2024 22:04
@ko1in1u ko1in1u self-assigned this Jul 23, 2024
@ko1in1u ko1in1u added the enhancement New feature or request label Jul 23, 2024
@ko1in1u ko1in1u added this to the 1.1.2 milestone Jul 23, 2024
@ko1in1u
Copy link
Collaborator

ko1in1u commented Jul 23, 2024

Please help to build and update apk here as well, thank you.

@dshiroma
Copy link
Contributor Author

Added .apk file.

Copy link
Collaborator

@eric100lin eric100lin left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dshiroma and @ko1in1u)


snippet_uiautomator/android/app/src/main/java/com/google/android/mobly/snippet/uiautomator/UiObject2Snippet.java line 313 at r3 (raw file):

      throws SelectorException {
    Direction direction = Direction.valueOf(directionStr);
    UiObject2 uiObject2 = selector.toUiObject2();

nit: it would be nice to declare these variables as final

Suggestion:

    final Direction direction = Direction.valueOf(directionStr);

    final UiObject2 uiObject2 = selector.toUiObject2();

@dshiroma
Copy link
Contributor Author

dshiroma commented Jul 24, 2024

:lgtm:

Reviewed 2 of 2 files at r1, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dshiroma and @ko1in1u)

snippet_uiautomator/android/app/src/main/java/com/google/android/mobly/snippet/uiautomator/UiObject2Snippet.java line 313 at r3 (raw file):

      throws SelectorException {
    Direction direction = Direction.valueOf(directionStr);
    UiObject2 uiObject2 = selector.toUiObject2();

nit: it would be nice to declare these variables as final

Suggestion:

    final Direction direction = Direction.valueOf(directionStr);

    final UiObject2 uiObject2 = selector.toUiObject2();

Done.

@ko1in1u ko1in1u merged commit 4937318 into google:main Jul 24, 2024
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants