Bixby Developer Center

Guides

2018 October–December

Note

Internal platform changes that are not visible to capsule developers will be communicated via internal status updates.

18W Capsule SDK Release Notes

Updated: Dec 21, 2018

New 'image-object-fit' key for Bixby Views

You now have the ability to determine how an image fits within a Bixby Views component using image-object-fit. Additionally, you can resize an image with or without cropping.

image-card {
image-url (pencil.png)
image-object-fit (Cover)
// or image-object-fit (Contain) to prevent cropping
}

Conditional Endpoints

You now can specify endpoints using conditionals, such as if and else. This can be useful, for example, if you want to use a different endpoint based on various scenarios such as location or device.

...
// conditional remote-endpoint example ("main.url" specified in properties file)
// $vivContext is always passed to remote endpoints
action-endpoint (FindMyData) {
accepted-inputs (input1, input2, input3)
if ($vivContext.locale == 'fr_FR') {
remote-endpoint ("{main.url}/fr-path") {
method (POST)
}
}
else {
remote-endpoint ("{main.url}/en-path") {
method (POST)
}
}
}
...

Invoking Template Macros using EL

You can now invoke a template-macro using Expression Language (EL).

For example, suppose this macro has been defined with template-macro-def:

template-macro-def (Bookmarks) {
params {
param (number) {
type (example.book.Bookmarks)
max (One) min (Required)
}
}
content: template ("#{value(number)} bookmarks")
}

You can invoke that macro in EL with the macro command. This lets you include templates within other templates:

template ("You have #{macro('Bookmarks', 23)}.")

For more information, learn about Formatting Functions.

18V Capsule SDK Release Notes

Updated: Dec 3, 2018

Result Follow-ups

After showing a result view, you can now allow Bixby to ask yes or no questions to take a specific action. While Result Follow-Ups are not specific to Hands-Free Mode, they do provide a good replacement for Conversation Drivers to those using Bixby in Hands-Free Mode.

Here is an example result view that confirms whether the user wants directions for a business result:

result-view {
match: Business (this)

message ("I found #{value(this.name)}")

render {
layout-match (this) {
mode (Details)
}
}

followup {
prompt {
dialog (Would you like directions?)
on-confirm {
intent {
goal: NavigateTo
value: Business$expr(this)
}
}
on-deny {
message (Okay.)
}
}
}
}

Read more about Guiding Conversations through Follow-Up Questions.

Support for Dialog Template Localization

To better support capsule localization, Bixby now supports a special syntax for handling agreement of gender and case within dialog templates.

Example:

template("Et voilà @{1g:le,la} %{1:#{concept(this)}} trouvé@{1g:,e}")

Read more about Dialog Template Localization in the Developers' Guide.

18T Capsule SDK Release Notes

Updated: Nov 21, 2018

Introducing Hands-Free Mode

We're introducing the first feature of Hands-Free Mode, Hands-Free List Navigation. With Hands-Free List Navigation, you can now allow users to navigate through and select items from lists entirely by voice.

You can add Hands-Free List Navigation within the selection-of component of input views or the list-of component of result views. Here's a before and after of a simple input view from a capsule that allows users to book space resorts:

Before Hands-Free List Navigation

input-view {
match: SpaceResort (result)
message ("Which space resort would you like?")
render {
if (size(result) > 1) {
selection-of (result) {
select-button-text("Book")
where-each (item) {
layout-macro (space-resort-summary) {
param (spaceResort) {
expression(item)
}
}
}
}
}
}
}

After Hands-Free List Navigation

input-view {
match: SpaceResort (result)
message ("Which space resort would you like?")
render {
if (size(result) > 1) {
selection-of (result) {
navigation-mode {
read-one {
list-summary ("I found #{size(result)} resorts.")
underflow-statement (This is the first resort.)
item-selection-question (Do you want to book this resort?)
overflow-statement (Those are all the resorts that meet your search.)
overflow-question (What would you like to do?)
}
}
select-button-text ("Book")
where-each (item) {
layout-macro (space-resort-summary) {
param (spaceResort) {
expression (item)
}
}
}
}
}
}
}

Bixby provides several navigation modes that you can use depending on your capsule and device, ranging from reading no list items to reading many items.

You can even customize the navigation commands that users can say to interact with your capsule other than "next" or "yes", for example.

For more information on Hands-Free List Navigation, read through Hand-Free List Navigation in our Developers' Guides.

'hands-free-page-size' Deprecated

With the introduction of Hands-Free Mode, we've deprecated the hands-free-page-size key, which was used with input-view and result-view. You should transition your capsules to instead use Hand-Free List Navigation.

Bixby Views

Bixby now lets you construct Bixby Views to build your capsule’s user interface. Bixby Views uses the same key‐value modeling language that Bixby’s models are defined in. Use them to create interactive designs for Bixby in a simple, consistent manner. You can build various views in your capsule with less code without having to deal with HTML and CSS. The components are ultimately rendered as HTML and CSS on the device.

You can use Bixby Views to create various designs, including input form elements, views for confirmation, and views for showing results.

For example, here's a result-view that renders the results of a shoe search:

result-view {
match {
Shoe (shoe)
}

render {
if ("size(shoe) > 1") {
list-of (shoe) {
where-each (item) {
layout-macro (shoe-image-card) {
param (shoe) {
expression (item)
}
}
}
}
} else-if ("size(shoe) == 1") {
layout {
layout-macro (shoe-image-carousel) {
param (shoe) {
expression (shoe)
}
}
layout-macro (shoe-details-header) {
param (shoe) {
expression (shoe)
}
}
layout-macro (shoe-accessories) {
param (shoe) {
expression (shoe)
}
}
}
}
}
}

The resulting view looks like this:

For more information, learn about Creating Bixby Views. Refer also to the Design Guides for design principles when using Bixby Views and how your capsule should best interact with users.

Look for more updates to Hands-Free Mode in coming releases.

18R Capsule SDK Release Notes

Updated: October 2, 2018

Guest Access Permissions

You can now determine guest access behavior within your capsule with a new capsule permission. When Bixby determines that the user is not the account owner, the new guest-access-allowed key can determine whether the guest user can use the capsule, and whether the account owner can change guest access permissions.

Confirmation View

You can now conditionally determine if an action requires a confirmation or change the type of confirmation required.

To require a confirmation, actions must include a new confirm key, which can be conditionally set:

      confirm {
if (myInput > 65) {
by (MyConfirmation)
}
}

To determine what dialog or content the user sees, you now have a new confirmation-view key within the Bixby View:

confirmation-view {
match: common.Confirmation {
confirming: Action2 (action)
}
mode (NegativeEmphasis)
message ("Continue?")

render {
// `layout-match` or `layout-macro` or `nothing`
layout-match(action.input) {
mode (Detail)
}
}

confirm-options {
label ("Book")
on-confirm {
// allows user's to do post-confirmation validation
if (false) { // only `halt` and `replan` effects are supported
halt
}
}
}
abort-options {
label ("Keep looking")
on-abort {
intent {
goal: AvailableHotel
value {$expr(request.when)}
value {$expr(request.hotel.address.centroid)}
}
}
}
conversation-drivers {
...
}
}

Learn more about Confimation Views in the Developers' Guide.