Search in sources :

Example 1 with AudioButton

use of org.odk.collect.android.audio.AudioButton in project collect by opendatakit.

the class QuestionWidgetTest method whenQuestionHasAudio_audioButtonUsesIndexAsClipID.

@Test
public void whenQuestionHasAudio_audioButtonUsesIndexAsClipID() throws Exception {
    FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withIndex("i am index").withAudioURI("ref").build();
    WidgetTestActivity activity = CollectHelpers.createThemedActivity(WidgetTestActivity.class);
    TestWidget widget = new TestWidget(activity, new QuestionDetails(prompt));
    AudioButton audioButton = widget.getAudioVideoImageTextLabel().findViewById(R.id.audioButton);
    verify(audioHelper).setAudio(audioButton, new Clip("i am index", "blah.mp3"));
}
Also used : Clip(org.odk.collect.audioclips.Clip) FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) WidgetTestActivity(org.odk.collect.android.support.WidgetTestActivity) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) QuestionDetails(org.odk.collect.android.formentry.questions.QuestionDetails) AudioButton(org.odk.collect.android.audio.AudioButton) Test(org.junit.Test)

Aggregations

FormEntryPrompt (org.javarosa.form.api.FormEntryPrompt)1 Test (org.junit.Test)1 AudioButton (org.odk.collect.android.audio.AudioButton)1 QuestionDetails (org.odk.collect.android.formentry.questions.QuestionDetails)1 MockFormEntryPromptBuilder (org.odk.collect.android.support.MockFormEntryPromptBuilder)1 WidgetTestActivity (org.odk.collect.android.support.WidgetTestActivity)1 Clip (org.odk.collect.audioclips.Clip)1