本文整理汇总了Java中com.android.chimpchat.core.TouchPressType.fromIdentifier方法的典型用法代码示例。如果您正苦于以下问题:Java TouchPressType.fromIdentifier方法的具体用法?Java TouchPressType.fromIdentifier怎么用?Java TouchPressType.fromIdentifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.chimpchat.core.TouchPressType
的用法示例。
在下文中一共展示了TouchPressType.fromIdentifier方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: press
import com.android.chimpchat.core.TouchPressType; //导入方法依赖的package包/类
@MonkeyRunnerExported(doc = "Send a key event to the specified key",
args = { "name", "type" },
argDocs = { "the keycode of the key to press (see android.view.KeyEvent)",
"touch event type as returned by TouchPressType(). To simulate typing a key, " +
"send DOWN_AND_UP"})
public void press(String name, String touchType) {
// The old docs had this string, and so in favor of maintaining
// backwards compatibility, let's special case it to the new one.
if (touchType.equals("DOWN_AND_UP")){
touchType = "downAndUp";
}
TouchPressType type = TouchPressType.fromIdentifier(touchType);
if (type == null) {
LOG.warning(String.format("Invalid TouchPressType specified (%s) default used instead",
touchType));
type = TouchPressType.DOWN_AND_UP;
}
impl.press(name, type);
}
示例2: deserializeCommand
import com.android.chimpchat.core.TouchPressType; //导入方法依赖的package包/类
public boolean deserializeCommand(String data) {
String[] tokens =
data.split(TestDemultiplexerConstants.SERIAL_SEPARATOR);
if (tokens.length != NUM_SERIAL_TOKENS) {
return false;
} else if (!tokens[0].equals(SERIALIZED_KEY)) {
return false;
}
if (tokens[1].equals("null")) {
button = null;
} else {
button = PhysicalButton.valueOf(tokens[1]);
}
buttonName = tokens[2];
if (buttonName.equals("null")) {
buttonName = null;
}
touchType = TouchPressType.fromIdentifier(tokens[3]);
return true;
}
示例3: deserializeCommand
import com.android.chimpchat.core.TouchPressType; //导入方法依赖的package包/类
public boolean deserializeCommand(String data) {
String[] tokens =
data.split(TestDemultiplexerConstants.SERIAL_SEPARATOR);
if (tokens.length != NUM_SERIAL_TOKENS) {
return false;
} else if (!tokens[0].equals(SERIALIZED_KEY)) {
return false;
}
xScale = Float.valueOf(tokens[1]);
yScale = Float.valueOf(tokens[2]);
pressType = TouchPressType.fromIdentifier(tokens[3]);
uniqueUiAutomationId = tokens[4];
if (uniqueUiAutomationId.equals(NULL_STRING)) {
uniqueUiAutomationId = null;
}
return true;
}
示例4: touch
import com.android.chimpchat.core.TouchPressType; //导入方法依赖的package包/类
public void touch(int x, int y, String typeStr) {
TouchPressType type = TouchPressType.fromIdentifier(typeStr);
if (type == null)
type = TouchPressType.DOWN_AND_UP;
impl.touch(x, y, type);
}
示例5: touch
import com.android.chimpchat.core.TouchPressType; //导入方法依赖的package包/类
public void touch(int x, int y, String typestr) {
TouchPressType type = TouchPressType.fromIdentifier(typestr);
if (type == null)
type = TouchPressType.DOWN_AND_UP;
impl.touch(x, y, type);
}
示例6: press
import com.android.chimpchat.core.TouchPressType; //导入方法依赖的package包/类
public void press(String name, String typestr) {
TouchPressType type = TouchPressType.fromIdentifier(typestr);
if (type == null)
type = TouchPressType.DOWN_AND_UP;
impl.press(name, type);
}