Specify LazyThreadSafetyMode for inject and viewModel delegates

This commit is contained in:
Koitharu
2021-04-27 19:52:20 +03:00
parent 2da941d550
commit 49eebdf554
26 changed files with 32 additions and 31 deletions

View File

@@ -23,7 +23,7 @@ import org.koitharu.kotatsu.utils.ext.viewLifecycleScope
class HistorySettingsFragment : BasePreferenceFragment(R.string.history_and_cache) {
private val trackerRepo by inject<TrackingRepository>()
private val trackerRepo by inject<TrackingRepository>(mode = LazyThreadSafetyMode.NONE)
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_history)

View File

@@ -17,7 +17,7 @@ import java.io.File
class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
private val viewModel by viewModel<BackupViewModel>()
private val viewModel by viewModel<BackupViewModel>(mode = LazyThreadSafetyMode.NONE)
override fun onInflateView(
inflater: LayoutInflater,

View File

@@ -25,7 +25,7 @@ class RestoreDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
container: ViewGroup?
) = DialogProgressBinding.inflate(inflater, container, false)
private val viewModel by viewModel<RestoreViewModel> {
private val viewModel by viewModel<RestoreViewModel>(mode = LazyThreadSafetyMode.NONE) {
parametersOf(arguments?.getString(ARG_FILE)?.toUriOrNull())
}

View File

@@ -17,7 +17,7 @@ import org.koitharu.kotatsu.databinding.ActivitySetupProtectBinding
class ProtectSetupActivity : BaseActivity<ActivitySetupProtectBinding>(), TextWatcher,
View.OnClickListener, TextView.OnEditorActionListener {
private val viewModel by viewModel<ProtectSetupViewModel>()
private val viewModel by viewModel<ProtectSetupViewModel>(mode = LazyThreadSafetyMode.NONE)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)