
org.robolectric.shadows.ShadowVirtualKeyboard Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shadows-framework Show documentation
Show all versions of shadows-framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import android.hardware.input.VirtualKeyEvent;
import android.hardware.input.VirtualKeyboard;
import android.os.Build.VERSION_CODES;
import java.util.ArrayList;
import java.util.List;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
/** Shadow for VirtualKeyboard. */
@Implements(value = VirtualKeyboard.class, minSdk = VERSION_CODES.TIRAMISU, isInAndroidSdk = false)
public class ShadowVirtualKeyboard extends ShadowVirtualInputDevice {
private final List sentEvents = new ArrayList<>();
@Implementation
protected void sendKeyEvent(VirtualKeyEvent event) {
sentEvents.add(event);
}
public List getSentEvents() {
return sentEvents;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy