Add more tests
This commit is contained in:
21
samples/back_button_test.lua
Normal file
21
samples/back_button_test.lua
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
local names = { "Test", "Blah", "Works?", "Or not?" }
|
||||||
|
local colors = { "#FF5733", "#33FF57", "#3357FF", "#FF33A1" }
|
||||||
|
|
||||||
|
function on_resume()
|
||||||
|
ui:show_toast("Called!")
|
||||||
|
shuffle(names)
|
||||||
|
shuffle(colors)
|
||||||
|
ui:show_buttons(names, colors)
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_click(idx)
|
||||||
|
apps:launch("org.telegram.messenger")
|
||||||
|
end
|
||||||
|
|
||||||
|
function shuffle(t)
|
||||||
|
for i = #t, 2, -1 do
|
||||||
|
local j = math.random(1, i)
|
||||||
|
t[i], t[j] = t[j], t[i]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@@ -2,5 +2,5 @@ local i = 0
|
|||||||
|
|
||||||
function on_resume()
|
function on_resume()
|
||||||
i = i + 1
|
i = i + 1
|
||||||
ui:show_toast("on_resume called: "..i)
|
ui:show_text("on_resume called: "..i)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user