From 9dcc8e35ad4c39791238933a6f23564180f33c6e Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Sun, 11 Oct 2020 19:46:46 -0300 Subject: [PATCH] Save control on cloud --- .../dev/lucasnlm/antimine/control/ControlDialogFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt b/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt index e0facfd9..8340533f 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt +++ b/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt @@ -9,14 +9,17 @@ import android.widget.BaseAdapter import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatDialogFragment import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.cloud.CloudSaveManager import dev.lucasnlm.antimine.control.view.ControlItemView import dev.lucasnlm.antimine.control.view.SimpleControlItemView import dev.lucasnlm.antimine.control.viewmodel.ControlEvent import dev.lucasnlm.antimine.control.viewmodel.ControlViewModel import dev.lucasnlm.antimine.core.control.ControlStyle +import org.koin.android.ext.android.inject import org.koin.androidx.viewmodel.ext.android.viewModel class ControlDialogFragment : AppCompatDialogFragment() { + private val cloudSaveManager by inject() private val controlViewModel by viewModel() private val adapter by lazy { ControlListAdapter(controlViewModel) } @@ -33,6 +36,7 @@ class ControlDialogFragment : AppCompatDialogFragment() { if (activity is DialogInterface.OnDismissListener) { (activity as DialogInterface.OnDismissListener).onDismiss(dialog) } + cloudSaveManager.uploadSave() super.onDismiss(dialog) }