use of org.odk.collect.android.activities.FormEntryActivity in project collect by opendatakit.
the class SelectImageMapWidget method refreshSelectedItemsLabel.
protected void refreshSelectedItemsLabel() {
StringBuilder stringBuilder = new StringBuilder();
if (!selections.isEmpty()) {
stringBuilder.append("<b>").append(getContext().getString(R.string.selected)).append("</b> ");
for (Selection selection : selections) {
String choiceName = getFormEntryPrompt().getSelectChoiceText(selection.choice);
CharSequence choiceDisplayName = TextUtils.textToHtml(choiceName);
stringBuilder.append(choiceDisplayName);
if (selections.indexOf(selection) < selections.size() - 1) {
stringBuilder.append(", ");
}
}
}
((FormEntryActivity) getContext()).runOnUiThread(() -> selectedAreasLabel.setText(Html.fromHtml(stringBuilder.toString())));
}
use of org.odk.collect.android.activities.FormEntryActivity in project collect by opendatakit.
the class AllWidgetsFormTest method prepareDependencies.
@Before
public void prepareDependencies() {
FormEntryActivity activity = activityTestRule.getActivity();
activity.setActivityAvailability(activityAvailability);
activity.setShouldOverrideAnimations(true);
}
Aggregations