diff --git a/community/amdroid-nextalarm-app-widget.lua b/community/amdroid-nextalarm-app-widget.lua index 2f067ce..63c4f59 100644 --- a/community/amdroid-nextalarm-app-widget.lua +++ b/community/amdroid-nextalarm-app-widget.lua @@ -2,20 +2,20 @@ -- description = "AIO wrapper for the Amdroid next alarm app widget" -- type = "widget" -- author = "Theodor Galanis" --- version = "1.0" +-- version = "1.0.2" -- foldable = "false" -- uses_app = "com.amdroidalarmclock.amdroid" local prefs = require "prefs" local next_alarm = "" -local w_bridge = nil +local accent="#FFFFFF" function on_resume() if not widgets:bound(prefs.wid) then setup_app_widget() end - + accent = aio:colors().accent widgets:request_updates(prefs.wid) end @@ -26,11 +26,16 @@ function on_app_widget_updated(bridge) w_bridge = bridge if next_alarm ~= nil - then - ui:show_table({{" ", "%%fa:alarm-clock%% "..next_alarm, " "}}, 0, true) + then + my_gui=gui{ + {"text", " %%fa:alarm-clock%% "..next_alarm.."", {gravity="center_h", color=accent}} + } else - ui:show_text("Empty") + my_gui=gui{ + {"text", "Empty", {gravity="center_h" }} + } end + my_gui.render() end function on_click(idx) diff --git a/samples/progress_sample.lua b/samples/progress_sample.lua new file mode 100644 index 0000000..642fadc --- /dev/null +++ b/samples/progress_sample.lua @@ -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