auto.js-ui 프로젝트 설정 저장

11712 단어 autojs
"ui";
ui.layout(
    <vertical padding="28">
        <ScrollView>
            <vertical>
                <input id="name1" hint="1" />
                <input id="name2" hint="2" />
                <input id="name3" hint="3" />
                <input id="name4" hint="4" />
                <input id="name10" hint="10" />
                <button id="ok" text=" " />
            </vertical></ScrollView></vertical>);
var storage = storages.create(" ");
for (i = 0; i < 4; i++) {
    var content = storage.get("name" + (i + 1));
    
    if (content) {
        ui["name" + (i + 1)].setText(content);
    }
}

// 
ui.ok.click(function () {
    arr = new Array();
    for (i = 0; i < 4; i++) {
        var content = ui["name" + (i + 1)].getText() + "";
        storage.put("name" + (i + 1), content);
        arr.push(content);
    } log(arr);
});

"ui";
ui.layout(
    <vertical >
        <Switch id="is1"/>
    </vertical>
    )
        ui.is1.on("click", function() {
        if (ui.is1.isChecked()) {
            log(1)
            files.write("///sdcard/i.dat", "true")
        } else {
            files.write("///sdcard/i.dat", "false")
        }
    })
    if (files.read("///sdcard/i.dat") == "true") {
        ui.is1.setChecked(true)
    } else {
        ui.is1.setChecked(false)
    }

좋은 웹페이지 즐겨찾기