0

我在胶囊中使用了免提导航列表,我从多个项目中选择一个项目,以使用语音命令(“选择一个,选择第二个,等等”)获取详细信息。

但是如果我只有一个项目,我无法发出语音命令转到另一个页面。(当我们只有一个项目时,免提导航列表不起作用)。

那么,当我只有一个项目时,如何使用语音命令转到另一个页面。(免提导航)

请帮我解决一下这个。

4

1 回答 1

0

对于单个项目的情况,应该首先检查并且可能根本不进入列表导航。推荐在视图中渲染的逻辑如下:

if (size(this)==1) {
  // render content (maybe different between HEF and non-HEF, but no navigation needed) 
}
else {
  if ($handsFree) {
    // do list navigation here 
  }
  else {
    // render non-HEF content
  }
}

请考虑以下代码作为示例,此视图适用于多个项目列表和单个项目。对于具有多个项目的 HEF,流程是“你想要其中一个吗”-->“是”-->“你想要哪个人”-->“第一个/第二个”--> Bixby 将内容呈现在detail-stuctA 宏。对于单个项目的 HEF,它直接渲染 detail-stuctA 宏并跳过所有导航部分。

确实,如果跳过 (size(this)==1) 检查会导致永远卡在列表导航中,但这是可以理解的,因为每次 Bixby 尝试渲染时,它都符合列表导航的条件并取列表导航路线。

result-view {
  match: StructA(this)
  message: template ("In result view") 
  render {
    if (size(this)==1) {
      layout-macro (detail-structA) {
        param (person) {expression (this)}
      }
    }
    else {
    if ($handsFree) {
      list-of (this) {
        navigation-mode {
          read-many {
            page-size (6) 
            list-summary("In hands free") 
            page-content {
              underflow-statement (This is the first page.)
              page-selection-question (Do you want one of these?)
              item-selection-question (Which person would you like?)
              overflow-statement (Those are all the persons that meet your search.)
              overflow-question (What would you like to do?)
            }
          }
        }
        where-each (item) {
          layout-macro (summary-structA) {
            param (person) {expression (item)}
          }
        }
      }
    }
    else {
      list-of (this) {
        where-each (item) {
          layout-macro (summary-structA) {
            param (person) {expression (item)}
          }
        }
      }
    }
    }
  }
}

如果以上内容不能回答您的问题,请使用 Bixby IDE --> 帮助 --> 联系支持并提供示例胶囊副本以演示问题。

于 2020-08-17T19:25:02.163 回答