api: event click, long_click, touch_down and so on for view
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package com.stardust.autojs.core.eventloop;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
|
||||
import com.stardust.autojs.core.looper.Timer;
|
||||
@@ -110,10 +113,6 @@ public class EventEmitter {
|
||||
mBridges = bridges;
|
||||
}
|
||||
|
||||
protected void setTimer(Timer timer) {
|
||||
mTimer = timer;
|
||||
}
|
||||
|
||||
public EventEmitter once(String eventName, Object listener) {
|
||||
getListeners(eventName).add(listener, true);
|
||||
return this;
|
||||
|
||||
@@ -181,7 +181,7 @@ public class RhinoJavaScriptEngine extends JavaScriptEngine {
|
||||
|
||||
@Override
|
||||
protected void observeInstructionCount(Context cx, int instructionCount) {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
if (Thread.currentThread().isInterrupted() && Looper.myLooper() != Looper.getMainLooper()) {
|
||||
throw new ScriptInterruptedException();
|
||||
}
|
||||
}
|
||||
@@ -195,14 +195,6 @@ public class RhinoJavaScriptEngine extends JavaScriptEngine {
|
||||
|
||||
@Override
|
||||
protected Object doTopCall(Callable callable, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
try {
|
||||
return super.doTopCall(callable, cx, scope, thisObj, args);
|
||||
} catch (Exception e) {
|
||||
getRuntime().exit(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return super.doTopCall(callable, cx, scope, thisObj, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.stardust.autojs.runtime;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.stardust.autojs.R;
|
||||
import com.stardust.autojs.ScriptEngineService;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.stardust.autojs.runtime.api;
|
||||
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import com.stardust.autojs.ScriptEngineService;
|
||||
import com.stardust.autojs.engine.ScriptEngine;
|
||||
import com.stardust.autojs.execution.ExecutionConfig;
|
||||
|
||||
Reference in New Issue
Block a user