Skip to content

Commit

Permalink
fix(android): fix RNClickAction constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
asafkorem committed May 12, 2024
1 parent bffb819 commit 5f6ac60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public static ViewAction longPress(Integer x, Integer y) {
}

public static ViewAction longPress(Integer x, Integer y, Integer duration) {
Long finalDuration = duration == null ? DetoxViewConfigurations.getLongPressTimeout() : duration;
Long finalDuration = duration != null ? duration : DetoxViewConfigurations.getLongPressTimeout();
CoordinatesProvider coordinatesProvider = x == null || y == null ? null : createCoordinatesProvider(x, y);

return actionWithAssertions(new RNClickAction(coordinatesProvider, finalDuration));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ public class RNClickAction implements ViewAction {
private final GeneralClickAction clickAction;

public RNClickAction() {
this(GeneralLocation.VISIBLE_CENTER);
this(null, null);
}

public RNClickAction(CoordinatesProvider coordinatesProvider) {
this(coordinatesProvider, null);
}

public RNClickAction(CoordinatesProvider coordinatesProvider, Long duration) {
coordinatesProvider = coordinatesProvider != null ? coordinatesProvider : GeneralLocation.VISIBLE_CENTER;

clickAction = new GeneralClickAction(
new DetoxSingleTap(duration),
coordinatesProvider,
Expand Down

0 comments on commit 5f6ac60

Please sign in to comment.