Search in sources :

Example 1 with FormEntryViewModel

use of org.odk.collect.android.formentry.FormEntryViewModel in project collect by opendatakit.

the class FormHierarchyActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.hierarchy_layout);
    Collect.getInstance().getComponent().inject(this);
    recyclerView = findViewById(R.id.list);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
    TextView emptyView = findViewById(android.R.id.empty);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    FormController formController = Collect.getInstance().getFormController();
    // https://github.com/getodk/collect/issues/998
    if (formController == null) {
        finish();
        Timber.w("FormController is null");
        return;
    }
    formEntryViewModel = new ViewModelProvider(this, formEntryViewModelFactory).get(FormEntryViewModel.class);
    formEntryViewModel.formLoaded(Collect.getInstance().getFormController());
    startIndex = formController.getFormIndex();
    setTitle(formController.getFormTitle());
    groupPathTextView = findViewById(R.id.pathtext);
    jumpBeginningButton = findViewById(R.id.jumpBeginningButton);
    jumpEndButton = findViewById(R.id.jumpEndButton);
    configureButtons(formController);
    restoreInstanceState(savedInstanceState);
    refreshView();
    // TODO: avoid another iteration through all displayed elements
    if (recyclerView != null && recyclerView.getAdapter() != null && recyclerView.getAdapter().getItemCount() > 0) {
        emptyView.setVisibility(View.GONE);
        recyclerView.post(() -> {
            int position = 0;
            // startIndex which can either represent a question or a field list.
            for (HierarchyElement hierarchyElement : elementsToDisplay) {
                FormIndex indexToCheck = hierarchyElement.getFormIndex();
                if (startIndex.equals(indexToCheck) || (formController.indexIsInFieldList(startIndex) && indexToCheck.toString().startsWith(startIndex.toString()))) {
                    position = elementsToDisplay.indexOf(hierarchyElement);
                    break;
                }
            }
            ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(position, 0);
        });
    }
}
Also used : FormController(org.odk.collect.android.javarosawrapper.FormController) HierarchyElement(org.odk.collect.android.logic.HierarchyElement) FormIndex(org.javarosa.core.model.FormIndex) TextView(android.widget.TextView) FormEntryViewModel(org.odk.collect.android.formentry.FormEntryViewModel) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DividerItemDecoration(androidx.recyclerview.widget.DividerItemDecoration) Toolbar(androidx.appcompat.widget.Toolbar) ViewModelProvider(androidx.lifecycle.ViewModelProvider)

Example 2 with FormEntryViewModel

use of org.odk.collect.android.formentry.FormEntryViewModel in project collect by opendatakit.

the class AudioRecordingControllerFragmentTest method setup.

