我知道通常我们希望在Bixby体验中完全保持互动,但是如果我想显示非常详细的非辅助样式信息,提供允许用户在给定URL上查看更多内容的链接可能会比较有利。我已经在Note9上的Bixby附带的胶囊中看到了这种UX惯例,例如Yelp(Bixby显示评论的重点,但是要获得所有评论的完整列表,您可以在Yelp上看到更多信息),天气频道等。
我的问题是将“在网站上查看更多”链接放入布局的推荐方法是什么?
小智 7
当前推荐的方法将使用中提供的app-launch
密钥result-view
。
您将需要创建以下内容:
名为的原始(文本)概念 Url
一个名为的动作,FetchUrl
其输出是您要启动的网址
定义键的单独result-view
位置app-launch
。这是您要启动的URL的位置。
您的流程将是:
您的胶囊提供了一个result-view
显示“在SITE上显示更多”卡片(可以是任何包含的显示元素on-click
)的。
“在站点上查看更多”卡on-click
将包含intent
其目标是您的FetchUrl
操作,并且其值是您需要返回要启动的URL的相关输入。
用户单击“在站点上查看更多”卡后,将输出intent
结果Url
。
根据match
模式,这会触发result-view
包含app-launch
密钥(如下所示的示例)。由于它result-view
仅包含app-launch
,因此将不会显示任何内容,并且Url
将在用户的默认浏览器上启动您所需要的内容。
如何app-launch
在内定义result-view
:
result-view {
match: Url (this) {
min(Required) max (One)
}
render {
nothing
}
app-launch {
payload-uri {
template ("#{value(this)}")
}
}
}
Run Code Online (Sandbox Code Playgroud)
小智 0
另一种选择是使用复合卡下巴。当然,只有当复合卡是适合您的布局的 UI 组件时,这才有效。此处讨论并回答了这个问题,但为了方便起见,下面是示例视图代码:
render {
layout {
section {
content {
compound-card {
content {
single-line {
text {
value {
template ("Click below to Punch Out")
}
}
}
}
chin {
slot1 {
single-line {
text {
value {
template ("Link to Google")
}
}
}
}
url {
template ("http://www.google.com")
}
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)