Update Drawer Sample #4
This commit is contained in:
@@ -8,19 +8,10 @@ function on_drawer_open()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function on_icons_ready(icons)
|
function on_icons_ready(icons)
|
||||||
names = map(pkgs, function(it) return apps:name(it) end)
|
names = map(function(it) return apps:name(it) end, pkgs)
|
||||||
drawer:show_list(names, icons, nil, true)
|
drawer:show_list(names, icons, nil, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_click(idx)
|
function on_click(idx)
|
||||||
apps:launch(pkgs[idx])
|
apps:launch(pkgs[idx])
|
||||||
end
|
end
|
||||||
|
|
||||||
function map(tbl, f)
|
|
||||||
local ret = {}
|
|
||||||
for k,v in pairs(tbl) do
|
|
||||||
ret[k] = f(v)
|
|
||||||
end
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user