@Before
public void setup() throws IOException {
    File stubRecording = File.createTempFile("test", ".m4a");
    stubRecording.deleteOnExit();
    audioRecorder = new StubAudioRecorder(stubRecording.getAbsolutePath());
    backgroundAudioViewModel = mock(BackgroundAudioViewModel.class);
    formEntryViewModel = mock(FormEntryViewModel.class);
    hasBackgroundRecording = new MutableNonNullLiveData<>(false);
    when(formEntryViewModel.hasBackgroundRecording()).thenReturn(hasBackgroundRecording);
    isBackgroundRecordingEnabled = new MutableNonNullLiveData<>(false);
    when(backgroundAudioViewModel.isBackgroundRecordingEnabled()).thenReturn(isBackgroundRecordingEnabled);
    externalWebPageHelper = mock(ExternalWebPageHelper.class);
    CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {

        @Override
        public BackgroundAudioViewModel.Factory providesBackgroundAudioViewModelFactory(AudioRecorder audioRecorder, SettingsProvider settingsProvider, PermissionsChecker permissionsChecker, Analytics analytics) {
            return new BackgroundAudioViewModel.Factory(audioRecorder, settingsProvider.getUnprotectedSettings(), permissionsChecker, System::currentTimeMillis) {

                @NonNull
                @Override
                public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
                    return (T) backgroundAudioViewModel;
                }
            };
        }

        @Override
        public FormEntryViewModel.Factory providesFormEntryViewModelFactory(Analytics analytics) {
            return new FormEntryViewModel.Factory(System::currentTimeMillis) {

                @NonNull
                @Override
                public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
                    return (T) formEntryViewModel;
                }
            };
        }

        @Override
        public AudioRecorder providesAudioRecorder(Application application) {
            return audioRecorder;
        }

        @Override
        public ExternalWebPageHelper providesExternalWebPageHelper() {
            return externalWebPageHelper;
        }
    });
}
Also used : StubAudioRecorder(org.odk.collect.audiorecorder.testsupport.StubAudioRecorder) FormEntryViewModel(org.odk.collect.android.formentry.FormEntryViewModel) AppDependencyModule(org.odk.collect.android.injection.config.AppDependencyModule) Analytics(org.odk.collect.analytics.Analytics) SettingsProvider(org.odk.collect.settings.SettingsProvider) NonNull(androidx.annotation.NonNull) StubAudioRecorder(org.odk.collect.audiorecorder.testsupport.StubAudioRecorder) AudioRecorder(org.odk.collect.audiorecorder.recording.AudioRecorder) PermissionsChecker(org.odk.collect.permissions.PermissionsChecker) BackgroundAudioViewModel(org.odk.collect.android.formentry.BackgroundAudioViewModel) File(java.io.File) Application(android.app.Application) ExternalWebPageHelper(org.odk.collect.android.utilities.ExternalWebPageHelper) Before(org.junit.Before)

Example 3 with FormEntryViewModel

use of org.odk.collect.android.formentry.FormEntryViewModel in project collect by opendatakit.

the class FormEntryActivity method setupViewModels.

private void setupViewModels() {
    backgroundLocationViewModel = ViewModelProviders.of(this, new BackgroundLocationViewModel.Factory(permissionsProvider, settingsProvider.getUnprotectedSettings())).get(BackgroundLocationViewModel.class);
    backgroundAudioViewModel = new ViewModelProvider(this, backgroundAudioViewModelFactory).get(BackgroundAudioViewModel.class);
    backgroundAudioViewModel.isPermissionRequired().observe(this, isPermissionRequired -> {
        if (isPermissionRequired) {
            showIfNotShowing(BackgroundAudioPermissionDialogFragment.class, getSupportFragmentManager());
        }
    });
    identityPromptViewModel = ViewModelProviders.of(this).get(IdentityPromptViewModel.class);
    identityPromptViewModel.requiresIdentityToContinue().observe(this, requiresIdentity -> {
        if (requiresIdentity) {
            showIfNotShowing(IdentifyUserPromptDialogFragment.class, getSupportFragmentManager());
        }
    });
    identityPromptViewModel.isFormEntryCancelled().observe(this, isFormEntryCancelled -> {
        if (isFormEntryCancelled) {
            finish();
        }
    });
    formEntryViewModel = ViewModelProviders.of(this, formEntryViewModelFactory).get(FormEntryViewModel.class);
    formEntryViewModel.getError().observe(this, error -> {
        if (error instanceof FormEntryViewModel.NonFatal) {
            createErrorDialog(((FormEntryViewModel.NonFatal) error).getMessage(), false);
            formEntryViewModel.errorDisplayed();
        }
    });
    formSaveViewModel = new ViewModelProvider(this, formSaveViewModelFactoryFactory.create(this, null)).get(FormSaveViewModel.class);
    formSaveViewModel.getSaveResult().observe(this, this::handleSaveResult);
    formSaveViewModel.isSavingAnswerFile().observe(this, isSavingAnswerFile -> {
        if (isSavingAnswerFile) {
            DialogFragmentUtils.showIfNotShowing(SaveAnswerFileProgressDialogFragment.class, getSupportFragmentManager());
        } else {
            DialogFragmentUtils.dismissDialog(SaveAnswerFileProgressDialogFragment.class, getSupportFragmentManager());
        }
    });
    formSaveViewModel.getAnswerFileError().observe(this, file -> {
        if (file != null) {
            DialogFragmentUtils.showIfNotShowing(SaveAnswerFileErrorDialogFragment.class, getSupportFragmentManager());
        }
    });
    internalRecordingRequester = new InternalRecordingRequester(this, audioRecorder, permissionsProvider, formEntryViewModel);
    waitingForDataRegistry = new FormControllerWaitingForDataRegistry();
    externalAppRecordingRequester = new ExternalAppRecordingRequester(this, intentLauncher, waitingForDataRegistry, permissionsProvider, formEntryViewModel);
    RecordingHandler recordingHandler = new RecordingHandler(formSaveViewModel, this, audioRecorder, new AMRAppender(), new M4AAppender());
    audioRecorder.getCurrentSession().observe(this, session -> {
        if (session != null && session.getFile() != null) {
            recordingHandler.handle(getFormController(), session, success -> {
                if (success) {
                    onScreenRefresh();
                    formSaveViewModel.resumeSave();
                } else {
                    String path = session.getFile().getAbsolutePath();
                    String message = getString(R.string.answer_file_copy_failed_message, path);
                    Toast.makeText(this, message, Toast.LENGTH_LONG).show();
                }
            });
        }
    });
}
Also used : BackgroundLocationViewModel(org.odk.collect.android.formentry.backgroundlocation.BackgroundLocationViewModel) IdentityPromptViewModel(org.odk.collect.android.formentry.audit.IdentityPromptViewModel) ExternalAppRecordingRequester(org.odk.collect.android.widgets.utilities.ExternalAppRecordingRequester) FormEntryViewModel(org.odk.collect.android.formentry.FormEntryViewModel) RecordingHandler(org.odk.collect.android.formentry.RecordingHandler) AMRAppender(org.odk.collect.android.audio.AMRAppender) FormSaveViewModel(org.odk.collect.android.formentry.saving.FormSaveViewModel) BackgroundAudioViewModel(org.odk.collect.android.formentry.BackgroundAudioViewModel) InternalRecordingRequester(org.odk.collect.android.widgets.utilities.InternalRecordingRequester) FormControllerWaitingForDataRegistry(org.odk.collect.android.widgets.utilities.FormControllerWaitingForDataRegistry) M4AAppender(org.odk.collect.android.audio.M4AAppender) ViewModelProvider(androidx.lifecycle.ViewModelProvider)

