Skip to content

Commit a41dca1

Browse files
Merge pull request #660 from TikhomirovSergey/depreceted-code-removak
5.0.0 finalization. Removal of obsolete code.
2 parents cf8eb85 + d28f27e commit a41dca1

29 files changed

+18
-1306
lines changed

src/main/java/io/appium/java_client/AppiumDriver.java

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
import org.openqa.selenium.By;
3333
import org.openqa.selenium.Capabilities;
3434
import org.openqa.selenium.DeviceRotation;
35-
import org.openqa.selenium.Dimension;
36-
import org.openqa.selenium.Point;
3735
import org.openqa.selenium.ScreenOrientation;
3836
import org.openqa.selenium.WebDriver;
3937
import org.openqa.selenium.WebDriverException;
@@ -208,131 +206,6 @@ public List<T> findElementsByXPath(String using) {
208206
return executeMethod;
209207
}
210208

211-
/**
212-
* This method is deprecated and it is going to be removed soon.
213-
*/
214-
@Deprecated
215-
public void tap(int fingers, WebElement element, int duration) {
216-
MultiTouchAction multiTouch = new MultiTouchAction(this);
217-
218-
for (int i = 0; i < fingers; i++) {
219-
TouchAction tap = new TouchAction(this);
220-
multiTouch.add(tap.press(element).waitAction(duration).release());
221-
}
222-
223-
multiTouch.perform();
224-
}
225-
226-
/**
227-
* This method is deprecated and it is going to be removed soon.
228-
*/
229-
@Deprecated
230-
public void tap(int fingers, int x, int y, int duration) {
231-
MultiTouchAction multiTouch = new MultiTouchAction(this);
232-
233-
for (int i = 0; i < fingers; i++) {
234-
TouchAction tap = new TouchAction(this);
235-
multiTouch.add(tap.press(x,y).waitAction(duration).release());
236-
}
237-
multiTouch.perform();
238-
}
239-
240-
/**
241-
* This method is deprecated. It is going to be removed
242-
*/
243-
@Deprecated
244-
public void swipe(int startx, int starty, int endx, int endy, int duration) {
245-
//does nothing
246-
}
247-
248-
/**
249-
* This method is deprecated and it is going to be removed soon.
250-
*/
251-
@Deprecated
252-
public void pinch(WebElement el) {
253-
MultiTouchAction multiTouch = new MultiTouchAction(this);
254-
255-
Dimension dimensions = el.getSize();
256-
Point upperLeft = el.getLocation();
257-
Point center = new Point(upperLeft.getX() + dimensions.getWidth() / 2,
258-
upperLeft.getY() + dimensions.getHeight() / 2);
259-
int yOffset = center.getY() - upperLeft.getY();
260-
261-
TouchAction action0 =
262-
new TouchAction(this).press(el, center.getX(), center.getY() - yOffset).moveTo(el)
263-
.release();
264-
TouchAction action1 =
265-
new TouchAction(this).press(el, center.getX(), center.getY() + yOffset).moveTo(el)
266-
.release();
267-
268-
multiTouch.add(action0).add(action1).perform();
269-
}
270-
271-
/**
272-
* This method is deprecated and it is going to be removed soon.
273-
*/
274-
@Deprecated
275-
public void pinch(int x, int y) {
276-
MultiTouchAction multiTouch = new MultiTouchAction(this);
277-
278-
int scrHeight = this.manage().window().getSize().getHeight();
279-
int yOffset = 100;
280-
281-
if (y - 100 < 0) {
282-
yOffset = y;
283-
} else if (y + 100 > scrHeight) {
284-
yOffset = scrHeight - y;
285-
}
286-
287-
TouchAction action0 = new TouchAction(this).press(x, y - yOffset).moveTo(x, y).release();
288-
TouchAction action1 = new TouchAction(this).press(x, y + yOffset).moveTo(x, y).release();
289-
290-
multiTouch.add(action0).add(action1).perform();
291-
}
292-
293-
/**
294-
* This method is deprecated and it is going to be removed soon.
295-
*/
296-
@Deprecated
297-
public void zoom(WebElement el) {
298-
MultiTouchAction multiTouch = new MultiTouchAction(this);
299-
300-
Dimension dimensions = el.getSize();
301-
Point upperLeft = el.getLocation();
302-
Point center = new Point(upperLeft.getX() + dimensions.getWidth() / 2,
303-
upperLeft.getY() + dimensions.getHeight() / 2);
304-
int yOffset = center.getY() - upperLeft.getY();
305-
306-
TouchAction action0 = new TouchAction(this).press(center.getX(), center.getY())
307-
.moveTo(el, center.getX(), center.getY() - yOffset).release();
308-
TouchAction action1 = new TouchAction(this).press(center.getX(), center.getY())
309-
.moveTo(el, center.getX(), center.getY() + yOffset).release();
310-
311-
multiTouch.add(action0).add(action1).perform();
312-
}
313-
314-
/**
315-
* This method is deprecated and it is going to be removed soon.
316-
*/
317-
@Deprecated
318-
public void zoom(int x, int y) {
319-
MultiTouchAction multiTouch = new MultiTouchAction(this);
320-
321-
int scrHeight = this.manage().window().getSize().getHeight();
322-
int yOffset = 100;
323-
324-
if (y - 100 < 0) {
325-
yOffset = y;
326-
} else if (y + 100 > scrHeight) {
327-
yOffset = scrHeight - y;
328-
}
329-
330-
TouchAction action0 = new TouchAction(this).press(x, y).moveTo(0, -yOffset).release();
331-
TouchAction action1 = new TouchAction(this).press(x, y).moveTo(0, yOffset).release();
332-
333-
multiTouch.add(action0).add(action1).perform();
334-
}
335-
336209
@Override public WebDriver context(String name) {
337210
checkNotNull(name, "Must supply a context name");
338211
execute(DriverCommand.SWITCH_TO_CONTEXT, ImmutableMap.of("name", name));

src/main/java/io/appium/java_client/AppiumSetting.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/main/java/io/appium/java_client/DefaultGenericMobileElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class DefaultGenericMobileElement<T extends WebElement> extends RemoteW
3939
implements FindsByClassName,
4040
FindsByCssSelector, FindsById,
4141
FindsByLinkText, FindsByName, FindsByTagName, FindsByXPath, FindsByFluentSelector<T>, FindsByAccessibilityId<T>,
42-
ExecutesMethod, TouchableElement<T> {
42+
ExecutesMethod {
4343

4444
@Override public Response execute(String driverCommand, Map<String, ?> parameters) {
4545
return super.execute(driverCommand, parameters);

src/main/java/io/appium/java_client/DeviceActionShortcuts.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/main/java/io/appium/java_client/InteractsWithApps.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,6 @@ default void resetApp() {
6565
execute(RESET);
6666
}
6767

68-
/**
69-
* Runs the current app as a background app for the number of seconds
70-
* requested. This is a synchronous method, it returns after the back has
71-
* been returned to the foreground.
72-
* This method is deprecated. Please use {@link #runAppInBackground(Duration)} instead.
73-
*
74-
* @param seconds Number of seconds to run App in background.
75-
*/
76-
@Deprecated
77-
default void runAppInBackground(int seconds) {
78-
runAppInBackground(Duration.ofSeconds(seconds));
79-
}
80-
8168
/**
8269
* Runs the current app as a background app for the time
8370
* requested. This is a synchronous method, it returns after the back has

src/main/java/io/appium/java_client/MobileCommand.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -331,20 +331,6 @@ public static ImmutableMap<String, Object> prepareArguments(String[] params,
331331
LONG_PRESS_KEY_CODE, prepareArguments(parameters, values));
332332
}
333333

334-
/**
335-
* This method forms a {@link java.util.Map} of parameters for the
336-
* device locking.
337-
* The method is deprecated. Please use {@link #lockDeviceCommand(Duration)} instead.
338-
*
339-
* @param seconds seconds number of seconds to lock the screen for
340-
* @return a key-value pair. The key is the command name. The value is a
341-
* {@link java.util.Map} command arguments.
342-
*/
343-
@Deprecated
344-
public static Map.Entry<String, Map<String, ?>> lockDeviceCommand(int seconds) {
345-
return lockDeviceCommand(Duration.ofSeconds(seconds));
346-
}
347-
348334
/**
349335
* This method forms a {@link java.util.Map} of parameters for the
350336
* device locking.

src/main/java/io/appium/java_client/MobileElement.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -42,47 +42,6 @@ public Point getCenter() {
4242
upperLeft.getY() + dimensions.getHeight() / 2);
4343
}
4444

45-
/**
46-
* This method is deprecated and it is going to be removed soon.
47-
*/
48-
@Deprecated
49-
@Override public void tap(int fingers, int duration) {
50-
AppiumDriver.class.cast(parent).tap(fingers, this, duration);
51-
}
52-
53-
/**
54-
* This method is deprecated and it is going to be removed soon.
55-
*/
56-
@Deprecated
57-
@Override public void pinch() {
58-
AppiumDriver.class.cast(parent).pinch(this);
59-
}
60-
61-
/**
62-
* This method is deprecated and it is going to be removed soon.
63-
*/
64-
@Deprecated
65-
@Override public void zoom() {
66-
AppiumDriver.class.cast(parent).zoom(this);
67-
}
68-
69-
/**
70-
* This method does nothing. It is going to be removed.
71-
*/
72-
@Deprecated
73-
@Override public void swipe(SwipeElementDirection direction, int duration) {
74-
direction.swipe(AppiumDriver.class.cast(parent), this, 0, 0, duration);
75-
}
76-
77-
/**
78-
* This method does nothing. It is going to be removed.
79-
*/
80-
@Deprecated
81-
@Override public void swipe(SwipeElementDirection direction, int offsetFromStartBorder,
82-
int offsetFromEndBorder, int duration) throws IllegalCoordinatesException {
83-
direction.swipe(AppiumDriver.class.cast(parent), this, offsetFromStartBorder, offsetFromEndBorder, duration);
84-
}
85-
8645
@Override public List<MobileElement> findElements(By by) {
8746
return super.findElements(by);
8847
}

0 commit comments

Comments
 (0)