Save control on cloud

This commit is contained in:
Lucas Lima 2020-10-11 19:46:46 -03:00
parent 049d12304a
commit 9dcc8e35ad

View file

@ -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<CloudSaveManager>()
private val controlViewModel by viewModel<ControlViewModel>()
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)
}