Skip to content

Commit dc7e6ac

Browse files
committed
add :core:network and :core:model module.
⚡ (Circular dependency)
1 parent 78b8c25 commit dc7e6ac

File tree

83 files changed

+589
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+589
-435
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.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ android {
4141

4242
dependencies {
4343

44+
implementation(project(":core:network"))
45+
4446
implementation(libs.coreKtx)
4547
implementation(libs.appcompat)
4648
implementation(libs.material)
@@ -62,10 +64,10 @@ dependencies {
6264

6365
implementation(libs.activity)
6466
implementation(libs.lifecycleArch)
65-
implementation(libs.gson)
66-
implementation(libs.retrofit)
67-
implementation(libs.retrofitGson)
68-
implementation(libs.okhttpLogging)
67+
// implementation(libs.gson)
68+
// implementation(libs.retrofit)
69+
// implementation(libs.retrofitGson)
70+
// implementation(libs.okhttpLogging)
6971

7072
implementation(libs.hilt.android)
7173
kapt(libs.hilt.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,6 +1,6 @@
11
package com.milad.githoob.data
22

3-
import com.milad.githoob.data.api.ApiService
3+
import com.milad.network.api.ApiService
44
import com.milad.githoob.utils.AppConstants.URL_access_token
55
import com.milad.githoob.utils.SafeApiRequest
66
import javax.inject.Inject

app/src/main/java/com/milad/githoob/data/model/event/Forkee.kt

Lines changed: 0 additions & 104 deletions
This file was deleted.

app/src/main/java/com/milad/githoob/data/model/event/Repo.kt

Lines changed: 0 additions & 80 deletions
This file was deleted.

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

app/src/main/java/com/milad/githoob/ui/profile/ProfileViewModel.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.milad.githoob.ui.profile
22

33
import androidx.lifecycle.*
44
import com.milad.githoob.data.MainRepository
5-
import com.milad.githoob.data.model.User
5+
import com.milad.model.User
66
import com.milad.githoob.utils.AppConstants
77
import com.milad.githoob.utils.Result
88
import com.milad.githoob.utils.Status
@@ -29,7 +29,7 @@ class ProfileViewModel @Inject constructor(
2929
private val _forceUpdate = MutableLiveData(false)
3030
private val _dataLoading = MutableLiveData(true)
3131
private val _user = Transformations.switchMap(_forceUpdate) { bool ->
32-
val user = MutableLiveData<User>()
32+
val user = MutableLiveData<com.milad.model.User>()
3333
if (bool) {
3434
viewModelScope.launch(ioDispatcher) {
3535

@@ -79,7 +79,7 @@ class ProfileViewModel @Inject constructor(
7979
}
8080

8181
val dataLoading: LiveData<Boolean> = _dataLoading
82-
val user: LiveData<User?> = _user
82+
val user: LiveData<com.milad.model.User?> = _user
8383
val userContributes: LiveData<List<ContributionsDay>> = Transformations.switchMap(_user) {
8484
val list = MutableLiveData<List<ContributionsDay>>()
8585

@@ -110,7 +110,7 @@ class ProfileViewModel @Inject constructor(
110110
_forceUpdate.value = true
111111
}
112112

113-
private suspend fun getUserInfo(token: String, userId: String): Flow<Result<User>> {
113+
private suspend fun getUserInfo(token: String, userId: String): Flow<Result<com.milad.model.User>> {
114114
if (token != "")
115115
return mainRepository.getAuthenticatedUser(token)
116116
if (userId != "")

app/src/main/java/com/milad/githoob/ui/profile/connection/ConnectionBinding.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import android.view.View
44
import androidx.databinding.BindingAdapter
55
import androidx.recyclerview.widget.RecyclerView
66
import com.milad.githoob.R
7-
import com.milad.githoob.data.model.User
7+
import com.milad.model.User
88
import com.milad.githoob.utils.mixTwoColors
99

1010
@BindingAdapter("connection_items")
1111
fun setConnectionItems(
1212
recyclerView: RecyclerView,
13-
items: List<User>?
13+
items: List<com.milad.model.User>?
1414
) {
1515
items?.let {
1616
(recyclerView.adapter as ConnectionsRecyclerviewAdapter).submitList(items)

0 commit comments

Comments
 (0)