
org.robolectric.shadows.ShadowVirtualTouchscreen 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.VirtualTouchEvent;
import android.hardware.input.VirtualTouchscreen;
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 VirtualTouchscreen. */
@Implements(
value = VirtualTouchscreen.class,
minSdk = VERSION_CODES.TIRAMISU,
isInAndroidSdk = false)
public class ShadowVirtualTouchscreen extends ShadowVirtualInputDevice {
private final List sentEvents = new ArrayList<>();
@Implementation
protected void sendTouchEvent(VirtualTouchEvent event) {
sentEvents.add(event);
}
public List getSentEvents() {
return sentEvents;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy