Search in sources :

Example 1 with JsonPageDeserializer

use of org.edx.mobile.http.serialization.JsonPageDeserializer in project edx-app-android by edx.

the class EdxDefaultModule method configure.

@Override
public void configure() {
    Config config = new Config(context);
    bind(IDatabase.class).to(IDatabaseImpl.class);
    bind(IDownloadManager.class).to(IDownloadManagerImpl.class);
    bind(NotificationDelegate.class).to(DummyNotificationDelegate.class);
    bind(IEdxEnvironment.class).to(EdxEnvironment.class);
    bind(LinearLayoutManager.class).toProvider(LinearLayoutManagerProvider.class);
    bind(EventBus.class).toInstance(EventBus.getDefault());
    bind(Gson.class).toInstance(new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).registerTypeAdapterFactory(ISO8601DateTypeAdapter.FACTORY).registerTypeAdapter(Page.class, new JsonPageDeserializer()).registerTypeAdapter(BlockData.class, new BlockData.Deserializer()).registerTypeAdapter(BlockType.class, new BlockType.Deserializer()).registerTypeAdapter(BlockList.class, new BlockList.Deserializer()).serializeNulls().create());
    bind(OkHttpClientProvider.class).to(OkHttpClientProvider.Impl.class);
    bind(RetrofitProvider.class).to(RetrofitProvider.Impl.class);
    bind(OkHttpClient.class).toProvider(OkHttpClientProvider.Impl.class).in(Singleton.class);
    bind(Retrofit.class).toProvider(RetrofitProvider.Impl.class).in(Singleton.class);
    bind(LoginService.class).toProvider(LoginService.Provider.class).in(Singleton.class);
    bind(CourseService.class).toProvider(CourseService.Provider.class).in(Singleton.class);
    bind(DiscussionService.class).toProvider(DiscussionService.Provider.class).in(Singleton.class);
    bind(UserService.class).toProvider(UserService.Provider.class).in(Singleton.class);
    bind(IStorage.class).to(Storage.class);
    requestStaticInjection(CallUtil.class, BrowserUtil.class, MediaConsentUtils.class, DiscussionTextUtils.class, AppStoreUtils.class);
}
Also used : IDownloadManagerImpl(org.edx.mobile.module.download.IDownloadManagerImpl) IDatabaseImpl(org.edx.mobile.module.db.impl.IDatabaseImpl) IDatabase(org.edx.mobile.module.db.IDatabase) GsonBuilder(com.google.gson.GsonBuilder) BlockList(org.edx.mobile.model.course.BlockList) Config(org.edx.mobile.util.Config) DummyNotificationDelegate(org.edx.mobile.module.notification.DummyNotificationDelegate) NotificationDelegate(org.edx.mobile.module.notification.NotificationDelegate) Gson(com.google.gson.Gson) EventBus(de.greenrobot.event.EventBus) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RetrofitProvider(org.edx.mobile.http.provider.RetrofitProvider) IStorage(org.edx.mobile.module.storage.IStorage) OkHttpClientProvider(org.edx.mobile.http.provider.OkHttpClientProvider) RetrofitProvider(org.edx.mobile.http.provider.RetrofitProvider) BlockType(org.edx.mobile.model.course.BlockType) JsonPageDeserializer(org.edx.mobile.http.serialization.JsonPageDeserializer) JsonPageDeserializer(org.edx.mobile.http.serialization.JsonPageDeserializer) OkHttpClientProvider(org.edx.mobile.http.provider.OkHttpClientProvider) IDownloadManager(org.edx.mobile.module.download.IDownloadManager) BlockData(org.edx.mobile.model.course.BlockData)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 Gson (com.google.gson.Gson)1 GsonBuilder (com.google.gson.GsonBuilder)1 EventBus (de.greenrobot.event.EventBus)1 OkHttpClientProvider (org.edx.mobile.http.provider.OkHttpClientProvider)1 RetrofitProvider (org.edx.mobile.http.provider.RetrofitProvider)1 JsonPageDeserializer (org.edx.mobile.http.serialization.JsonPageDeserializer)1 BlockData (org.edx.mobile.model.course.BlockData)1 BlockList (org.edx.mobile.model.course.BlockList)1 BlockType (org.edx.mobile.model.course.BlockType)1 IDatabase (org.edx.mobile.module.db.IDatabase)1 IDatabaseImpl (org.edx.mobile.module.db.impl.IDatabaseImpl)1 IDownloadManager (org.edx.mobile.module.download.IDownloadManager)1 IDownloadManagerImpl (org.edx.mobile.module.download.IDownloadManagerImpl)1 DummyNotificationDelegate (org.edx.mobile.module.notification.DummyNotificationDelegate)1 NotificationDelegate (org.edx.mobile.module.notification.NotificationDelegate)1 IStorage (org.edx.mobile.module.storage.IStorage)1 Config (org.edx.mobile.util.Config)1