add new APIs

This commit is contained in:
Evgeny
2022-07-30 15:05:55 +03:00
parent 130e85f946
commit 1a8e864e59
3 changed files with 61 additions and 4 deletions

View File

@@ -0,0 +1,43 @@
function on_resume()
ui:show_lines{
"List dialog",
"List dialog without search",
"List dialog without zebra",
"List dialog with splitted strings",
}
end
function on_click(idx)
if idx == 1 then
ui:show_list_dialog{
title = "Title",
lines = { "First line", "Second line", "Third line" },
}
elseif idx == 2 then
ui:show_list_dialog{
title = "Title",
lines = { "First line", "Second line", "Third line" },
search = false,
}
elseif idx == 3 then
ui:show_list_dialog{
title = "Title",
lines = { "First line", "Second line", "Third line" },
zebra = false,
}
elseif idx == 4 then
ui:show_list_dialog{
title = "Title",
lines = { "First|line", "Second|line", "Third line" },
split_symbol = "|",
}
end
end
function on_dialog_action(idx)
if idx < 0 then
ui:show_toast("Dialog closed")
else
ui:show_toast("Clicked element: "..idx)
end
end

View File

@@ -5,5 +5,6 @@ function on_resume()
{ "7", "8", "9" },
}
ui:show_table(tab, 0, true)
local folded = { "-1", "-2", "-3" }
ui:show_table(tab, 0, true, folded)
end