update amdroid widget
This commit is contained in:
@@ -2,20 +2,20 @@
|
|||||||
-- description = "AIO wrapper for the Amdroid next alarm app widget"
|
-- description = "AIO wrapper for the Amdroid next alarm app widget"
|
||||||
-- type = "widget"
|
-- type = "widget"
|
||||||
-- author = "Theodor Galanis"
|
-- author = "Theodor Galanis"
|
||||||
-- version = "1.0"
|
-- version = "1.0.2"
|
||||||
-- foldable = "false"
|
-- foldable = "false"
|
||||||
-- uses_app = "com.amdroidalarmclock.amdroid"
|
-- uses_app = "com.amdroidalarmclock.amdroid"
|
||||||
|
|
||||||
local prefs = require "prefs"
|
local prefs = require "prefs"
|
||||||
|
|
||||||
local next_alarm = ""
|
local next_alarm = ""
|
||||||
local w_bridge = nil
|
local accent="#FFFFFF"
|
||||||
|
|
||||||
function on_resume()
|
function on_resume()
|
||||||
if not widgets:bound(prefs.wid) then
|
if not widgets:bound(prefs.wid) then
|
||||||
setup_app_widget()
|
setup_app_widget()
|
||||||
end
|
end
|
||||||
|
accent = aio:colors().accent
|
||||||
widgets:request_updates(prefs.wid)
|
widgets:request_updates(prefs.wid)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -27,10 +27,15 @@ function on_app_widget_updated(bridge)
|
|||||||
|
|
||||||
if next_alarm ~= nil
|
if next_alarm ~= nil
|
||||||
then
|
then
|
||||||
ui:show_table({{" ", "%%fa:alarm-clock%% "..next_alarm, " "}}, 0, true)
|
my_gui=gui{
|
||||||
|
{"text", " %%fa:alarm-clock%% <span style=\"color:#FFFFFF\">"..next_alarm.."</span>", {gravity="center_h", color=accent}}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ui:show_text("Empty")
|
my_gui=gui{
|
||||||
|
{"text", "Empty", {gravity="center_h" }}
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
my_gui.render()
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_click(idx)
|
function on_click(idx)
|
||||||
|
|||||||
20
samples/progress_sample.lua
Normal file
20
samples/progress_sample.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
function on_resume()
|
||||||
|
ui:show_lines{
|
||||||
|
"Set progress 25%",
|
||||||
|
"Set progress 50%",
|
||||||
|
"Set progress 75%",
|
||||||
|
"Set progress 100%",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_click(idx)
|
||||||
|
if idx == 1 then
|
||||||
|
ui:set_progress(0.25)
|
||||||
|
elseif idx == 2 then
|
||||||
|
ui:set_progress(0.5)
|
||||||
|
elseif idx == 3 then
|
||||||
|
ui:set_progress(0.75)
|
||||||
|
elseif idx == 4 then
|
||||||
|
ui:set_progress(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user