Пример #1
0
 // 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;
   }
 }
Пример #2
0
 // 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;
   }
 }