Created
June 27, 2017 13:39
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.base.di.module | |
import android.app.Application | |
import android.content.res.Resources | |
import dagger.Module | |
import dagger.Provides | |
import javax.inject.Singleton | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder | |
/** | |
* Created by Burak Eregar on 19.05.2017. | |
* burakeregar@gmail.com | |
* https://github.com/burakeregar | |
*/ | |
@Module | |
class AppModule(val application: Application) { | |
@Provides | |
@Singleton | |
fun providesGson(): Gson = GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create() | |
@Provides | |
@Singleton | |
fun providesApplication(): Application = application | |
@Provides | |
@Singleton | |
fun providesResources(): Resources = application.resources | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment