@Test public void whenAnswerChanges_shouldValueChangeListenersBeCalled() { WidgetValueChangedListener valueChangedListener = mockValueChangedListener(getSpyWidget()); SelectOneData answer = getInitialAnswer(); Selection selectedChoice = (Selection) answer.getValue(); getSpyWidget().setBinaryData(Collections.singletonList(selectedChoice)); verify(valueChangedListener).widgetValueChanged(getSpyWidget()); }
@Override public void setBinaryData(Object answer) { List<Selection> answers = (List<Selection>) answer; selectedItem = answers.isEmpty() ? null : answers.get(0); updateAnswer(); widgetValueChanged(); if (autoAdvance && autoAdvanceListener != null) { autoAdvanceListener.advance(); } }
SelectOneMinimalWidget extends SelectMinimalWidget { @Override public void setBinaryData(Object answer) { List<Selection> answers = (List<Selection>) answer; selectedItem = answers.isEmpty() ? null : answers.get(0); updateAnswer(); widgetValueChanged(); if (autoAdvance && autoAdvanceListener != null) { autoAdvanceListener.advance(); } } }
SelectOneMinimalWidget extends SelectMinimalWidget { @Override public void setBinaryData(Object answer) { List<Selection> answers = (List<Selection>) answer; selectedItem = answers.isEmpty() ? null : answers.get(0); updateAnswer(); widgetValueChanged(); if (autoAdvance && autoAdvanceListener != null) { autoAdvanceListener.advance(); } } SelectOneMinimalWidget(Context context, QuestionDetails prompt, boolean autoAdvance); }
SelectOneMinimalWidget extends SelectMinimalWidget { @Override public void setBinaryData(Object answer) { List<Selection> answers = (List<Selection>) answer; selectedItem = answers.isEmpty() ? null : answers.get(0); updateAnswer(); widgetValueChanged(); if (autoAdvance && autoAdvanceListener != null) { autoAdvanceListener.advance(); } } SelectOneMinimalWidget(Context context, QuestionDetails prompt, boolean autoAdvance); @Override IAnswerData getAnswer(); @Override void clearAnswer(); @Override void setBinaryData(Object answer); @Override void setChoiceSelected(int choiceIndex, boolean isSelected); }
SelectOneMinimalWidget extends SelectMinimalWidget { @Override public void setBinaryData(Object answer) { List<Selection> answers = (List<Selection>) answer; selectedItem = answers.isEmpty() ? null : answers.get(0); updateAnswer(); widgetValueChanged(); if (autoAdvance && autoAdvanceListener != null) { autoAdvanceListener.advance(); } } SelectOneMinimalWidget(Context context, QuestionDetails prompt, boolean autoAdvance); @Override IAnswerData getAnswer(); @Override void clearAnswer(); @Override void setBinaryData(Object answer); @Override void setChoiceSelected(int choiceIndex, boolean isSelected);  }