0

My app is basically providing three option for selection to the user.

1: I am using result-view and cell-card. when i was using for each, i was able to click on the card and trigger an intent which is showing user the further details in the form of compound-card. Now, for user to select the option by saying first, second OR third, i need to use navigation-support and for that I need to use list-of in the result-view. After using list-of, I am unable to trigger the intent on-click. How to achieve that?

2: How to trigger that intent, if user is saying first, second or third. Right now, if user is choosing by saying first, second and third, it is popping out the said cell-card excluding other two. How to achieve that?

My result-view is:

result-view {
  match: ArtistChoiceResult (artistchoice) {
    from-output: ArtistChoice
  }
  message {template("Here is the upcoming event")}
  list-of (artistchoice) {
    navigation-mode {
      read-many {
        page-size(3)
        underflow-statement (This is the first set)
        item-selection-question (Which one would you like?)
        overflow-statement (That's all I have)
      }
    }
    where-each (one) {
      layout-match (one) {
        mode (Summary)
      }
    }
  }

layout-match is like this

 layout {
   match: ArtistChoiceResult (singleArtist)
   mode(Summary)
   content{
    section{
     content{
       cell-card {
        slot1 {
          image {
           url ("#{value(singleArtist.multiple_image)}")
            shape (Square)
          }
        }
        slot2 {
          content {
            order (PrimarySecondary)
            primary ("#{value(singleArtist.multiple_name)}")
            secondary ("#{value(singleArtist.multiple_cat)}")
          }
        }
        on-click {
          intent {
            goal: ArtistChoice
            value-set:MultipleID{$expr(singleArtist.multiple_id)}
          }
        }
      }
    }
  }
}
}

Navigation support file is

 navigation-support {
  match: ArtistChoiceResult (this) 
  ordinal-selection-patterns {
    pattern ("(first)[v:viv.core.OrdinalSelector]")
    pattern ("(first)[v:viv.core.OrdinalSelector] one")
    pattern ("that (first)[v:viv.core.OrdinalSelector] one")

    pattern ("yes (first)[v:viv.core.OrdinalSelector]")
    pattern ("yes (first)[v:viv.core.OrdinalSelector] one")
    pattern ("yes that (first)[v:viv.core.OrdinalSelector] one")

    pattern ("result number (one)[v:viv.core.CardinalSelector:1]")
    pattern ("the (first)[v:viv.core.CardinalSelector:1]")

    pattern ("select (first)[v:viv.core.OrdinalSelector] one")
    pattern ("select (first)[v:viv.core.OrdinalSelector]")
  }
}
Rahul Gupta
  • 972
  • 11
  • 29

1 Answers1

0

A couple of issues with your code

  1. you have created an intent in a Summary layout. The documentation says, https://bixbydevelopers.com/dev/docs/reference/type/layout-macro-def.content.cell-card

    If you have this card to list results with list-of, then clicking the card opens the selected item in Details mode and the defined intent is not passed

  2. If you try to use layout-match inside where-each the IDE will show a WARN_DEPRECATED error. While this might not throw compile errors now, it is advisable to use layout-macro

Suggestions to try:

  1. Use layout-macro to define your Layouts (both Summary and Details)
  2. Add the intent in the Details layout
  • 1
    I am showing user 3 option then I think summary layout is the better option. Isn't it? I don't want user to click details layout.. is it possible to add intent in summary layout if I am using layout- macro? Also what about issue no 2? – Rahul Gupta Feb 19 '19 at 20:07
  • 1
    No, the Bixby framework does not allow it. Refer to the documentation I provided earlier. This will become easier to test soon, when the speech functionalities are added to IDE and/or when on-device testing becomes active. – BixbyDevSupportOne Feb 20 '19 at 03:14
  • 1
    So right now what to do if user is making selection by speaking first, second or third? – Rahul Gupta Feb 20 '19 at 03:19
  • 1
    You can model your capsule behavior from the example on this page https://bixbydevelopers.com/dev/docs/dev-guide/developers/enhancing-UX.list-navigation – BixbyDevSupportOne Feb 20 '19 at 03:31
  • 1
    By using your suggestion, I used `layout-macro` for summary and details layout. Now, I am saying tell me the scorecard for cricket. if there are three matches for the day , so it will asked user to choose from the following match. IND vs AUS? NZ vs BAN? SA vs PAK. As soon as user will click on the any of the cell-card, this should show the score-card. BUT for now, If user is saying or clicking on first one, It will pop out the first option and remove the other two and then you have to click on the shown option to get the scorecard. So there is one extra-click. I want to avoid that. – Rahul Gupta Feb 20 '19 at 13:51
  • The Shoe sample capsule uses layout-macro and illustrates the functionality of transitioning from Summary view to a Details view, without intermediate views in between. You can use this as a guide to model your own capsule. https://github.com/bixbydevelopers/capsule-sample-shoe – BixbyDevSupportOne Feb 20 '19 at 18:10