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

refactor: Align orientation and rotation terms #389

Merged
merged 15 commits into from
Oct 23, 2020

Conversation

mykola-mokhnach
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach commented Oct 22, 2020

UiAutomator only operates the term of Rotation, which reflects the current rotation value of the device display. However, the spec does not actually require that zero degrees rotation value is a portrait orientation, which might be the case for some devices. In such case the value returned for GetOrientation command would not be the one, that is naturally expected.

In this PR we try to workaround that issue by matching the actual orientation value retrieved from instrumentation context resources configuration with the actual rotation value if the useResourcesForOrientationDetection setting is set to true (by default it is false to avoid issues with current automation scripts).

@mykola-mokhnach
Copy link
Contributor Author

Linking appium/appium#11663

@mykola-mokhnach mykola-mokhnach changed the title [WIP] refactor: Align orientation and rotation terms refactor: Align orientation and rotation terms Oct 22, 2020
@dpgraham
Copy link
Contributor

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- app/src/main/java/io/appium/uiautomator2/handler/GetOrientation.java  2
- app/src/main/java/io/appium/uiautomator2/model/ScreenRotation.java  7
- app/src/main/java/io/appium/uiautomator2/handler/SetOrientation.java  2
- app/src/main/java/io/appium/uiautomator2/model/settings/UseResourcesForOrientationDetection.java  1
         

Complexity decreasing per file
==============================
+ app/src/main/java/io/appium/uiautomator2/model/ScreenOrientation.java  -2
         

See the complete overview on Codacy

Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

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

seems reasonable

@mykola-mokhnach mykola-mokhnach merged commit 96ad6f0 into appium:master Oct 23, 2020
@mykola-mokhnach mykola-mokhnach deleted the orientation branch October 23, 2020 10:12
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.

None yet

3 participants