index: update all.json

This commit is contained in:
hyb1996
2018-02-04 11:23:03 +08:00
parent 399cb29dd5
commit 3b398ec732
5 changed files with 108 additions and 10 deletions

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.stardust.scriptdroid" applicationId "com.stardust.scriptdroid"
minSdkVersion 17 minSdkVersion 17
targetSdkVersion 23 targetSdkVersion 23
versionCode 247 versionCode 248
versionName "3.0.0 Alpha47" versionName "3.0.0 Beta2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true
ndk { ndk {
@@ -39,7 +39,7 @@ android {
} }
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
outputFileName = "${variant.name}-${variant.versionName}-${variant.flavorName}.apk" outputFileName = "${variant.name}-${variant.versionName}.apk"
} }
} }

View File

@@ -1,4 +1,83 @@
[ [
{
"name": "globals",
"url": "globals.html",
"summary": "全局函数",
"properties": [
{
"key": "sleep",
"url": "globals.html#globals_sleep_n",
"summary": "暂停运行",
"global": true
},
{
"key": "currentPackage",
"url": "globals.html#globals_currentpackage",
"summary": "当前包名",
"global": true
},
{
"key": "currentActivity",
"url": "globals.html#globals_currentactivity",
"summary": "当前活动",
"global": true
},
{
"key": "setClip",
"url": "globals.html#globals_setclip_text",
"summary": "设置剪贴板",
"global": true
},
{
"key": "getClip",
"url": "globals.html#globals_getclip",
"summary": "获取剪贴板",
"global": true
},
{
"key": "toast",
"url": "globals.html#globals_toast_message",
"summary": "气泡提示",
"global": true
},
{
"key": "toastLog",
"url": "globals.html#globals_toastlog_messagep",
"summary": "提示&打印",
"global": true
},
{
"key": "waitForActivity",
"url": "globals.html#globals_waitforactivity_activity_period_200",
"summary": "等待活动",
"global": true
},
{
"key": "waitForPackage",
"url": "globals.html#globals_waitforpackage_package_period_200",
"summary": "等待包名",
"global": true
},{
"key": "exit",
"url": "globals.html#globals_exit",
"summary": "退出",
"global": true
},
{
"key": "random",
"url": "globals.html#globals_random_min_max",
"summary": "随机数",
"global": true
},
{
"key": "context",
"url": "globals.html#globals_context",
"summary": "",
"global": true,
"variable": true
}
]
},
{ {
"name": "app", "name": "app",
"url": "app.html", "url": "app.html",
@@ -190,7 +269,8 @@
{ {
"key": "log", "key": "log",
"url": "console.html#console_console_log_data_args", "url": "console.html#console_console_log_data_args",
"summary": "打印日志" "summary": "打印日志",
"global": true
}, },
{ {
"key": "warn", "key": "warn",

View File

@@ -51,7 +51,8 @@ public class AutoCompletion {
private void buildDictionaryTree(List<Module> modules) { private void buildDictionaryTree(List<Module> modules) {
for (Module module : modules) { for (Module module : modules) {
mGlobalPropertyTree.putWord(module.getName(), module.asGlobalProperty()); if (!module.getName().equals("globals"))
mGlobalPropertyTree.putWord(module.getName(), module.asGlobalProperty());
for (Property property : module.getProperties()) { for (Property property : module.getProperties()) {
if (property.isGlobal()) if (property.isGlobal())
mGlobalPropertyTree.putWord(property.getKey(), property); mGlobalPropertyTree.putWord(property.getKey(), property);

View File

@@ -20,6 +20,9 @@ public class Property {
@SerializedName("global") @SerializedName("global")
private boolean mGlobal; private boolean mGlobal;
@SerializedName("variable")
private boolean mVariable = false;
public Property() { public Property() {
} }
@@ -61,4 +64,12 @@ public class Property {
public void setGlobal(boolean global) { public void setGlobal(boolean global) {
mGlobal = global; mGlobal = global;
} }
public boolean isVariable() {
return mVariable;
}
public void setVariable(boolean variable) {
mVariable = variable;
}
} }

View File

@@ -428,12 +428,18 @@ public class EditorView extends FrameLayout implements CodeCompletionBar.OnHintC
@Override @Override
public void onPropertyClick(Module m, Property property) { public void onPropertyClick(Module m, Property property) {
if (property.isGlobal()) { String p = property.getKey();
mEditor.insert(property.getKey() + "()"); if (!property.isVariable()) {
} else { p = p + "()";
mEditor.insert(m.getName() + "." + property.getKey() + "()"); }
if (property.isGlobal()) {
mEditor.insert(p);
} else {
mEditor.insert(m.getName() + "." + p);
}
if (!property.isVariable()) {
mEditor.moveCursor(0, -1);
} }
mEditor.moveCursor(0, -1);
mFunctionsKeyboardHelper.hideFunctionsLayout(true); mFunctionsKeyboardHelper.hideFunctionsLayout(true);
} }