Skip to content

Commit 1e92fc1

Browse files
author
Targholi
committed
add :core:network and use them in the app.
1 parent 8b1db56 commit 1e92fc1

File tree

14 files changed

+46
-13
lines changed

14 files changed

+46
-13
lines changed

.idea/gradle.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ android {
4141

4242
dependencies {
4343
implementation(project(":core:model"))
44+
implementation(project(":core:network"))
4445

4546
implementation(libs.coreKtx)
4647
implementation(libs.appcompat)
@@ -71,8 +72,6 @@ dependencies {
7172
implementation(libs.hilt.android)
7273
kapt(libs.hilt.compiler)
7374
kapt(libs.hilt.ext.compiler)
74-
// implementation("androidx.hilt:hilt-lifecycle-viewmodel:1.0.0")
75-
// implementation("androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03")
7675

7776
implementation(libs.glide)
7877
implementation(libs.glide.compiler)

app/src/main/java/com/milad/githoob/data/MainRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.milad.githoob.data
22

3-
import com.milad.githoob.data.api.ApiService
43
import com.milad.githoob.utils.AppConstants.URL_access_token
54
import com.milad.githoob.utils.SafeApiRequest
5+
import com.milad.network.api.ApiService
66
import javax.inject.Inject
77

88
class MainRepository @Inject constructor(

app/src/main/java/com/milad/githoob/data/model/type/EventTypeEnum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import com.milad.githoob.R;
1010

11-
public enum EventType {
11+
enum EventTypeEnum {
1212
WatchEvent(R.string.starred, R.drawable.ic_star),
1313
CreateEvent(R.string.created_repo, R.drawable.ic_repo),
1414
ForkEvent(R.string.forked2, R.drawable.ic_fork),
@@ -43,7 +43,7 @@ public enum EventType {
4343
int drawableRes;
4444

4545

46-
EventType(@StringRes int type, @DrawableRes int drawableRes) {
46+
EventTypeEnum(@StringRes int type, @DrawableRes int drawableRes) {
4747
this.type = type;
4848
this.drawableRes = drawableRes;
4949
}

app/src/main/java/com/milad/githoob/di/DataRepositoryModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import androidx.datastore.preferences.core.PreferenceDataStoreFactory
66
import androidx.datastore.preferences.core.Preferences
77
import androidx.datastore.preferences.preferencesDataStoreFile
88
import com.milad.githoob.data.MainRepository
9-
import com.milad.githoob.data.api.ApiService
9+
import com.milad.network.api.ApiService
1010
import com.milad.githoob.utils.AppConstants.PREFERENCES_STORE_NAME
1111
import dagger.Module
1212
import dagger.Provides

app/src/main/java/com/milad/githoob/di/NetworkModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.milad.githoob.di
22

33
import com.milad.githoob.utils.AppConstants.BASE_URL_API
4-
import com.milad.githoob.data.api.ApiService
4+
import com.milad.network.api.ApiService
55
import dagger.Module
66
import dagger.Provides
77
import dagger.hilt.InstallIn

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins {
1313
alias(libs.plugins.kotlin.jvm) apply false
1414
alias(libs.plugins.hilt) apply false
1515
alias(libs.plugins.safearges) apply false
16+
alias(libs.plugins.android.kotlin) apply false
1617
}
1718

1819
tasks {

core/model/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ plugins {
33
id("kotlin")
44
}
55

6-
dependencies {
7-
8-
// implementation("androidx.core:core-ktx:1.7.0")
9-
}
6+
dependencies {}

core/network/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

core/network/build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@Suppress("DSL_SCOPE_VIOLATION")
2+
plugins {
3+
id("com.android.library")
4+
id("kotlin-android")
5+
id("kotlin-kapt")
6+
id("dagger.hilt.android.plugin")
7+
}
8+
9+
android {
10+
namespace = "com.milad.network"
11+
compileSdk = 31
12+
}
13+
14+
dependencies {
15+
implementation(project(":core:model"))
16+
17+
implementation(libs.hilt.android)
18+
kapt(libs.hilt.compiler)
19+
kapt(libs.hilt.ext.compiler)
20+
21+
implementation(libs.gson)
22+
implementation(libs.retrofit)
23+
implementation(libs.retrofitGson)
24+
implementation(libs.okhttpLogging)
25+
}

0 commit comments

Comments
 (0)