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.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/**
* @author Petroula
*
*/


public class InstructionsActivity extends Activity implements OnClickListener, OnGestureListener {

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


	@Override
	public void onClick(View v) {
		Intent changeView = new Intent(getApplicationContext(), WelcomeActivity.class);
		startActivity(changeView);	 
	}


	@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);	
	}
}

@@ -245,106 +245,8 @@
 nt;%0A
-import android.view.View;%0Aimport android.view.View.OnClickListener;%0Aimport android.widget.Button;%0A
 impo
@@ -303,17 +303,16 @@
 a%0A*%0A*/%0A%0A
-%0A
 public c
@@ -368,25 +368,8 @@
 ents
- OnClickListener,
  OnG
@@ -390,26 +390,8 @@
  %7B%0A%0A
-%09Button button17;%0A
 %09Tex
@@ -638,319 +638,58 @@
 n);%0A
-%09    %0A    %09button17 = (Button)findViewById(R.id.button17);%09%0A     %09button17.setOnClickListener(this);%0A     %09%0A     %09detector = new GestureDetector(this);%0A%09%7D%0A%0A%0A%09@Override%0A%09public void onClick(View v) %7B%0A%09%09Intent changeView = new Intent(getApplicationContext(), WelcomeActivity.class);%0A%09%09startActivity(changeView);%09 
+     %09%0A     %09detector = new GestureDetector(this);
 %0A%09%7D%0A

Update InstructionsActivity.java