Fred Zimmerman
Fred Zimmerman

Reputation: 1238

how to replace has-details with card component per deprecation 6812

I have some result views that use "has-details" which is now deprecated.

e.g.

render {
    if (size(this) > 1) {
      list-of (this) {
        default-sort-order {
          sorting(this.name)
        }
        has-details (true)
        where-each (item) {
          layout-macro (altbrains-compound-card) {
            param (altbrainsdata) {
              expression (item)
            }
          }
        }
      }

https://bixbydevelopers.com/dev/docs/dev-guide/release-notes/deprecations.6812

DEPRECATED: has-details is deprecated. Consider using on-click.view-for in a list card components instead. [deprecation 6812]

What does this mean? Can someone provide an example?

Upvotes: 0

Views: 39

Answers (1)

Ameya
Ameya

Reputation: 888

The Movie Agent Sample Capsule in the Bixby Developers Github repo is an excellent example for this behavior.

The relevant files are:

Here's how it works:

  1. User asks for something that results in multiple Movies
  2. Movie_Result view displays a bunch of movies using the Movie_Summary layout macro for each Movie
  3. User taps one Movie which triggers the on-click containing view-for (movie)
  4. This reloads the Movie_Result view again since its match requirement is met and triggers the Movie_Details layout since there is only 1 Movie to display.

Upvotes: 2

Related Questions