add new APIs
This commit is contained in:
43
samples/list_dialog_sample.lua
Normal file
43
samples/list_dialog_sample.lua
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user