autojs ui界面漂亮模板

Posted 九黎AJ

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了autojs ui界面漂亮模板相关的知识,希望对你有一定的参考价值。

普通交流群698307198欢迎加入,和各位大神一同交流,更多模板,欢迎加入vip交流群

正文部分

"ui";

var color = "#009688";

ui.layout(
    <drawer id="drawer">
        <vertical>
            <appbar>
                <toolbar id="toolbar" />

            </appbar>
            <frame w="*" h="*">

                <vertical>
                    <card w="*" h="80" cardCornerRadius="10" gravity="center" marginTop="10">
                        <horizontal gravity="center">
                            <Switch id="autoService" text="无障碍服务" checked="{{auto.service != null}}" gravity="left" textSize="20sp" />
                            <Switch id="xfc" text="    打开悬浮窗" checked="{{(new android.provider.Settings).canDrawOverlays(context) != false}}" gravity="right" textSize="20sp" />
                        </horizontal>
                    </card>
                    <vertical gravity="center">
                        <card gravity="center" marginTop="10xp" w="auto" h="auto" cardCornerRadius="90" >
                            <vertical gravity="center" bg="#03A6EF">
                                <text text="功能选择" />
                            </vertical>
                        </card>
                    </vertical>
                    <card w="*" cardCornerRadius="10" gravity="center" marginTop="10">
                        <vertical>
                            <horizontal>
                                <text padding="10 0 0 0" text="关注滑动延迟:" />
                                <input id="sjS" text="3" w="50" />
                                <text text="至" />
                                <input id="sjE" text="4" w="50" />
                                <text text="秒" />
                            </horizontal>
                            <horizontal>
                                <text padding="10 0 0 0" text="关注每单延迟:" />
                                <input id="mdyc" text="3" w="50" />
                                <text text="秒" />
                            </horizontal>
                            <horizontal>
                                <text padding="10 0 0 0" text="总共关注" />
                                {/*     <input id="num" text="10" w="50"/> */}
                                <text text="次数:" />
                                <input id="yc" text="60" w="50" />
                                <text text="次" />
                            </horizontal>

                        </vertical>
                    </card>



                    <list id="todoList">
                        <card w="*" h="70" margin="10 5" cardCornerRadius="2dp"
                            cardElevation="1dp" foreground="?selectableItemBackground">
                            <horizontal gravity="center_vertical">
                                <View bg="{{this.color}}" h="*" w="10" />
                                <vertical padding="10 8" h="auto" w="0" layout_weight="1">
                                    <text id="title" text="{{this.title}}" textColor="#222222" textSize="16sp" maxLines="1" />
                                    <text text="{{this.summary}}" textColor="#999999" textSize="14sp" maxLines="1" />
                                </vertical>
                                <View bg="{{this.color}}" h="*" w="10" />
                            </horizontal>

                        </card>
                    </list>


                </vertical>

            </frame>
        </vertical>
        <vertical layout_gravity="left" bg="#ffffff" w="280">
            <img w="280" h="200" scaleType="fitXY" src="http://images.shejidaren.com/wp-content/uploads/2014/10/023746fki.jpg" />
            <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>
);
//alert("关于", "定制脚本加路金1263655864");

var s = storages.create("bixinzhushou")
//创建选项菜单(右上角)
ui.emitter.on("create_options_menu", menu => {
    menu.add("日志");
    menu.add("关于");
});
//监听选项菜单点击
ui.emitter.on("options_item_selected", (e, item) => {
    switch (item.getTitle()) {
        case "日志":
            app.startActivity("console");
            break;
        case "关于":
            alert("关于", "定制脚本找九黎q1906507927");
            break;
    }
    e.consumed = true;
});
activity.setSupportActionBar(ui.toolbar);
ui.menu.on("item_click", item => {
    switch (item.title) {
        case "退出":
            ui.finish();
            break;
    }
})
//两次才能返回
threads.start(function () {
    var isCanFinish = false;
    var isCanFinishTimeout;
    ui.emitter.on("back_pressed", e => {
        if (!isCanFinish) {
            isCanFinish = true;
            isCanFinishTimeout = setTimeout(() => {
                toastLog("再返回一次就失去我了哟![表情][表情]");
                isCanFinish = false;
            }, 500);
            e.consumed = true;
        } else {
            clearTimeout(isCanFinishTimeout);
            e.consumed = false;
        };
    });
    setInterval(() => { }, 1000)
});

参考文章

.

所属软件

声明

部分内容来自网络
本教程仅用于学习, 禁止用于其他用途

QQ群

698307198
扫一扫二维码,加入群聊.QQ

以上是关于autojs ui界面漂亮模板的主要内容,如果未能解决你的问题,请参考以下文章

autojs 漂亮ui界面4

autojs ui界面模板3

autojs 绝美ui模板5

Qt ui 界面如何更加好看,漂亮

autojs实现ui和逻辑分离,简化业务逻辑

autojs悬浮窗点击穿透