Add: tasker plugin support, injectable webview
This commit is contained in:
@@ -50,5 +50,24 @@ while(!click("扫一扫"));
|
||||
返回是否输入成功。当找不到对应的文本框时返回false。
|
||||
这里的输入文本的意思是,把输入框的文本置为text,而不是在原来的文本上追加。
|
||||
不加参数i则会把所有输入框的文本都置为text。例如`input("测试")`。
|
||||
### input(i, text)
|
||||
把第i + 1个输入框的文本设为text。
|
||||
|
||||
### back()
|
||||
模拟按下返回键
|
||||
|
||||
### home()
|
||||
模拟按下Home键
|
||||
|
||||
### powerDialog()
|
||||
弹出电源键菜单
|
||||
|
||||
### notifications()
|
||||
弹出通知栏
|
||||
|
||||
### quickSettings()
|
||||
显示快速设置(下拉通知栏到底)
|
||||
|
||||
### recents()
|
||||
显示最近任务
|
||||
|
||||
### splitScreen()
|
||||
分屏
|
||||
|
||||
@@ -30,6 +30,37 @@ var launchApp = function(appName){
|
||||
droid.launchApp(appName);
|
||||
}
|
||||
|
||||
var __this__ = this;
|
||||
|
||||
var back = function(){
|
||||
return droid.back();
|
||||
}
|
||||
|
||||
var home = function(){
|
||||
return droid.home();
|
||||
}
|
||||
|
||||
var powerDialog = function(){
|
||||
return droid.powerDialog();
|
||||
}
|
||||
|
||||
var notifications = function(){
|
||||
return droid.notifications();
|
||||
}
|
||||
|
||||
var quickSettings = function(){
|
||||
return droid.quickSettings();
|
||||
}
|
||||
|
||||
var recents = function(){
|
||||
return droid.recents();
|
||||
}
|
||||
|
||||
var splitScreen = function(){
|
||||
return droid.splitScreen();
|
||||
}
|
||||
|
||||
|
||||
function performAction(action, args){
|
||||
if(args.length == 4){
|
||||
return action(droid.bounds(args[0], args[1], args[2], args[3]));
|
||||
@@ -238,11 +269,19 @@ for(var x in __selector__){
|
||||
|
||||
}
|
||||
|
||||
var $ = function(){
|
||||
return droid.selector();
|
||||
var open = function(path, mode){
|
||||
return com.stardust.pio.PFile.open(path, mode);
|
||||
}
|
||||
|
||||
__importClassOld__(com.stardust.scriptdroid.droid.runtime.Shell);
|
||||
__importClassOld__(com.stardust.scriptdroid.droid.runtime.api.Shell);
|
||||
|
||||
var newInjectableWebClient = function(){
|
||||
return new com.stardust.scriptdroid.droid.runtime.api.InjectableWebClient(org.mozilla.javascript.Context.getCurrentContext(), __this__);
|
||||
}
|
||||
|
||||
var newInjectableWebView = function(activity){
|
||||
return new com.stardust.scriptdroid.droid.runtime.api.InjectableWebView(activity, org.mozilla.javascript.Context.getCurrentContext(), __this__);
|
||||
}
|
||||
|
||||
/*
|
||||
importClass("com.stardust.scriptdroid.service.AccessibilityDelegate");
|
||||
|
||||
42
app/src/main/assets/modules/ui.js
Normal file
42
app/src/main/assets/modules/ui.js
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
bg
|
||||
w
|
||||
h
|
||||
margin
|
||||
marginLeft
|
||||
margin*
|
||||
padding
|
||||
padding*
|
||||
layout_gravity="center"
|
||||
gravity
|
||||
|
||||
|
||||
weight
|
||||
|
||||
|
||||
ui.layout(
|
||||
<linear orientation="vertical" w="fill" h="300" bg="#ff0000" gravity="center">
|
||||
<text text="测试" size="18" color="#000000"/>
|
||||
<button id="btn" text="按钮"/>
|
||||
</linear>
|
||||
);
|
||||
|
||||
<relative>
|
||||
|
||||
</relative>
|
||||
|
||||
<horizon>
|
||||
|
||||
</horiz>
|
||||
|
||||
<vertical>
|
||||
|
||||
</vertical>
|
||||
|
||||
|
||||
function ui(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
module.exports = ui;
|
||||
6
app/src/main/assets/modules/web.js
Normal file
6
app/src/main/assets/modules/web.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
module.exports = {
|
||||
test: function(){
|
||||
return "test";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user