Fixed back button not working on flash screen

This commit is contained in:
Viktor De Pasquale 2019-10-07 12:04:41 +02:00 committed by John Wu
parent d6c2c821a4
commit 751642b39a

View File

@ -11,6 +11,8 @@ import com.topjohnwu.magisk.Const
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.base.BaseActivity
import com.topjohnwu.magisk.databinding.ActivityFlashBinding
import com.topjohnwu.magisk.model.events.BackPressEvent
import com.topjohnwu.magisk.model.events.ViewEvent
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.parameter.parametersOf
import java.io.File
@ -37,6 +39,13 @@ open class FlashActivity : BaseActivity<FlashViewModel, ActivityFlashBinding>()
super.onBackPressed()
}
override fun onEventDispatched(event: ViewEvent) {
super.onEventDispatched(event)
when (event) {
is BackPressEvent -> onBackPressed()
}
}
companion object {
private fun intent(context: Context) = Intent(context, ClassMap[FlashActivity::class.java])