Bixby:想在我的胶囊中实现秒表
Bixby: want to implement stop watch in my capsule
我想为我的太空舱显示秒表(计时器)。
那么,有什么方法可以让我在我的视图页面中显示每秒刷新一次的计时器。
我不明白从哪里开始。时间将如何刷新?
对此有任何帮助。
您可以使用内置的 刷新 命令重新绘制屏幕。例如,
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
上提供了一个工作示例
刷新详情here
虽然可以进行 1 秒刷新,但这肯定会因延迟而导致不准确。
根据您的用例,简单地创建动画 gif 并显示它可能更简单,而且绝对更准确。也许这与刷新相结合可能是更好的解决方案。
一个例子(来自https://timertopia.files.wordpress.com/2018/06/30seccut.gif)是这样的
我想为我的太空舱显示秒表(计时器)。
那么,有什么方法可以让我在我的视图页面中显示每秒刷新一次的计时器。 我不明白从哪里开始。时间将如何刷新?
对此有任何帮助。
您可以使用内置的 刷新 命令重新绘制屏幕。例如,
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
上提供了一个工作示例刷新详情here
虽然可以进行 1 秒刷新,但这肯定会因延迟而导致不准确。
根据您的用例,简单地创建动画 gif 并显示它可能更简单,而且绝对更准确。也许这与刷新相结合可能是更好的解决方案。
一个例子(来自https://timertopia.files.wordpress.com/2018/06/30seccut.gif)是这样的