use of org.odk.collect.android.widgets.items.SelectImageMapWidget in project collect by opendatakit.
the class QuestionWidget method setupQuestionLabel.
private void setupQuestionLabel() {
audioVideoImageTextLabel.setTag(getClipID(formEntryPrompt));
audioVideoImageTextLabel.setText(formEntryPrompt.getLongText(), formEntryPrompt.isRequired(), questionTextSizeHelper.getHeadline6());
audioVideoImageTextLabel.setMediaUtils(mediaUtils);
String imageURI = this instanceof SelectImageMapWidget ? null : formEntryPrompt.getImageText();
String videoURI = formEntryPrompt.getSpecialFormQuestionText("video");
String bigImageURI = formEntryPrompt.getSpecialFormQuestionText("big-image");
String playableAudioURI = getPlayableAudioURI(formEntryPrompt, referenceManager);
try {
if (imageURI != null) {
audioVideoImageTextLabel.setImage(new File(referenceManager.deriveReference(imageURI).getLocalURI()), imageLoader);
}
if (bigImageURI != null) {
audioVideoImageTextLabel.setBigImage(new File(referenceManager.deriveReference(bigImageURI).getLocalURI()));
}
if (videoURI != null) {
audioVideoImageTextLabel.setVideo(new File(referenceManager.deriveReference(videoURI).getLocalURI()));
}
if (playableAudioURI != null) {
audioVideoImageTextLabel.setAudio(playableAudioURI, audioHelper);
}
} catch (InvalidReferenceException e) {
Timber.d(e, "Invalid media reference due to %s ", e.getMessage());
}
audioVideoImageTextLabel.setPlayTextColor(getPlayColor(formEntryPrompt, themeUtils));
}
Aggregations