-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
97 additions
and
286 deletions.
There are no files selected for viewing
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
18 changes: 4 additions & 14 deletions
18
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/application/MVVMTemplateApplication.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
package app.web.drjackycv.mvvmtemplate.application | ||
|
||
import android.content.Context | ||
import androidx.multidex.MultiDex | ||
import app.web.drjackycv.mvvmtemplate.di.component.DaggerAppComponent | ||
import dagger.android.AndroidInjector | ||
import dagger.android.support.DaggerApplication | ||
import androidx.multidex.MultiDexApplication | ||
import dagger.hilt.android.HiltAndroidApp | ||
import timber.log.Timber | ||
|
||
class MVVMTemplateApplication : DaggerApplication() { | ||
@HiltAndroidApp | ||
class MVVMTemplateApplication : MultiDexApplication() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
Timber.plant(Timber.DebugTree()) | ||
} | ||
|
||
override fun applicationInjector(): AndroidInjector<out DaggerApplication> = | ||
DaggerAppComponent.builder().application(this).build() | ||
|
||
override fun attachBaseContext(base: Context) { | ||
super.attachBaseContext(base) | ||
MultiDex.install(this) | ||
} | ||
|
||
} |
34 changes: 0 additions & 34 deletions
34
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/component/AppComponent.kt
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/module/ActivityModule.kt
This file was deleted.
Oops, something went wrong.
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
21 changes: 16 additions & 5 deletions
21
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/module/AppModule.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
package app.web.drjackycv.mvvmtemplate.di.module | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import android.content.res.Resources | ||
import app.web.drjackycv.mvvmtemplate.application.MVVMTemplateApplication | ||
import app.web.drjackycv.data.network.BaseHttpClient | ||
import app.web.drjackycv.data.network.BaseRetrofit | ||
import com.google.gson.Gson | ||
import com.google.gson.GsonBuilder | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ApplicationComponent | ||
import okhttp3.OkHttpClient | ||
import retrofit2.Retrofit | ||
import javax.inject.Singleton | ||
|
||
@InstallIn(ApplicationComponent::class) | ||
@Module | ||
class AppModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideApplication(application: MVVMTemplateApplication): Application = application | ||
fun resources(application: Application): Resources = application.resources | ||
|
||
@Provides | ||
@Singleton | ||
fun provideContext(application: Application): Context = application | ||
fun gson(): Gson = GsonBuilder().create() | ||
|
||
@Provides | ||
@Singleton | ||
fun resources(application: Application): Resources = application.resources | ||
fun okHttpClient(baseHttpClient: BaseHttpClient): OkHttpClient = baseHttpClient.okHttpClient | ||
|
||
@Provides | ||
@Singleton | ||
fun retrofit(baseRetrofit: BaseRetrofit): Retrofit = baseRetrofit.retrofit | ||
|
||
} |
12 changes: 0 additions & 12 deletions
12
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/module/DataModule.kt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/module/FragmentModule.kt
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/module/NetModule.kt
This file was deleted.
Oops, something went wrong.
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
23 changes: 0 additions & 23 deletions
23
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/module/ViewModelModule.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/scope/PerView.kt
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/viewmodel/ViewModelFactory.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
app/src/main/kotlin/app/web/drjackycv/mvvmtemplate/di/viewmodel/ViewModelKey.kt
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.