Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions samples/v1.2/Tests/choice_set.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Input.ChoiceSet",
"id": "myColor4",
"isMultiSelect": true,
"value": "1",
"style": "expanded",
"choices": [
{
"title": "Red",
"value": "1"
},
{
"title": "Green",
"value": "2"
},
{
"title": "Blue",
"value": "3"
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
35 changes: 35 additions & 0 deletions samples/v1.2/Tests/choice_set_with_wrap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Input.ChoiceSet",
"id": "myColor4",
"isMultiSelect": true,
"value": "1",
"style": "expanded",
"wrap": true,
"choices": [
{
"title": "Red",
"value": "1"
},
{
"title": "Green",
"value": "2"
},
{
"title": "Blue",
"value": "3"
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public View renderCheckBoxSet(
List<CheckBox> checkBoxList = new Vector<CheckBox>();
ChoiceInputVector choiceInputVector = choiceSetInput.GetChoices();
long size = choiceInputVector.size();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a sample card that you can check in to teh samples folder for the bug bash testing. Also can we add a unit test for this?


String value = choiceSetInput.GetValue();
Vector<String> defaults = new Vector<>();
defaults.addAll(Arrays.asList(value.split(",")));
Expand All @@ -90,9 +91,9 @@ public View renderCheckBoxSet(
CheckBox checkBox = new CheckBox(context);
checkBox.setText(choiceInput.GetTitle());

if(!choiceSetInput.GetWrap())
if (!choiceSetInput.GetWrap())
{
checkBox.setLines(1);
checkBox.setMaxLines(1);
checkBox.setEllipsize(TextUtils.TruncateAt.END);
}

Expand Down