Search in sources :

Example 1 with AudioHelperFactory

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

the class SelectOneWidgetTest method overrideDependencyModule.

private void overrideDependencyModule() throws Exception {
    ReferenceManager referenceManager = setupFakeReferenceManager(REFERENCES);
    CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {

        @Override
        public ReferenceManager providesReferenceManager() {
            return referenceManager;
        }

        @Override
        public AudioHelperFactory providesAudioHelperFactory(Scheduler scheduler) {
            return context -> audioHelper;
        }

        @Override
        public Analytics providesAnalytics(Application application) {
            return analytics;
        }

        @Override
        public SoftKeyboardController provideSoftKeyboardController() {
            return mock(SoftKeyboardController.class);
        }
    });
}
Also used : AudioHelperFactory(org.odk.collect.android.formentry.media.AudioHelperFactory) Scheduler(org.odk.collect.async.Scheduler) AppDependencyModule(org.odk.collect.android.injection.config.AppDependencyModule) SoftKeyboardController(org.odk.collect.android.utilities.SoftKeyboardController) Application(android.app.Application) Analytics(org.odk.collect.analytics.Analytics) CollectHelpers.setupFakeReferenceManager(org.odk.collect.android.support.CollectHelpers.setupFakeReferenceManager) ReferenceManager(org.javarosa.core.reference.ReferenceManager)

Example 2 with AudioHelperFactory

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

the class SelectMultiWidgetTest method overrideDependencyModule.

private void overrideDependencyModule() throws Exception {
    ReferenceManager referenceManager = setupFakeReferenceManager(REFERENCES);
    CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {

        @Override
        public ReferenceManager providesReferenceManager() {
            return referenceManager;
        }

        @Override
        public AudioHelperFactory providesAudioHelperFactory(Scheduler scheduler) {
            return context -> audioHelper;
        }

        @Override
        public Analytics providesAnalytics(Application application) {
            return analytics;
        }

        @Override
        public SoftKeyboardController provideSoftKeyboardController() {
            return mock(SoftKeyboardController.class);
        }
    });
}
Also used : AudioHelperFactory(org.odk.collect.android.formentry.media.AudioHelperFactory) Scheduler(org.odk.collect.async.Scheduler) AppDependencyModule(org.odk.collect.android.injection.config.AppDependencyModule) SoftKeyboardController(org.odk.collect.android.utilities.SoftKeyboardController) Application(android.app.Application) Analytics(org.odk.collect.analytics.Analytics) CollectHelpers.setupFakeReferenceManager(org.odk.collect.android.support.CollectHelpers.setupFakeReferenceManager) ReferenceManager(org.javarosa.core.reference.ReferenceManager)

Example 3 with AudioHelperFactory

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

the class QuestionWidgetTest method overrideDependencyModule.

private void overrideDependencyModule() throws Exception {
    ReferenceManager referenceManager = setupFakeReferenceManager(asList(new Pair<>("ref", "blah.mp3")));
    CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {

        @Override
        public ReferenceManager providesReferenceManager() {
            return referenceManager;
        }

        @Override
        public AudioHelperFactory providesAudioHelperFactory(Scheduler scheduler) {
            return context -> audioHelper;
        }

        @Override
        public Analytics providesAnalytics(Application application) {
            return analytics;
        }
    });
}
Also used : AudioHelperFactory(org.odk.collect.android.formentry.media.AudioHelperFactory) Scheduler(org.odk.collect.async.Scheduler) AppDependencyModule(org.odk.collect.android.injection.config.AppDependencyModule) Application(android.app.Application) Analytics(org.odk.collect.analytics.Analytics) CollectHelpers.setupFakeReferenceManager(org.odk.collect.android.support.CollectHelpers.setupFakeReferenceManager) ReferenceManager(org.javarosa.core.reference.ReferenceManager) Pair(androidx.core.util.Pair)

Aggregations

Application (android.app.Application)3 ReferenceManager (org.javarosa.core.reference.ReferenceManager)3 Analytics (org.odk.collect.analytics.Analytics)3 AudioHelperFactory (org.odk.collect.android.formentry.media.AudioHelperFactory)3 AppDependencyModule (org.odk.collect.android.injection.config.AppDependencyModule)3 CollectHelpers.setupFakeReferenceManager (org.odk.collect.android.support.CollectHelpers.setupFakeReferenceManager)3 Scheduler (org.odk.collect.async.Scheduler)3 SoftKeyboardController (org.odk.collect.android.utilities.SoftKeyboardController)2 Pair (androidx.core.util.Pair)1