add new apis and samples

This commit is contained in:
Evgeny
2022-08-03 18:31:04 +03:00
parent a307e9c04c
commit 030facc285
6 changed files with 147 additions and 14 deletions

View File

@@ -1,11 +1,26 @@
function on_resume()
ui:show_buttons({ "Add clock widget", "Remove clock widget" })
ui:show_lines{
"Add clock widget",
"Add clock widget (position 1)",
"Add clock widget (position 5)",
"Remove clock widget",
"Swap first and third widgets",
"Swap back",
}
end
function on_click(idx)
if idx == 1 then
aio:add_widget("clock")
else
elseif idx == 2 then
aio:add_widget("clock", 1)
elseif idx == 3 then
aio:add_widget("clock", 5)
elseif idx == 4 then
aio:remove_widget("clock")
elseif idx == 5 then
aio:move_widget(1, 3)
elseif idx == 6 then
aio:move_widget(3, 1)
end
end