Link Android back button to undo
This commit is contained in:
1 parent
b92b0acd89
commit
04f388bc1e
1 file changed
+9
@@ -126,6 +126,15 @@ class MatchActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (matchModel?.playId == 0)
|
||||
super.onBackPressed()
|
||||
else {
|
||||
matchModel?.undo()
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
|
||||
fun updateUI() {
|
||||
matchModel?.apply {
|
||||
undo?.isVisible = when (playId) {
|
||||
|
||||
Reference in new issue
Block a user