新增 支持ui的view对象增加属性,修改它的prototype为object

This commit is contained in:
hyb1996 2018-10-15 10:25:55 +08:00
parent 1094965eb1
commit a124c732b1

View File

@ -10,6 +10,7 @@ import com.stardust.autojs.core.ui.attribute.ViewAttributes;
import com.stardust.autojs.rhino.NativeJavaObjectWithPrototype;
import org.mozilla.javascript.NativeJavaObject;
import org.mozilla.javascript.NativeObject;
import org.mozilla.javascript.ScriptRuntime;
import org.mozilla.javascript.Scriptable;
@ -49,7 +50,8 @@ public class NativeView extends NativeJavaObjectWithPrototype {
mViewAttributes = ViewExtras.getViewAttributes(view, runtime.ui.getResourceParser());
mView = view;
mViewPrototype = new ViewPrototype(mView, mViewAttributes, scope, runtime);
prototype = new NativeJavaObject(scope, mViewPrototype, mViewPrototype.getClass());
prototype = new NativeJavaObjectWithPrototype(scope, mViewPrototype, mViewPrototype.getClass());
prototype.setPrototype(new NativeObject());
}
@Override