// Clears board and restores it to default state public void clearButton(View view) { drawSpace.clearBoard(); if (!pausedState) { imgBtn.setImageResource(R.drawable.play); drawSpace.pauseLogic(); pausedState = true; } }
// Pause/play button, also starts and stops logic thread public void toggleButton(View view) { if (pausedState) { imgBtn.setImageResource(R.drawable.stop); drawSpace.startLogic(); pausedState = false; } else { imgBtn.setImageResource(R.drawable.play); drawSpace.pauseLogic(); pausedState = true; } }