File tree Expand file tree Collapse file tree
app/src/main/java/com/owncloud/android/ui/activity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import kotlinx.coroutines.Dispatchers
3636import kotlinx.coroutines.delay
3737import kotlinx.coroutines.launch
3838import javax.inject.Inject
39+ import androidx.activity.OnBackPressedCallback
3940
4041@Suppress(" TooManyFunctions" , " MagicNumber" )
4142class PassCodeActivity :
@@ -90,6 +91,20 @@ class PassCodeActivity :
9091 setSoftInputMode()
9192 setupUI(savedInstanceState)
9293 setTextListeners()
94+ handleOnBackPressed()
95+ }
96+
97+ private fun handleOnBackPressed () {
98+ onBackPressedDispatcher.addCallback(
99+ this ,
100+ object : OnBackPressedCallback (true ) {
101+ override fun handleOnBackPressed () {
102+ if (intent.action == ACTION_CHECK ) return
103+ isEnabled = false
104+ onBackPressedDispatcher.onBackPressed()
105+ }
106+ }
107+ )
93108 }
94109
95110 private fun applyTint () {
You can’t perform that action at this time.
0 commit comments