add ui:editDialog

This commit is contained in:
Evgeny
2021-07-30 18:51:37 +03:00
parent 56911fe1a4
commit 46407b5e78
3 changed files with 45 additions and 5 deletions

View File

@@ -1,5 +1,9 @@
function onResume()
ui:showLines({ "Click to open dialog", "Click to open dialog with custom buttons" })
ui:showLines({
"Click to open dialog",
"Click to open dialog with custom buttons",
"Click to open edit dialog",
})
end
function onClick(idx)
@@ -7,13 +11,17 @@ function onClick(idx)
ui:showDialog("Dialog title", "This is dialog")
elseif idx == 2 then
ui:showDialog("Dialog title", "This is dialog", "Button 1", "Button 2")
elseif idx == 3 then
ui:showEditDialog("Dialog title", "Write any text", "default text")
end
end
function onDialogClick(idx)
if idx == 1 then
function onDialogAction(value)
if value == 1 then
ui:showToast("Button 1 clicked!")
elseif idx == 2 then
elseif value == 2 then
ui:showToast("Button 2 clicked!")
elseif type(value) == "string" then
ui:showToast("Text: "..value)
end
end