"ui";

var color = "#009688";
ui.layout(
    <drawer id="drawer">
        <vertical h="*" w="*">
            <appbar>
                <toolbar id="toolbar" title="Intent生成器"/>
            </appbar>
            <frame id="body" h="*" w="*">
            </frame>
        </vertical>
        <vertical layout_gravity="left" bg="#ffffff" w="280">
            <list id="menu">
                <horizontal bg="?selectableItemBackground" w="*">
                    <img w="50" h="50" padding="16" src="{{this.icon}}" tint="{{color}}"/>
                    <text textColor="black" textSize="15sp" text="{{this.title}}" layout_gravity="center"/>
                </horizontal>
            </list>
        </vertical>
    </drawer>
);
        r.length = resolveList.size();
        for (i = 0; i < r.length; i++) {
            e = resolveList.get(i);
            plabel = pm.getApplicationLabel(e.activityInfo.applicationInfo);
            r[i] = {
                name: (e.labelRes != 0 ?
                    e.loadLabel(pm) :
                    e.activityInfo.labelRes != 0 ?
                    e.activityInfo.loadLabel(pm) :
                    plabel) + " (" + shortenName(e.activityInfo.name) + ")",
                packageName: e.activityInfo.packageName,
                className: e.activityInfo.name,
                packageLabel: plabel
            }
        }
        return r;
    },
    getMime: function() {
        var map = android.webkit.MimeTypeMap.getSingleton();
        return map.getMimeTypeFromExtension(map.getFileExtensionFromUrl(this.uri));
    },
    activate: function() {
        setContainer(this.ui);
        if (!this.inited) this.initUI();
        this.inited = true;
    }
}
aboutUi.activate();

 

发表回复

后才能评论