package com.example.tictacpawfinal;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import android.widget.TextView;

/**
* @author Petroula
*
*/

public class InstructionsActivity extends Activity implements OnGestureListener {

	TextView textView000;
	GestureDetector detector;
	
	
	@SuppressWarnings("deprecation")
	@Override
    protected void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	setContentView(R.layout.instructions_screen);
     	
     	detector = new GestureDetector(this);
	}


	@Override
	public boolean onDown(MotionEvent e) {
		return false;
	}

	@Override
	public void onShowPress(MotionEvent e) {}


	@Override
	public boolean onSingleTapUp(MotionEvent e) {
		return false;
	}


	@Override
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
		return false;
	}


	@Override
	public void onLongPress(MotionEvent e) {}


	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
		
		 Intent changeToInstructions = getIntent();
		
		if(e1.getX()<e2.getX() && changeToInstructions.getIntExtra("recognizeScreen", 0)==2) {			
			/** Changes back to the welcome screen */  	
       	    Intent changeView = new Intent(getApplicationContext(), WelcomeActivity.class);
			startActivity(changeView);
			return true;
		} else if(e1.getX()<e2.getX() && changeToInstructions.getIntExtra("recognizeScreen", 0)==1) {
			/** Changes back to the main screen */  	
       	    Intent changeView = new Intent(getApplicationContext(), MainActivity.class);
			startActivity(changeView);
			return true;
		}
		return false;
	}
	
	public boolean onTouchEvent(MotionEvent ev) {
		return detector.onTouchEvent(ev);	
	}
}

@@ -86,24 +86,76 @@
 ent.Intent;%0A
+import android.graphics.drawable.AnimationDrawable;%0A
 import andro
@@ -164,24 +164,24 @@
 .os.Bundle;%0A
-
 import andro
@@ -319,17 +319,47 @@
 get.
-Text
+Image
 View;
+%0Aimport android.widget.Toast;
 %0A%0A/*
@@ -472,31 +472,8 @@
  %7B%0A%0A
-%09TextView textView000;%0A
 %09Ges
@@ -495,16 +495,51 @@
 tector;%0A
+%09AnimationDrawable animationDraw2;%0A
 %09%0A%09%0A%09@Su
@@ -743,45 +743,484 @@
     
- %09detector = new GestureDetector(this
+%09/** Adds instructions in the Instructions Screen in the form of animation */ %0A    %09ImageView instructionsV = (ImageView) findViewById(R.id.instructionsView);%0A    %09instructionsV.setBackgroundResource(R.drawable.instructions);%0A    %09animationDraw2 = (AnimationDrawable) instructionsV.getBackground();%0A    %09animationDraw2.start();%0A    %09%09%0A     %09detector = new GestureDetector(this);%0A     %09%0A     %09Toast.makeText(getApplicationContext(), %22Swipe to go back%22, Toast.LENGTH_LONG).show(
 );%0A%09

Update InstructionsActivity.java