-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[app] mavel rule ext: support action delay
- Loading branch information
Showing
3 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
Submodule Thanox-Internal
updated
from 0dd793 to 5a2e2b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
android/modules/module_profile/src/main/assets/prebuilt_profile/executor_delay.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
[ | ||
{ | ||
"name": "Delayed action example", | ||
"description": "Execute the action delay 2s: show a short toast and log the event 2s after app switched.", | ||
"description": "Execute the action delay 2000 ms: show a short toast 2s after app switched.", | ||
"priority": 1, | ||
"delay": 2000, | ||
"condition": "frontPkgChanged == true", | ||
"actions": [ | ||
"actor.delayed(2000, \"ui.showShortToast(\\\"App switched 2s ago\\\")\")", | ||
"actor.delayed(2000, \"log.log(to)\")" | ||
"ui.showShortToast(\"App switched 2s ago to: \" + thanos.getPkgManager().getAppInfo(to).getAppLabel())" | ||
] | ||
} | ||
] |
98aa959
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
太好了,这样写情景模式就方便了。另外还有一个小需求,就是希望切换后台状态持续X秒以后才执行。不懂现在的delay是切换回后台,是不是立马切回前台,仍然会执行