|
@ -4,6 +4,7 @@ import android.os.Bundle |
|
|
import android.util.Log |
|
|
import android.util.Log |
|
|
import androidx.lifecycle.* |
|
|
import androidx.lifecycle.* |
|
|
import androidx.savedstate.SavedStateRegistryOwner |
|
|
import androidx.savedstate.SavedStateRegistryOwner |
|
|
|
|
|
import awais.instagrabber.db.repositories.AccountRepository |
|
|
import awais.instagrabber.repositories.responses.User |
|
|
import awais.instagrabber.repositories.responses.User |
|
|
import awais.instagrabber.utils.extensions.TAG |
|
|
import awais.instagrabber.utils.extensions.TAG |
|
|
import awais.instagrabber.webservices.* |
|
|
import awais.instagrabber.webservices.* |
|
@ -15,6 +16,7 @@ class ProfileFragmentViewModel( |
|
|
storiesRepository: StoriesRepository, |
|
|
storiesRepository: StoriesRepository, |
|
|
mediaRepository: MediaRepository, |
|
|
mediaRepository: MediaRepository, |
|
|
graphQLRepository: GraphQLRepository, |
|
|
graphQLRepository: GraphQLRepository, |
|
|
|
|
|
accountRepository: AccountRepository, |
|
|
) : ViewModel() { |
|
|
) : ViewModel() { |
|
|
private val _profile = MutableLiveData<User?>() |
|
|
private val _profile = MutableLiveData<User?>() |
|
|
val profile: LiveData<User?> = _profile |
|
|
val profile: LiveData<User?> = _profile |
|
@ -37,6 +39,7 @@ class ProfileFragmentViewModelFactory( |
|
|
private val storiesRepository: StoriesRepository, |
|
|
private val storiesRepository: StoriesRepository, |
|
|
private val mediaRepository: MediaRepository, |
|
|
private val mediaRepository: MediaRepository, |
|
|
private val graphQLRepository: GraphQLRepository, |
|
|
private val graphQLRepository: GraphQLRepository, |
|
|
|
|
|
private val accountRepository: AccountRepository, |
|
|
owner: SavedStateRegistryOwner, |
|
|
owner: SavedStateRegistryOwner, |
|
|
defaultArgs: Bundle? = null, |
|
|
defaultArgs: Bundle? = null, |
|
|
) : AbstractSavedStateViewModelFactory(owner, defaultArgs) { |
|
|
) : AbstractSavedStateViewModelFactory(owner, defaultArgs) { |
|
@ -52,6 +55,7 @@ class ProfileFragmentViewModelFactory( |
|
|
storiesRepository, |
|
|
storiesRepository, |
|
|
mediaRepository, |
|
|
mediaRepository, |
|
|
graphQLRepository, |
|
|
graphQLRepository, |
|
|
|
|
|
accountRepository, |
|
|
) as T |
|
|
) as T |
|
|
} |
|
|
} |
|
|
} |
|
|
} |