• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TouchPressType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.android.chimpchat.core.TouchPressType的典型用法代码示例。如果您正苦于以下问题:Java TouchPressType类的具体用法?Java TouchPressType怎么用?Java TouchPressType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TouchPressType类属于com.android.chimpchat.core包,在下文中一共展示了TouchPressType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: press

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
@Override
public void press(String keyName, TouchPressType type) {
    try {
        switch (type) {
            case DOWN_AND_UP:
                manager.press(keyName);
                break;
            case DOWN:
                manager.keyDown(keyName);
                break;
            case UP:
                manager.keyUp(keyName);
                break;
        }
    } catch (IOException e) {
        LOG.log(Level.SEVERE, "Error sending press event: " + keyName + " " + type, e);
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:19,代码来源:AdbChimpDevice.java


示例2: touch

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
@Override
public void touch(int x, int y, TouchPressType type) {
    try {
        switch (type) {
            case DOWN:
                manager.touchDown(x, y);
                break;
            case UP:
                manager.touchUp(x, y);
                break;
            case DOWN_AND_UP:
                manager.tap(x, y);
                break;
        }
    } catch (IOException e) {
        LOG.log(Level.SEVERE, "Error sending touch event: " + x + " " + y + " " + type, e);
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:19,代码来源:AdbChimpDevice.java


示例3: touch

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
/**
 * 
 * @param xRate
 * @param yRate
 * @param pressType
 */
private void touch(float xRate, float yRate, TouchPressType pressType) {
	Dimension screenSize = getScreenSize();

	int x = (int) (screenSize.width * xRate);
	int y = (int) (screenSize.height * yRate);

	if (pressType != null) {
		chimpDevice.touch(x, y, pressType);
	} else {
		try {
			chimpDevice.getManager().touchMove(x, y);
		} catch (IOException e) {
			// TODO: improve exception handling
			e.printStackTrace();
		}
	}
}
 
开发者ID:IPEldorado,项目名称:RemoteResources,代码行数:24,代码来源:AndroidDevice.java


示例4: sendEventToDevice

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
@Override
synchronized public void sendEventToDevice(String keyCode, KeyAction keyAction) {
    if (!isAlive()) {
        disconnect();
        connect();
        return;
    }

    switch (keyAction) {
        case UP:
            log("Key up:\t\t "+keyCode);
            device.press(keyCode, TouchPressType.UP);
            break;
        case DOWN:
            log("Key down:\t "+keyCode);
            device.press(keyCode, TouchPressType.DOWN);
            break;
    }
    if (!isAlive()) {
        disconnect();
        connect();
    }
}
 
开发者ID:ckesc,项目名称:AdbKeyMonkey,代码行数:24,代码来源:MonkeyDeviceConnection.java


示例5: sendTextToDevice

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
@Override
synchronized public void sendTextToDevice(String text, KeyAction keyAction) {
    if (!isAlive()) {
        disconnect();
        connect();
        return;
    }

    switch (keyAction) {
        case UP:
            device.press(text, TouchPressType.UP);
            break;
        case DOWN:
            device.press(text, TouchPressType.DOWN);
            break;
    }
    if (!isAlive()) {
        disconnect();
        connect();
    }

}
 
开发者ID:ckesc,项目名称:AdbKeyMonkey,代码行数:23,代码来源:MonkeyDeviceConnection.java


示例6: 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);
}
 
开发者ID:liuyq,项目名称:aster,代码行数:21,代码来源:MonkeyDeviceWrapper.java


示例7: 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;
}
 
开发者ID:eBay,项目名称:mtdtool,代码行数:27,代码来源:PressCommand.java


示例8: 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;
}
 
开发者ID:eBay,项目名称:mtdtool,代码行数:23,代码来源:TouchCommand.java


示例9: keyUp

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
/**
 * 
 * @param key
 */
public void keyUp(Keys key) {
	if (key == Keys.POWER) {
		chimpDevice.wake();
	}

	pressKey(key.toString(), TouchPressType.UP);
}
 
开发者ID:IPEldorado,项目名称:RemoteResources,代码行数:12,代码来源:AndroidDevice.java


