use of org.odk.collect.android.formmanagement.BlankFormsListViewModel.BlankForm in project collect by opendatakit.
the class AndroidShortcutsActivity method onCreate.
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
DaggerUtils.getComponent(this).inject(this);
BlankFormsListViewModel blankFormsListViewModel = new ViewModelProvider(this, blankFormsListViewModelFactory).get(BlankFormsListViewModel.class);
List<BlankForm> forms = blankFormsListViewModel.getForms();
showFormListDialog(forms);
}
use of org.odk.collect.android.formmanagement.BlankFormsListViewModel.BlankForm in project collect by opendatakit.
the class AndroidShortcutsActivity method showFormListDialog.
private void showFormListDialog(List<BlankForm> forms) {
new MaterialAlertDialogBuilder(this).setTitle(R.string.select_odk_shortcut).setItems(forms.stream().map(BlankForm::getName).toArray(String[]::new), (dialog, item) -> {
AnalyticsUtils.logServerEvent(AnalyticsEvents.CREATE_SHORTCUT, settingsProvider.getUnprotectedSettings());
Intent intent = getShortcutIntent(forms, item);
setResult(RESULT_OK, intent);
finish();
}).setOnCancelListener(dialog -> {
setResult(RESULT_CANCELED);
finish();
}).create().show();
}
Aggregations