Example 4 with FormEntryViewModel

use of org.odk.collect.android.formentry.FormEntryViewModel in project collect by opendatakit.

the class FormEntryActivity method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    // this issue by including WebViews
    if (Build.VERSION.SDK_INT >= 24) {
        try {
            new WebView(this);
        } catch (Exception | Error e) {
        // Don't crash if WebView not available
        }
    }
    super.onCreate(savedInstanceState);
    Collect.getInstance().getComponent().inject(this);
    formsRepository = formsRepositoryProvider.get();
    setContentView(R.layout.form_entry);
    setupViewModels();
    swipeHandler = new SwipeHandler(this, settingsProvider.getUnprotectedSettings());
    compositeDisposable.add(eventBus.register(ReadPhoneStatePermissionRxEvent.class).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(event -> {
        readPhoneStatePermissionRequestNeeded = true;
    }));
    errorMessage = null;
    questionHolder = findViewById(R.id.questionholder);
    initToolbar();
    formIndexAnimationHandler = new FormIndexAnimationHandler(this);
    menuDelegate = new FormEntryMenuDelegate(this, () -> getAnswers(), formIndexAnimationHandler, formSaveViewModel, formEntryViewModel, audioRecorder, backgroundLocationViewModel, backgroundAudioViewModel, settingsProvider);
    nextButton = findViewById(R.id.form_forward_button);
    nextButton.setOnClickListener(v -> {
        swipeHandler.setBeenSwiped(true);
        onSwipeForward();
    });
    backButton = findViewById(R.id.form_back_button);
    backButton.setOnClickListener(v -> {
        swipeHandler.setBeenSwiped(true);
        onSwipeBackward();
    });
    if (savedInstanceState == null) {
        mediaLoadingFragment = new MediaLoadingFragment();
        getSupportFragmentManager().beginTransaction().add(mediaLoadingFragment, TAG_MEDIA_LOADING_FRAGMENT).commit();
    } else {
        mediaLoadingFragment = (MediaLoadingFragment) getSupportFragmentManager().findFragmentByTag(TAG_MEDIA_LOADING_FRAGMENT);
    }
    setupFields(savedInstanceState);
    loadForm();
}
Also used : Analytics(org.odk.collect.analytics.Analytics) Bundle(android.os.Bundle) FormDef(org.javarosa.core.model.FormDef) FormEntryMenuDelegate(org.odk.collect.android.formentry.FormEntryMenuDelegate) NonNull(androidx.annotation.NonNull) Uri(android.net.Uri) FrameLayout(android.widget.FrameLayout) TreeElement(org.javarosa.core.model.instance.TreeElement) DeleteRepeatDialogFragment(org.odk.collect.android.formentry.repeats.DeleteRepeatDialogFragment) AuditUtils(org.odk.collect.android.formentry.audit.AuditUtils) SaveFormIndexTask(org.odk.collect.android.tasks.SaveFormIndexTask) ReadPhoneStatePermissionRxEvent(org.odk.collect.android.events.ReadPhoneStatePermissionRxEvent) EVENT_PROMPT_NEW_REPEAT(org.javarosa.form.api.FormEntryController.EVENT_PROMPT_NEW_REPEAT) SaveAnswerFileProgressDialogFragment(org.odk.collect.android.formentry.saving.SaveAnswerFileProgressDialogFragment) FORWARDS(org.odk.collect.android.formentry.FormIndexAnimationHandler.Direction.FORWARDS) DateTimeWidget(org.odk.collect.android.widgets.DateTimeWidget) AnalyticsUtils(org.odk.collect.android.analytics.AnalyticsUtils) RecordingWarningDialogFragment(org.odk.collect.android.formentry.RecordingWarningDialogFragment) MaterialProgressDialogFragment(org.odk.collect.material.MaterialProgressDialogFragment) Map(java.util.Map) AddRepeatDialog(org.odk.collect.android.formentry.repeats.AddRepeatDialog) ODKView(org.odk.collect.android.formentry.ODKView) QuitFormDialogFragment(org.odk.collect.android.formentry.QuitFormDialogFragment) RxEventBus(org.odk.collect.android.events.RxEventBus) StorageSubdirectory(org.odk.collect.android.storage.StorageSubdirectory) DialogFragmentUtils(org.odk.collect.androidshared.ui.DialogFragmentUtils) IntentFilter(android.content.IntentFilter) BackgroundAudioPermissionDialogFragment(org.odk.collect.android.formentry.BackgroundAudioPermissionDialogFragment) ExternalAppUtils(org.odk.collect.externalapp.ExternalAppUtils) AnalyticsEvents(org.odk.collect.android.analytics.AnalyticsEvents) FormLoaderTask(org.odk.collect.android.tasks.FormLoaderTask) PropertyManager(org.odk.collect.android.logic.PropertyManager) RankingWidgetDialog(org.odk.collect.android.fragments.dialogs.RankingWidgetDialog) Nullable(androidx.annotation.Nullable) FormInstanceFileCreator(org.odk.collect.android.formentry.loading.FormInstanceFileCreator) RangePickerDecimalWidget(org.odk.collect.android.widgets.RangePickerDecimalWidget) AdvanceToNextListener(org.odk.collect.android.listeners.AdvanceToNextListener) BackgroundLocationManager(org.odk.collect.android.formentry.backgroundlocation.BackgroundLocationManager) IntentLauncher(org.odk.collect.androidshared.system.IntentLauncher) AudioRecorder(org.odk.collect.audiorecorder.recording.AudioRecorder) StoragePathProvider(org.odk.collect.android.storage.StoragePathProvider) FormEndView(org.odk.collect.android.formentry.FormEndView) SaveAnswerFileErrorDialogFragment(org.odk.collect.android.formentry.saving.SaveAnswerFileErrorDialogFragment) ContextMenuInfo(android.view.ContextMenu.ContextMenuInfo) InstanceSubmitScheduler(org.odk.collect.android.backgroundwork.InstanceSubmitScheduler) ExternalAppRecordingRequester(org.odk.collect.android.widgets.utilities.ExternalAppRecordingRequester) FormIndex(org.javarosa.core.model.FormIndex) FormsRepository(org.odk.collect.forms.FormsRepository) SAVE_INCOMPLETE(org.odk.collect.android.analytics.AnalyticsEvents.SAVE_INCOMPLETE) ArrayList(java.util.ArrayList) BACKWARDS(org.odk.collect.android.formentry.FormIndexAnimationHandler.Direction.BACKWARDS) RepeatsInFieldListException(org.odk.collect.android.javarosawrapper.RepeatsInFieldListException) WaitingForDataRegistry(org.odk.collect.android.widgets.utilities.WaitingForDataRegistry) Toast(android.widget.Toast) CustomTimePickerDialog(org.odk.collect.android.fragments.dialogs.CustomTimePickerDialog) InternalRecordingRequester(org.odk.collect.android.widgets.utilities.InternalRecordingRequester) Menu(android.view.Menu) IdentityPromptViewModel(org.odk.collect.android.formentry.audit.IdentityPromptViewModel) AudioClipViewModel(org.odk.collect.audioclips.AudioClipViewModel) InstancesContract(org.odk.collect.android.external.InstancesContract) BUTTON_POSITIVE(android.content.DialogInterface.BUTTON_POSITIVE) Instance(org.odk.collect.forms.instances.Instance) ViewModelProvider(androidx.lifecycle.ViewModelProvider) PermissionsChecker(org.odk.collect.permissions.PermissionsChecker) DestroyableLifecyleOwner(org.odk.collect.android.utilities.DestroyableLifecyleOwner) FormLoaderListener(org.odk.collect.android.listeners.FormLoaderListener) LocalDateTime(org.joda.time.LocalDateTime) FormsContract(org.odk.collect.android.external.FormsContract) FormController(org.odk.collect.android.javarosawrapper.FormController) FormEntryCaption(org.javarosa.form.api.FormEntryCaption) File(java.io.File) ToastUtils.showLongToast(org.odk.collect.androidshared.ui.ToastUtils.showLongToast) JavaRosaException(org.odk.collect.android.exception.JavaRosaException) SnackbarUtils(org.odk.collect.android.utilities.SnackbarUtils) KEY_MOVING_BACKWARDS(org.odk.collect.settings.keys.ProtectedProjectKeys.KEY_MOVING_BACKWARDS) FormSaveViewModel(org.odk.collect.android.formentry.saving.FormSaveViewModel) MediaLoadingFragment(org.odk.collect.android.fragments.MediaLoadingFragment) Scheduler(org.odk.collect.async.Scheduler) SavePointTask(org.odk.collect.android.tasks.SavePointTask) InstancesDaoHelper(org.odk.collect.android.dao.helpers.InstancesDaoHelper) MaterialAlertDialogBuilder(com.google.android.material.dialog.MaterialAlertDialogBuilder) ChangesReasonPromptDialogFragment(org.odk.collect.android.formentry.audit.ChangesReasonPromptDialogFragment) SoftKeyboardController(org.odk.collect.android.utilities.SoftKeyboardController) ApplicationConstants(org.odk.collect.android.utilities.ApplicationConstants) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) PermissionListener(org.odk.collect.permissions.PermissionListener) CustomDatePickerDialog(org.odk.collect.android.fragments.dialogs.CustomDatePickerDialog) FormControllerWaitingForDataRegistry(org.odk.collect.android.widgets.utilities.FormControllerWaitingForDataRegistry) BackgroundAudioViewModel(org.odk.collect.android.formentry.BackgroundAudioViewModel) IdentifyUserPromptDialogFragment(org.odk.collect.android.formentry.audit.IdentifyUserPromptDialogFragment) ToastUtils(org.odk.collect.androidshared.ui.ToastUtils) IAnswerData(org.javarosa.core.model.data.IAnswerData) FormIndexAnimationHandler(org.odk.collect.android.formentry.FormIndexAnimationHandler) View(android.view.View) ViewModelProviders(androidx.lifecycle.ViewModelProviders) Schedulers(io.reactivex.schedulers.Schedulers) Animation(android.view.animation.Animation) WebView(android.webkit.WebView) SwipeHandler(org.odk.collect.android.listeners.SwipeHandler) DialogFragmentUtils.showIfNotShowing(org.odk.collect.androidshared.ui.DialogFragmentUtils.showIfNotShowing) AudioControllerView(org.odk.collect.android.audio.AudioControllerView) FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) AsyncTask(android.os.AsyncTask) Direction(org.odk.collect.android.formentry.FormIndexAnimationHandler.Direction) AnimationUtils.loadAnimation(android.view.animation.AnimationUtils.loadAnimation) ScreenContext(org.odk.collect.android.utilities.ScreenContext) BroadcastReceiver(android.content.BroadcastReceiver) PlayServicesChecker(org.odk.collect.android.utilities.PlayServicesChecker) Timber(timber.log.Timber) BackgroundLocationViewModel(org.odk.collect.android.formentry.backgroundlocation.BackgroundLocationViewModel) Objects(java.util.Objects) LayoutParams(android.view.ViewGroup.LayoutParams) NumberPickerDialog(org.odk.collect.android.fragments.dialogs.NumberPickerDialog) CurrentProjectProvider(org.odk.collect.android.projects.CurrentProjectProvider) FormsRepositoryProvider(org.odk.collect.android.utilities.FormsRepositoryProvider) List(java.util.List) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) OPEN_MAP_KIT_RESPONSE(org.odk.collect.android.analytics.AnalyticsEvents.OPEN_MAP_KIT_RESPONSE) KEY_COMPLETED_DEFAULT(org.odk.collect.settings.keys.ProjectKeys.KEY_COMPLETED_DEFAULT) TextView(android.widget.TextView) SaveFormProgressDialogFragment(org.odk.collect.android.formentry.saving.SaveFormProgressDialogFragment) ProtectedProjectKeys(org.odk.collect.settings.keys.ProtectedProjectKeys) RelativeLayout(android.widget.RelativeLayout) Toolbar(androidx.appcompat.widget.Toolbar) FormLoadingDialogFragment(org.odk.collect.android.formentry.FormLoadingDialogFragment) NotNull(org.jetbrains.annotations.NotNull) LocationManager(android.location.LocationManager) Context(android.content.Context) ContextMenu(android.view.ContextMenu) SelectMinimalDialog(org.odk.collect.android.fragments.dialogs.SelectMinimalDialog) KeyEvent(android.view.KeyEvent) AlertDialog(androidx.appcompat.app.AlertDialog) DialogUtils.getDialog(org.odk.collect.android.utilities.DialogUtils.getDialog) WidgetValueChangedListener(org.odk.collect.android.listeners.WidgetValueChangedListener) Intent(android.content.Intent) MediaPlayer(android.media.MediaPlayer) HashMap(java.util.HashMap) AMRAppender(org.odk.collect.android.audio.AMRAppender) InstancesRepositoryProvider(org.odk.collect.android.utilities.InstancesRepositoryProvider) MenuItem(android.view.MenuItem) FragmentActivity(androidx.fragment.app.FragmentActivity) Inject(javax.inject.Inject) SavePointListener(org.odk.collect.android.listeners.SavePointListener) Form(org.odk.collect.forms.Form) LifecycleOwner(androidx.lifecycle.LifecycleOwner) FormEntryController(org.javarosa.form.api.FormEntryController) RecordingHandler(org.odk.collect.android.formentry.RecordingHandler) MotionEvent(android.view.MotionEvent) AuditEvent(org.odk.collect.android.formentry.audit.AuditEvent) BUTTON_NEGATIVE(android.content.DialogInterface.BUTTON_NEGATIVE) R(org.odk.collect.android.R) M4AAppender(org.odk.collect.android.audio.M4AAppender) ExternalAppIntentProvider(org.odk.collect.android.utilities.ExternalAppIntentProvider) Build(android.os.Build) RequestCodes(org.odk.collect.android.utilities.ApplicationConstants.RequestCodes) DialogInterface(android.content.DialogInterface) ToastUtils.showShortToast(org.odk.collect.androidshared.ui.ToastUtils.showShortToast) ProjectKeys(org.odk.collect.settings.keys.ProjectKeys) SelectChoice(org.javarosa.core.model.SelectChoice) RangePickerIntegerWidget(org.odk.collect.android.widgets.RangePickerIntegerWidget) AnimationListener(android.view.animation.Animation.AnimationListener) AnimationUtils.areAnimationsEnabled(org.odk.collect.android.utilities.AnimationUtils.areAnimationsEnabled) DateTime(org.joda.time.DateTime) FailedConstraint(org.odk.collect.android.javarosawrapper.FormController.FailedConstraint) WidgetDataReceiver(org.odk.collect.android.widgets.interfaces.WidgetDataReceiver) KEY_NAVIGATION(org.odk.collect.settings.keys.ProjectKeys.KEY_NAVIGATION) LocationProvidersDisabledDialog(org.odk.collect.android.fragments.dialogs.LocationProvidersDisabledDialog) QuestionWidget(org.odk.collect.android.widgets.QuestionWidget) MultiClickGuard(org.odk.collect.androidshared.ui.multiclicksafe.MultiClickGuard) ImmutableDisplayableQuestion(org.odk.collect.android.logic.ImmutableDisplayableQuestion) ViewModelAudioPlayer(org.odk.collect.android.widgets.utilities.ViewModelAudioPlayer) InstanceDeleter(org.odk.collect.android.instancemanagement.InstanceDeleter) Collect(org.odk.collect.android.application.Collect) FormEntryViewModel(org.odk.collect.android.formentry.FormEntryViewModel) ContentUriHelper(org.odk.collect.android.utilities.ContentUriHelper) Selection(org.javarosa.core.model.data.helper.Selection) SwipeHandler(org.odk.collect.android.listeners.SwipeHandler) FormIndexAnimationHandler(org.odk.collect.android.formentry.FormIndexAnimationHandler) MediaLoadingFragment(org.odk.collect.android.fragments.MediaLoadingFragment) WebView(android.webkit.WebView) FormEntryMenuDelegate(org.odk.collect.android.formentry.FormEntryMenuDelegate) RepeatsInFieldListException(org.odk.collect.android.javarosawrapper.RepeatsInFieldListException) JavaRosaException(org.odk.collect.android.exception.JavaRosaException)