示例10: execute

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
public void execute(TestDevice device) {

		// Try first by installing ToggleAirplaneMode.apk if not already 
		// installed.
		// Then run ToggleAirplaneMode to change the airplane mode setting.
		String result = device.getIChimpDevice().shell(
				"pm path com.ebay.toggleairplanemode");
		
		if (result.equals("")) {
			device.getIChimpDevice().installPackage("ToggleAirplaneMode.apk");
		}
		
		device.getIChimpDevice().startActivity(
				null, 
				null, 
				null, 
				null, 
				new ArrayList<String>(), 
				new HashMap<String, Object>(), 
				"com.ebay.toggleairplanemode/.ToggleAirplaneModeActivity", 
				0);
		
		// Wait for the activity to launch.
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		device.getIChimpDevice().press("KEYCODE_BACK", TouchPressType.DOWN_AND_UP);
	}
 
开发者ID:eBay,项目名称:mtdtool,代码行数:33,代码来源:ToggleAirplaneModeCommand.java


示例11: PressCommand

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
/**
 * Create a new Press command.
 * @param button Physical button to press.
 * @param touchType Type of button press.
 */
public PressCommand(PhysicalButton button, TouchPressType touchType) {
	
	this.button = button;
	this.buttonName = null;
	this.touchType = touchType;
}
 
开发者ID:eBay,项目名称:mtdtool,代码行数:12,代码来源:PressCommand.java


示例12: execute

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
public void execute(TestDevice device) {

		// Try first by installing DeviceUnlock.apk if not already installed.
		// Then run DeviceUnlock to unlock the device.
		// Then try unlocking any pin security. Expect pin to be 1234.
		String result = device.getIChimpDevice().shell(
				"pm path com.ebay.deviceunlock");
		
		if (result.equals("")) {
			device.getIChimpDevice().installPackage("DeviceUnlock.apk");
		}
		
		device.getIChimpDevice().startActivity(
				null, 
				null, 
				null, 
				null, 
				new ArrayList<String>(), 
				new HashMap<String, Object>(), 
				"com.ebay.deviceunlock/.MainActivity", 
				0);
		
		// Wait for the activity to launch.
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		device.getIChimpDevice().press("KEYCODE_BACK", TouchPressType.DOWN_AND_UP);
		device.getIChimpDevice().shell("input text 1234");
		device.getIChimpDevice().shell("input keyevent 66");
		
	}
 
开发者ID:eBay,项目名称:mtdtool,代码行数:36,代码来源:UnlockDeviceCommand.java


示例13: execute

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
@Override
public void execute(IChimpDevice device) {
	device.press(key, TouchPressType.fromIdentifier(downUpFlag));
}
 
开发者ID:Gogolook-Inc,项目名称:GogoMonkeyRun,代码行数:5,代码来源:AdvancePressAction.java


示例14: pressKey

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
/**
 * 
 * @param key
 * @param pressType
 */
private void pressKey(String key, TouchPressType pressType) {
	if (isOnline()) {
		chimpDevice.press(key, pressType);
	}
}
 
开发者ID:IPEldorado,项目名称:RemoteResources,代码行数:11,代码来源:AndroidDevice.java


示例15: 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);
}
 
开发者ID:liuyq,项目名称:aster,代码行数:7,代码来源:MonkeyDeviceWrapper.java


示例16: 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);
}
 
开发者ID:liuyq,项目名称:aster,代码行数:7,代码来源:WookieeAPI.java


示例17: 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);
}
 
开发者ID:liuyq,项目名称:aster,代码行数:7,代码来源:WookieeAPI.java


示例18: touch

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
public void touch(By selector, ControlHierarchy ch, TouchPressType type)
		throws UnsupportedEncodingException, IOException,
		RecognitionException {
	Point p = getElementCenter(selector, ch);
	_device.getImpl().touch(p.x, p.y, type);
}
 
开发者ID:shiyimin,项目名称:androidtestdebug,代码行数:7,代码来源:QueryableDevice.java


示例19: press

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
@Override
public void press(String arg0, TouchPressType arg1) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:oliver32767,项目名称:MonkeyBoard,代码行数:6,代码来源:DeviceController.java


示例20: touch

import com.android.chimpchat.core.TouchPressType; //导入依赖的package包/类
@Override
public void touch(int arg0, int arg1, TouchPressType arg2) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:oliver32767,项目名称:MonkeyBoard,代码行数:6,代码来源:DeviceController.java



注:本文中的com.android.chimpchat.core.TouchPressType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Message类代码示例发布时间:2022-05-22
下一篇:
Java DeleteDomainRequest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap