From 008e3fae4816a8306115bcf6d0f5a25d1923e117 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 13 Nov 2022 17:24:42 +0400 Subject: [PATCH] add fold and unfold actions --- README.md | 5 +++-- samples/on_widget_action_test.lua | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 samples/on_widget_action_test.lua diff --git a/README.md b/README.md index 74bff39..b6db242 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,8 @@ The type of script is determined by the line (meta tag) at the beginning of the * 4.5.2 - added `anim` and `morph` packages, added `calendar:open_event()` function; * 4.5.3 - removed get_ prefixes where they are not needed while maintaining backward compatibility; * 4.5.5 - added `on_action` callback and `calendar:add_event` function; -* 4.5.6 - `aio:active_widgets()` now returns also widget `label`, added `checks` module. +* 4.5.6 - `aio:active_widgets()` now returns also widget `label`, added `checks` module; +* 4.5.7 - added "fold" and "unfold" actions to `on_action` callback. # Widget scripts @@ -255,7 +256,7 @@ The script can track screen operations such as adding, removing or moving a widg ``` function on_widget_action(action, name) - ui:show_toast(name..." action) + ui:show_toast(name.." "..action) end ``` diff --git a/samples/on_widget_action_test.lua b/samples/on_widget_action_test.lua new file mode 100644 index 0000000..b95153b --- /dev/null +++ b/samples/on_widget_action_test.lua @@ -0,0 +1,8 @@ +function on_resume() + ui:show_text("Empty") +end + +function on_widget_action(action, name) + ui:show_toast(name.." "..action) +end +