Aggregations

FormEntryViewModel (org.odk.collect.android.formentry.FormEntryViewModel)4 ViewModelProvider (androidx.lifecycle.ViewModelProvider)3 BackgroundAudioViewModel (org.odk.collect.android.formentry.BackgroundAudioViewModel)3 NonNull (androidx.annotation.NonNull)2 File (java.io.File)2 Analytics (org.odk.collect.analytics.Analytics)2 AMRAppender (org.odk.collect.android.audio.AMRAppender)2 M4AAppender (org.odk.collect.android.audio.M4AAppender)2 RecordingHandler (org.odk.collect.android.formentry.RecordingHandler)2 IdentityPromptViewModel (org.odk.collect.android.formentry.audit.IdentityPromptViewModel)2 BackgroundLocationViewModel (org.odk.collect.android.formentry.backgroundlocation.BackgroundLocationViewModel)2 FormSaveViewModel (org.odk.collect.android.formentry.saving.FormSaveViewModel)2 ExternalAppRecordingRequester (org.odk.collect.android.widgets.utilities.ExternalAppRecordingRequester)2 FormControllerWaitingForDataRegistry (org.odk.collect.android.widgets.utilities.FormControllerWaitingForDataRegistry)2 InternalRecordingRequester (org.odk.collect.android.widgets.utilities.InternalRecordingRequester)2 AudioRecorder (org.odk.collect.audiorecorder.recording.AudioRecorder)2 PermissionsChecker (org.odk.collect.permissions.PermissionsChecker)2 Application (android.app.Application)1 BroadcastReceiver (android.content.BroadcastReceiver)1 Context (android.content.Context)1