Move dev widgets to the dedicated folder

This commit is contained in:
Evgeny
2024-09-12 09:11:40 +03:00
parent d063132df2
commit 11a8cf2ad6
7 changed files with 70 additions and 1 deletions

View File

@@ -1,53 +0,0 @@
-- name = "Android widgets dumper"
-- Place app package name with widget here
app_pkg = "com.weather.Weather"
--app_pkg = "com.google.android.apps.tasks"
--app_pkg = "com.android.chrome"
--app_pkg = "com.whatsapp"
-- Globals
labels = {}
providers = {}
dump = ""
wid = -1
function on_resume()
local list = widgets:list(app_pkg)
if list == nil then
ui:show_text("Error: No widgets")
return
end
labels = map(function(it) return it.label end, list)
providers = map(function(it) return it.provider end, list)
w_content = ""
if wid < 0 then
ui:show_lines(labels)
else
widgets:request_updates(wid)
end
end
function on_click(idx)
if w_content == "" then
wid = widgets:setup(providers[idx])
widgets:request_updates(wid)
else
system:copy_to_clipboard(w_content)
end
end
function on_app_widget_updated(bridge)
local provider = bridge:provider()
local dump = bridge:dump_tree()
local colors = bridge:dump_colors()
w_content = provider.."\n\n"..dump.."\n\n"..serialize(colors)
ui:show_text("%%txt%%"..w_content)
debug:log("dump:\n\n"..w_content)
end

View File

@@ -1,22 +0,0 @@
local fmt = require "fmt"
function on_resume()
ui:show_lines{
fmt.bold("bold"),
fmt.italic("italic"),
fmt.underline("underline"),
fmt.primary("primary"),
fmt.secondary("secondary"),
fmt.red("red"),
fmt.green("green"),
fmt.blue("blue"),
fmt.colored("lime", "#00FF00"),
fmt.bg_colored(fmt.colored("lime background", "#000000"), "#00FF00"),
fmt.small("small font"),
fmt.big("big font"),
fmt.strike("The crossed out text"),
fmt.space().."start with space",
fmt.space(4).."start with tab",
fmt.escape("<b>not parsed</b>"),
}
end

View File

@@ -1,3 +0,0 @@
function on_resume()
ui:show_text("%%mkd%%".."**Bold**, `Code`, *Italic*")
end