api(autojs): supports ui label toolbar, appbar, tabs, viewpager, drawer

This commit is contained in:
hyb1996
2018-05-31 01:38:36 +08:00
parent 22185346e8
commit debcb1d7b8
21 changed files with 354 additions and 13 deletions

View File

@@ -154,7 +154,6 @@ module.exports = function (runtime, global) {
return false;
},
beforeApplyAttribute: function (inflater, view, ns, attrName, value, parent, attrs) {
log("beforeApplyAttribute:", view, attrName, value);
var isDynamic = layoutInflater.isDynamicValue(value);
if ((isDynamic && layoutInflater.getInflateFlags() == layoutInflater.FLAG_IGNORES_DYNAMIC_ATTRS)
|| (!isDynamic && layoutInflater.getInflateFlags() == layoutInflater.FLAG_JUST_DYNAMIC_ATTRS)) {
@@ -197,9 +196,9 @@ module.exports = function (runtime, global) {
}
function decorate(view) {
var androidView = view;
var javaObject = view;
var view = global.events.__asEmitter__(Object.create(view));
view.__androidView__ = androidView;
view.__javaObject__ = javaObject;
if (view.getClass().getName() == "com.stardust.autojs.core.ui.widget.JsListView"
|| view.getClass().getName() == "com.stardust.autojs.core.ui.widget.JsGridView") {
view = decorateList(view);