From aa8b38b868f61ab7bc6574ff1d61278c33d4af53 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Sun, 31 Oct 2021 22:18:55 +0100 Subject: [PATCH 1/3] chore: Remove unused entities --- .../java_client/windows/PressesKeyCode.java | 66 ------------------- .../java_client/windows/WindowsKeyCode.java | 41 ------------ 2 files changed, 107 deletions(-) delete mode 100644 src/main/java/io/appium/java_client/windows/PressesKeyCode.java delete mode 100644 src/main/java/io/appium/java_client/windows/WindowsKeyCode.java diff --git a/src/main/java/io/appium/java_client/windows/PressesKeyCode.java b/src/main/java/io/appium/java_client/windows/PressesKeyCode.java deleted file mode 100644 index e6286d894..000000000 --- a/src/main/java/io/appium/java_client/windows/PressesKeyCode.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * See the NOTICE file distributed with this work for additional - * information regarding copyright ownership. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.appium.java_client.windows; - -import static io.appium.java_client.MobileCommand.longPressKeyCodeCommand; -import static io.appium.java_client.MobileCommand.pressKeyCodeCommand; - -import io.appium.java_client.CommandExecutionHelper; -import io.appium.java_client.ExecutesMethod; - -public interface PressesKeyCode extends ExecutesMethod { - - /** - * Send a key event to the device. - * - * @param key code for the key pressed on the device. - */ - default void pressKeyCode(int key) { - CommandExecutionHelper.execute(this, pressKeyCodeCommand(key)); - } - - /** - * Send a key event along with an Android metastate to an Android device. - * Metastates are things like *shift* to get uppercase characters. - * - * @param key code for the key pressed on the Android device. - * @param metastate metastate for the keypress. - */ - default void pressKeyCode(int key, Integer metastate) { - CommandExecutionHelper.execute(this, pressKeyCodeCommand(key, metastate)); - } - - /** - * Send a long key event to the device. - * - * @param key code for the key pressed on the device. - */ - default void longPressKeyCode(int key) { - CommandExecutionHelper.execute(this, longPressKeyCodeCommand(key)); - } - - /** - * Send a long key event along with an Android metastate to an Android device. - * Metastates are things like *shift* to get uppercase characters. - * - * @param key code for the key pressed on the Android device. - * @param metastate metastate for the keypress. - */ - default void longPressKeyCode(int key, Integer metastate) { - CommandExecutionHelper.execute(this, longPressKeyCodeCommand(key, metastate)); - } -} diff --git a/src/main/java/io/appium/java_client/windows/WindowsKeyCode.java b/src/main/java/io/appium/java_client/windows/WindowsKeyCode.java deleted file mode 100644 index c2968291f..000000000 --- a/src/main/java/io/appium/java_client/windows/WindowsKeyCode.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * See the NOTICE file distributed with this work for additional - * information regarding copyright ownership. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.appium.java_client.windows; - -/** - * Created by STikhomirov on 15.12.2016. - */ -public interface WindowsKeyCode { - int POWER = 0; - int WINDOWS = 1; - int VOLUME_UP = 2; - int VOLUME_DOWN = 3; - int ROTATION_LOCK = 4; - int COUNT_MIN = 5; - int BACK = 5; - int SEARCH = 6; - int CAMERA_FOCUS = 7; - int CAMERA_SHUTTER = 8; - int RINGER_TOGGLE = 9; - int HEAD_SET = 10; - int HWKB_DPLOY = 11; - int CAMERA_LENS = 12; - int OEM_CUSTOM = 13; - int OEM_CUSTOM2 = 14; - int OEM_CUSTOM3 = 15; - int COUNT = 16; -} From a9e3338e3e2c18f27bbfe0fc23527f9939f17ae2 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Sun, 31 Oct 2021 22:29:17 +0100 Subject: [PATCH 2/3] Tune deprecation notices --- .../io/appium/java_client/MultiTouchAction.java | 10 ++++++++++ .../java_client/android/AndroidTouchAction.java | 16 ++++++++-------- .../appium/java_client/ios/IOSTouchAction.java | 16 ++++++++-------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/main/java/io/appium/java_client/MultiTouchAction.java b/src/main/java/io/appium/java_client/MultiTouchAction.java index c7bdd6525..ac66594dc 100644 --- a/src/main/java/io/appium/java_client/MultiTouchAction.java +++ b/src/main/java/io/appium/java_client/MultiTouchAction.java @@ -41,7 +41,17 @@ * "execution group", so these can be used to sync up complex actions. * Calling perform() sends the action command to the Mobile Driver. Otherwise, more and * more actions can be chained. + * + * @deprecated Touch actions are deprecated. + * Please use W3C Actions instead or the corresponding + * extension methods for the driver (if available). + * Check + * - https://www.youtube.com/watch?v=oAJ7jwMNFVU + * - https://appiumpro.com/editions/30-ios-specific-touch-action-methods + * - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api + * for more details. */ +@Deprecated public class MultiTouchAction implements PerformsActions { private ImmutableList.Builder actions; diff --git a/src/main/java/io/appium/java_client/android/AndroidTouchAction.java b/src/main/java/io/appium/java_client/android/AndroidTouchAction.java index 20c02a6ca..886935896 100644 --- a/src/main/java/io/appium/java_client/android/AndroidTouchAction.java +++ b/src/main/java/io/appium/java_client/android/AndroidTouchAction.java @@ -21,14 +21,14 @@ /** - * Touch actions are deprecated. - * Please use W3C Actions instead or the corresponding - * extension methods for the driver (if available). - * Check - * - https://www.youtube.com/watch?v=oAJ7jwMNFVU - * - https://appiumpro.com/editions/30-ios-specific-touch-action-methods - * - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api - * for more details. + * @deprecated Touch actions are deprecated. + * Please use W3C Actions instead or the corresponding + * extension methods for the driver (if available). + * Check + * - https://www.youtube.com/watch?v=oAJ7jwMNFVU + * - https://appiumpro.com/editions/30-ios-specific-touch-action-methods + * - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api + * for more details. */ @Deprecated public class AndroidTouchAction extends TouchAction { diff --git a/src/main/java/io/appium/java_client/ios/IOSTouchAction.java b/src/main/java/io/appium/java_client/ios/IOSTouchAction.java index ce6180752..80c4c505c 100644 --- a/src/main/java/io/appium/java_client/ios/IOSTouchAction.java +++ b/src/main/java/io/appium/java_client/ios/IOSTouchAction.java @@ -23,14 +23,14 @@ import io.appium.java_client.touch.offset.PointOption; /** - * Touch actions are deprecated. - * Please use W3C Actions instead or the corresponding - * extension methods for the driver (if available). - * Check - * - https://www.youtube.com/watch?v=oAJ7jwMNFVU - * - https://appiumpro.com/editions/30-ios-specific-touch-action-methods - * - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api - * for more details. + * @deprecated Touch actions are deprecated. + * Please use W3C Actions instead or the corresponding + * extension methods for the driver (if available). + * Check + * - https://www.youtube.com/watch?v=oAJ7jwMNFVU + * - https://appiumpro.com/editions/30-ios-specific-touch-action-methods + * - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api + * for more details. */ @Deprecated public class IOSTouchAction extends TouchAction { From 5ef64b01bc37324964ac5119221a028081c120b6 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Sun, 31 Oct 2021 22:41:30 +0100 Subject: [PATCH 3/3] Add summary --- .../java/io/appium/java_client/android/AndroidTouchAction.java | 2 ++ src/main/java/io/appium/java_client/ios/IOSTouchAction.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/io/appium/java_client/android/AndroidTouchAction.java b/src/main/java/io/appium/java_client/android/AndroidTouchAction.java index 886935896..0fa31cffa 100644 --- a/src/main/java/io/appium/java_client/android/AndroidTouchAction.java +++ b/src/main/java/io/appium/java_client/android/AndroidTouchAction.java @@ -21,6 +21,8 @@ /** + * Android-specific touch action. + * * @deprecated Touch actions are deprecated. * Please use W3C Actions instead or the corresponding * extension methods for the driver (if available). diff --git a/src/main/java/io/appium/java_client/ios/IOSTouchAction.java b/src/main/java/io/appium/java_client/ios/IOSTouchAction.java index 80c4c505c..01a98f9e5 100644 --- a/src/main/java/io/appium/java_client/ios/IOSTouchAction.java +++ b/src/main/java/io/appium/java_client/ios/IOSTouchAction.java @@ -23,6 +23,8 @@ import io.appium.java_client.touch.offset.PointOption; /** + * iOS-specific touch action. + * * @deprecated Touch actions are deprecated. * Please use W3C Actions instead or the corresponding * extension methods for the driver (if available).