diff --git a/dpadrecyclerview-testing/src/main/java/com/rubensousa/dpadrecyclerview/testing/KeyEvents.kt b/dpadrecyclerview-testing/src/main/java/com/rubensousa/dpadrecyclerview/testing/KeyEvents.kt index 9d8bbc5e..2f8e09af 100644 --- a/dpadrecyclerview-testing/src/main/java/com/rubensousa/dpadrecyclerview/testing/KeyEvents.kt +++ b/dpadrecyclerview-testing/src/main/java/com/rubensousa/dpadrecyclerview/testing/KeyEvents.kt @@ -32,8 +32,10 @@ object KeyEvents { fun pressKey(key: Int, times: Int = 1, delay: Long = DEFAULT_KEY_PRESS_DELAY) { repeat(times) { device.pressKeyCode(key) - val actualDelay = max(25L, delay) - SystemClock.sleep(actualDelay) + if (times > 1) { + val actualDelay = max(25L, delay) + SystemClock.sleep(actualDelay) + } } }