
com.xtremelabs.robolectric.shadows.ShadowInputDevice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of robolectric Show documentation
Show all versions of robolectric Show documentation
An alternative Android testing framework.
The newest version!
package com.xtremelabs.robolectric.shadows;
import android.view.InputDevice;
import com.xtremelabs.robolectric.Robolectric;
import com.xtremelabs.robolectric.internal.Implementation;
import com.xtremelabs.robolectric.internal.Implements;
import static com.xtremelabs.robolectric.Robolectric.shadowOf;
@Implements(InputDevice.class)
public class ShadowInputDevice {
private String deviceName;
public static InputDevice makeInputDeviceNamed(String deviceName) {
InputDevice inputDevice = Robolectric.newInstanceOf(InputDevice.class);
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