Back to project page vocabulary-list.
The source code is released under:
Apache License
If you think the Android project vocabulary-list listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.rulych.vocabularylist.model.persistence; /*from w ww . j a va2 s. c o m*/ import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.drive.DriveFile; import com.google.gson.Gson; import com.rulych.vocabularylist.model.persistence.impl.CardDAOImpl; import com.rulych.vocabularylist.model.persistence.impl.CardListReader; import com.rulych.vocabularylist.model.persistence.impl.CardListReaderImpl; import com.rulych.vocabularylist.model.persistence.impl.CardListWriter; import com.rulych.vocabularylist.model.persistence.impl.CardListWriterImpl; import com.rulych.vocabularylist.model.persistence.impl.FileGetter; import com.rulych.vocabularylist.model.persistence.impl.FileGetterImpl; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Module( complete = false, library = true ) public class PersistenceModule { @Provides @Singleton CardDAO provideCardDAO(CardDAOImpl cardDAO) { return cardDAO; } @Provides FileGetter.Factory provideFileGetterFactory() { return new FileGetter.Factory() { @Override public FileGetter create(GoogleApiClient apiClient) { return new FileGetterImpl(apiClient); } }; } @Provides Gson provideGson() { return new Gson(); } @Provides CardListReader.Factory provideReaderFactory(final Gson gson) { return new CardListReader.Factory() { @Override public CardListReader create(GoogleApiClient apiClient, DriveFile driveFile) { return new CardListReaderImpl(gson, apiClient, driveFile); } }; } @Provides CardListWriter.Factory provideWriterFactory(final Gson gson) { return new CardListWriter.Factory() { @Override public CardListWriter create(GoogleApiClient apiClient, DriveFile driveFile) { return new CardListWriterImpl(gson, apiClient, driveFile); } }; } }