예제 #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;
   }
 }
예제 #3
0
 // Destructor
 @Override
 protected void onDestroy() {
   super.onDestroy();
   drawSpace.killThreads();
 }