Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

#102 FIX#772

Merged
TikhomirovSergey merged 4 commits intoappium:masterappium/java-client:masterfrom
TikhomirovSergey:masterCopy head branch name to clipboard
Nov 25, 2017
Merged

#102 FIX#772
TikhomirovSergey merged 4 commits intoappium:masterappium/java-client:masterfrom
TikhomirovSergey:masterCopy head branch name to clipboard

Conversation

@TikhomirovSergey
Copy link
Contributor

Change list

  • MissingParameterException was removed
  • some code improvements in MultiTouchAction. Now it will throw IllegalArgumentException when no action is defined.

#102

Types of changes

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@mykola-mokhnach
Copy link
Contributor

  • 💯 for picking up issues that have been waiting for three years in the backlog 👍

} else if (size == 1) {
} else {
//android doesn't like having multi-touch actions with only a single TouchAction...
performsTouchActions.performTouchAction(actions.build().get(0));
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps touchActions.get(0) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. Will improve soon

checkArgument(touchActions.size() > 0,
"MultiTouch action must have at least one TouchAction added before it can be performed");
if (touchActions.size() > 1) {
performsTouchActions.performMultiTouchAction(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

you can returns this immediately here, so then else block is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mykola-mokhnach
I can't understand how to do it

performsTouchActions.performMultiTouchAction(this);

is void

performsTouchActions.performTouchAction(touchActions.get(0));

returns TouchAction

Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Nov 25, 2017

Choose a reason for hiding this comment

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

        if (touchActions.size() > 1) {
            performsTouchActions.performMultiTouchAction(this);
            return this;
        }
        //android doesn't like having multi-touch actions with only a single TouchAction...
        performsTouchActions.performTouchAction(touchActions.get(0));
        return this;

touchActions.forEach(action -> {
listOfActionChains.add(action.getParameters().get("actions"));
});
touchActions.forEach(action ->
Copy link
Contributor

Choose a reason for hiding this comment

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

why not to replace it with something like ImmutableList.Builder<Object> listOfActionChains = ImmutableList.copyOf(touchActions.stream().map(x -> x.getParameters().get("actions"))); ?

@TikhomirovSergey
Copy link
Contributor Author

TikhomirovSergey commented Nov 24, 2017

@mykola-mokhnach There is one more change.
Yes. There is some legacy (from Java 7 times) code which still can be here. Sometimes it is difficult to see it because of force of habit :)
@SrinivasanTarget your rewiev is is also valuable.

@appium appium deleted a comment Nov 25, 2017
Copy link
Member

@SrinivasanTarget SrinivasanTarget left a comment

Choose a reason for hiding this comment

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

LGTM

@TikhomirovSergey TikhomirovSergey merged commit 8798102 into appium:master Nov 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.