diff --git a/app/src/main/java/tonio/noa/TutorialScene1Activity.java b/app/src/main/java/tonio/noa/TutorialScene1Activity.java index 68668a3..acd7b4d 100644 --- a/app/src/main/java/tonio/noa/TutorialScene1Activity.java +++ b/app/src/main/java/tonio/noa/TutorialScene1Activity.java @@ -12,7 +12,6 @@ public class TutorialScene1Activity extends MyPlayActivity{ @Override protected void next() { startActivity(new Intent(this, TutorialScene2Activity.class)); - finish(); } @Override diff --git a/app/src/main/java/tonio/noa/TutorialScene2Activity.java b/app/src/main/java/tonio/noa/TutorialScene2Activity.java index 683619f..9770533 100644 --- a/app/src/main/java/tonio/noa/TutorialScene2Activity.java +++ b/app/src/main/java/tonio/noa/TutorialScene2Activity.java @@ -88,7 +88,6 @@ public class TutorialScene2Activity extends MyPlayActivity implements View.OnTou @Override protected void next() { startActivity(new Intent(this, TutorialScene3Activity.class)); - finish(); } } diff --git a/app/src/main/java/tonio/noa/TutorialScene3Activity.java b/app/src/main/java/tonio/noa/TutorialScene3Activity.java index ca14bee..e17248a 100644 --- a/app/src/main/java/tonio/noa/TutorialScene3Activity.java +++ b/app/src/main/java/tonio/noa/TutorialScene3Activity.java @@ -14,6 +14,8 @@ import android.widget.ImageView; public class TutorialScene3Activity extends MyPlayActivity implements View.OnTouchListener, View.OnDragListener { + private int win_counter = 0; + @Override protected void onCreate(Bundle savedInstanceState) { @@ -72,13 +74,21 @@ public class TutorialScene3Activity extends MyPlayActivity implements View.OnTou // the drag and drop operation has concluded case DragEvent.ACTION_DRAG_ENDED: + if (win_counter == 3) bravoPage(v); break; //drag shadow has been released,the drag point is within the bounding box of the View case DragEvent.ACTION_DROP: //handle the dragged view being dropped over a target view View view = (View) event.getLocalState(); - if (v == findViewById(R.id.red_rectangle)) { + if ( + (v == findViewById(R.id.red_rectangle31) && view == findViewById(R.id.red_rectangle32)) || + (v == findViewById(R.id.red_rectangle32) && view == findViewById(R.id.red_rectangle31)) || + (v == findViewById(R.id.blue_rectangle31) && view == findViewById(R.id.blue_rectangle32)) || + (v == findViewById(R.id.blue_rectangle32) && view == findViewById(R.id.blue_rectangle31)) || + (v == findViewById(R.id.green_rectangle31) && view == findViewById(R.id.green_rectangle32)) || + (v == findViewById(R.id.green_rectangle32) && view == findViewById(R.id.green_rectangle31)) + ) { //stop displaying the view where it was before it was dragged view.setVisibility(View.INVISIBLE); //view dragged item is being dropped on @@ -86,7 +96,7 @@ public class TutorialScene3Activity extends MyPlayActivity implements View.OnTou //view being dragged and dropped ImageView dropped = (ImageView) view; dropTarget.setBackgroundColor(dropped.getSolidColor()); - bravoPage(v); + win_counter++; } break; } @@ -96,7 +106,5 @@ public class TutorialScene3Activity extends MyPlayActivity implements View.OnTou @Override protected void next() { - finish(); } - } -- libgit2 0.21.2