Skip to content

Commit

Permalink
Merge pull request #13562 from wordpress-mobile/fix/backup-download-vm
Browse files Browse the repository at this point in the history
Fix viewmodelproviders
  • Loading branch information
malinajirka authored Dec 8, 2020
2 parents b90ec72 + 6e97ba9 commit 3fb1a44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.wordpress.android.ui.jetpack.backup
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelProviders
import kotlinx.android.synthetic.main.backup_download_activity.*
import org.wordpress.android.R
import org.wordpress.android.WordPress
Expand Down Expand Up @@ -31,7 +30,7 @@ class BackupDownloadActivity : LocaleAwareActivity() {
}

private fun setupViewModel() {
viewModel = ViewModelProviders.of(this, viewModelFactory)
viewModel = ViewModelProvider(this, viewModelFactory)
.get(BackupDownloadViewModel::class.java)
viewModel.start()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelProviders
import org.wordpress.android.R
import org.wordpress.android.WordPress
import org.wordpress.android.ui.jetpack.backup.BackupDownloadViewModel
Expand All @@ -30,10 +29,10 @@ class BackupDownloadDetailsFragment : Fragment() {
val nonNullActivity = requireActivity()
(nonNullActivity.application as WordPress).component().inject(this)

parentViewModel = ViewModelProviders.of(requireActivity(), viewModelFactory)
parentViewModel = ViewModelProvider(requireActivity(), viewModelFactory)
.get(BackupDownloadViewModel::class.java)

viewModel = ViewModelProviders.of(this, viewModelFactory)
viewModel = ViewModelProvider(this, viewModelFactory)
.get(BackupDownloadDetailsViewModel::class.java)

setupViews()
Expand Down

0 comments on commit 3fb1a44

Please sign in to comment.