add new APIs
This commit is contained in:
6
samples/command-receiver-search.lua
Normal file
6
samples/command-receiver-search.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
-- name = "Command receiver"
|
||||
-- type = "search"
|
||||
|
||||
function on_command(value)
|
||||
search:show{value}
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
function on_resume()
|
||||
local location = system:get_location()
|
||||
local location = system:location()
|
||||
ui:show_text(location[1].." "..location[2])
|
||||
end
|
||||
|
||||
16
samples/location-widget2.lua
Normal file
16
samples/location-widget2.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
function on_resume()
|
||||
ui:show_text("Tap to request location")
|
||||
end
|
||||
|
||||
function on_click()
|
||||
system:request_location()
|
||||
ui:show_text("Loading...")
|
||||
end
|
||||
|
||||
function on_location_result(location)
|
||||
if location ~= nil then
|
||||
ui:show_text(location[1].." "..location[2])
|
||||
else
|
||||
ui:show_text("Error")
|
||||
end
|
||||
end
|
||||
@@ -1,8 +1,8 @@
|
||||
function on_resume()
|
||||
ui:show_lines{
|
||||
"send text",
|
||||
"send 123",
|
||||
"send table",
|
||||
"send text to msg-receiver.lua script",
|
||||
"send 123 to all",
|
||||
"send table to all",
|
||||
}
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ function on_click(idx)
|
||||
if idx == 1 then
|
||||
aio:send_message("text", "msg-receiver.lua")
|
||||
elseif idx == 2 then
|
||||
aio:send_message(1)
|
||||
aio:send_message(123)
|
||||
else
|
||||
aio:send_message{ "one", "two", "three" }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user