add dagger hilt android deps

This commit is contained in:
Satindar Dhillon
2022-08-10 13:42:25 -07:00
parent db6561af1a
commit 3d54da13a0
5 changed files with 26 additions and 4 deletions

View File

@ -1,6 +1,8 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
android {
@ -101,5 +103,17 @@ dependencies {
implementation "androidx.security:security-crypto:1.0.0"
implementation "androidx.datastore:datastore-preferences:1.0.0"
// Activity KTX for viewModels()
// TODO: remove this since compose-activity imports ktx?
// implementation "androidx.activity:activity-ktx:1.3.1"
//Dagger - Hilt
implementation 'com.google.dagger:hilt-android:2.43.2'
kapt 'com.google.dagger:hilt-compiler:2.43.2'
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03'
}

View File

@ -0,0 +1,5 @@
package app.omnivore.omnivore
object Constants {
const val serverProdURL = "https://api-demo.omnivore.app"
}

View File

@ -64,7 +64,6 @@ fun LoginView(viewModel: LoginViewModel = LoginViewModel()) {
}
}
//Log.v(TAG, "${numerator / denominator}")
@Composable
fun LoginFields(
email: String,

View File

@ -26,10 +26,8 @@ interface EmailLoginSubmit {
}
object RetrofitHelper {
private const val baseUrl = "https://api-demo.omnivore.app"
fun getInstance(): Retrofit {
return Retrofit.Builder().baseUrl(baseUrl)
return Retrofit.Builder().baseUrl(Constants.serverProdURL)
.addConverterFactory(GsonConverterFactory.create())
.build()
}

View File

@ -3,6 +3,11 @@ buildscript {
compose_version = '1.1.0-beta01'
lifecycle_version = '2.5.1'
}
dependencies {
classpath "com.google.dagger:hilt-android-gradle-plugin:2.43.2"
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
@ -13,3 +18,4 @@ plugins {
task clean(type: Delete) {
delete rootProject.buildDir
}