bixby - Bixby:想在我的胶囊中实现秒表
问题描述
我想为我的胶囊显示秒表(计时器)。
那么,有什么方法可以在我的视图页面中显示计时器,它会每秒刷新一次。我不明白从哪里开始。时间将如何刷新?
对此有任何帮助。
解决方案
您可以使用内置的刷新命令重新绘制屏幕。例如,
result-view {
match {
Activity (this) {
min (Required)
max (One)
from-output: CheckRideShareStatus (check)
}
}
message {
if (this.countdown != 0) {
template ("Your ride will arrive in #{value(this.countdown)} seconds.")
} else {
template ("I hope you are enjoying your ride")
}
}
refresh {
if (this.countdown != 0) {
spec {
delay-seconds (5)
with-request {
intent {
goal: CheckRideShareStatus
value {
$expr (this)
}
}
}
}
}
}
render {
layout-macro (activity-map-macro) {
param (activity) {
expression (this)
}
}
}
}
Bixby 团队在Github上提供了一个工作示例
此处刷新详情
推荐阅读
- java - Wildfly 快速入门 不可解析的导入 POM:未能找到 org.wildfly:wildfly-parent:pom:20.0.0.Beta1-SNAPSHOT
- c - 如何使用 Ecpise 检测 C 中的堆栈粉碎
- javascript - 无法获取 AWS 开发工具包 Lambda 的 addrinfo
- android - Android home screen widget, create from activity
- linux - 无法在 ubuntu 中安装 nvm
- python - 即使我安装了 Python 导入也无法正常工作
- javascript - 使用纯 javascript 的手风琴 - 仅适用于双击
- java - 我们可以在 if 语句中从一个字符串中取出两个字符串吗?
- javascript - 如何添加 CheckAll 按钮
- php - 我的 PHP 云存储平台的数字存储转换如何?还有什么我应该补充的吗?