
org.robolectric.shadows.ShadowInputDevice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import android.view.InputDevice;
import org.robolectric.Shadows;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.shadow.api.Shadow;
@Implements(InputDevice.class)
public class ShadowInputDevice {
private String deviceName;
public static InputDevice makeInputDeviceNamed(String deviceName) {
InputDevice inputDevice = Shadow.newInstanceOf(InputDevice.class);
Shadows.shadowOf(inputDevice).setDeviceName(deviceName);
return inputDevice;
}
@Implementation
public String getName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy