Link Android back button to undo
This commit is contained in:
@ -126,6 +126,15 @@ class MatchActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (matchModel?.playId == 0)
|
||||||
|
super.onBackPressed()
|
||||||
|
else {
|
||||||
|
matchModel?.undo()
|
||||||
|
updateUI()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun updateUI() {
|
fun updateUI() {
|
||||||
matchModel?.apply {
|
matchModel?.apply {
|
||||||
undo?.isVisible = when (playId) {
|
undo?.isVisible = when (playId) {
|
||||||
|
Reference in New Issue
Block a user