![JAR search and dependency download from the Maven repository](/logo.png)
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 shadows-core-v18 Show documentation
Show all versions of shadows-core-v18 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.internal.Shadow;
/**
* Shadow for {@link android.view.InputDevice}.
*/
@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