Skip to content

Commit 37b5108

Browse files
author
hyb1996
committed
Dying again
1 parent 5a0095f commit 37b5108

File tree

51 files changed

+565
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+565
-142
lines changed

app/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "com.stardust.scriptdroid"
99
minSdkVersion 19
1010
targetSdkVersion 23
11-
versionCode 118
12-
versionName "2.0.8Alpha"
11+
versionCode 119
12+
versionName "2.0.8 Beta"
1313
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1414
multiDexEnabled true
1515
}
@@ -68,14 +68,13 @@ dependencies {
6868
compile group: "pl.openrnd.android", name: "multi-level-listview", version: "1.0.1"
6969
compile 'de.psdev.licensesdialog:licensesdialog:1.8.1'
7070
compile 'io.mattcarroll.hover:hover:0.9.7'
71-
compile 'org.greenrobot:eventbus:3.0.0'
7271
compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'
7372
compile 'com.ashokvarma.android:bottom-navigation-bar:1.4.1'
7473
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
7574
compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
7675
compile group:'com.twofortyfouram', name:'android-plugin-client-sdk-for-locale', version:'[4.0.2, 5.0['
7776
compile 'com.android.volley:volley:1.0.0'
78-
compile 'com.github.hyb1996:EnhancedFloaty:0.11'
77+
compile 'com.github.hyb1996:EnhancedFloaty:0.12'
7978
compile 'com.android.support:multidex:1.0.1'
8079
compile(name: 'libtermexec-release', ext: 'aar')
8180
compile(name: 'emulatorview-release', ext: 'aar')

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
android:theme="@style/IssueReporterTheme"/>
8585

8686
<service android:name="com.stardust.view.Floaty$FloatHeadService"/>
87-
<service android:name="com.stardust.scriptdroid.external.floating_window.HoverMenuService"/>
87+
<service android:name="com.stardust.scriptdroid.external.floating_window.menu.HoverMenuService"/>
8888

8989
<activity android:name=".external.tasker.TaskPrefEditActivity"/>
9090

app/src/main/assets/help/catalogue.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"path":"documentation"
4141
},
4242
{
43-
"title": "驻留模式与无障碍服务委托",
43+
"title": "模块与第三方jar",
4444
"type": "markdown",
4545
"path":"documentation"
4646
},
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### loadJar(path)
2+
* path \<String\> jar文件路径
3+
4+
载入jar文件。之后改文件的所有类均可直接使用。这在使用第三方库时十分方便。
5+
6+
### require(path)
7+
* path \<String\> js文件的相对路径
8+
9+
载入js文件并返回该模块。模块文件应该有module.exports语句指定模块的输出对象。
10+
11+
例如test.js:
12+
```
13+
function sayHello(name){
14+
print("Hello, " + name);
15+
}
16+
module.exports = sayHello;
17+
```
18+
同一个目录下的test_module.js:
19+
```
20+
var sayHello = require("test");
21+
sayHello("AutoJs");
22+
```
23+
运行这个脚本将在控制台输出"Hello, AutoJs"

app/src/main/assets/modules/ui.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,34 @@ gravity
1414
weight
1515

1616

17+
var ui = {
18+
19+
};
20+
21+
ui.layout = function(xml){
22+
23+
}
24+
25+
26+
1727
ui.layout(
18-
<linear orientation="vertical" w="fill" h="300" bg="#ff0000" gravity="center">
19-
<text text="测试" size="18" color="#000000"/>
28+
<linear orientation="vertical" w="fill" h="300" bg="#ff0000" gravity="center" layout_gravity="center">
29+
<text text="测试" size="18" color="#000000" id="adasd"/>
2030
<button id="btn" text="按钮"/>
2131
</linear>
2232
);
2333

34+
35+
36+
vat text = ui.asadsad;
37+
2438
<relative>
2539

2640
</relative>
2741

2842
<horizon>
2943

30-
</horiz>
44+
</horizon>
3145

3246
<vertical>
3347

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
log("Hello world!!!");
2+
toast("Hello, AutoJs!");
23
openConsole();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//文件路径
2+
var path = "/sdcard/1.txt";
3+
//要写入的文件内容
4+
var text = "Hello, AutoJs";
5+
//以写入模式打开文件
6+
var file = open(path, "w");
7+
//写入文件
8+
file.write(text);
9+
//关闭文件
10+
file.close();
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
3+
convert("/sdcard/1.txt", "utf-8", "/sdcard/2.txt", "gbk");
4+
5+
/**
6+
* fromFile: 源文件路径
7+
* fromEncoding: 源文件编码
8+
* toFile: 输出文件路径
9+
* toEncoding: 输出文件编码
10+
*/
11+
function convert(fromFile, fromEncoding, toFile, toEncoding){
12+
fromFile = open(fromFile, "r", fromEncoding);
13+
toFile = open(toFile, "w", toEncoding);
14+
while(true){
15+
var line = fromFile.readline();
16+
if(!line)
17+
break;
18+
toFile.writeline(line);
19+
}
20+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//以UTF-8编码打开SD卡上的1.txt文件
2+
var in = open("/sdcard/1.txt", "r", "utf-8");
3+
//读取文件所有内容
4+
var text = in.read();
5+
//关闭文件
6+
in.close();
7+
//以gbk编码打开SD卡上的2.txt文件
8+
var out = open("/sdcard/2.txt", "w", "gbk");
9+
//写入内容
10+
out.write(text);
11+
//关闭文件
12+
out.close();
13+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//以写入模式打开SD卡根目录文件1.txt
2+
var file = open("/sdcard/1.txt", "w")
3+
//写入aaaa
4+
file.write("aaaa");
5+
//写入bbbbb后换行
6+
file.writeline("bbbbb");
7+
//写入ccc与ddd两行
8+
file.writelines(["ccc", "ddd"]);
9+
//关闭文件
10+
file.close();
11+
12+
//以附加模式打开文件
13+
file = open("/sdcard/1.txt", "a");
14+
//附加一行"啦啦啦啦"
15+
file.writeline("啦啦啦啦");
16+
//附加一行"哈哈哈哈"
17+
file.writeline("哈哈哈哈");
18+
//附加两行ccc, ddd
19+
file.writelines(["ccc", "ddd"]);
20+
//输出缓冲区
21+
file.flush();
22+
//关闭文件
23+
file.close();
24+
25+
26+
//以读取模式打开文件
27+
file = open("/sdcard/test.txt", "r")
28+
//读取一行并打印
29+
print(file.readline());
30+
//读取剩余所有行并打印
31+
for each(line in file.readlines()){
32+
print(line)
33+
}
34+
file.close()
35+
36+
//显示控制台
37+
console.show()

0 commit comments

Comments
 (0)