package it.unimi.di.laren.smartwash.View;

import it.unimi.di.laren.smartwash.R;
import it.unimi.di.laren.smartwash.Controller.Main_Controller;
import it.unimi.di.laren.smartwash.R.id;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class MainActivity extends Activity {

	public Button play;
	public Button instruct;
	public Button close;
	public Button credits;
	public RelativeLayout creditLay;
	public ImageView sands, fire, europa, amis, arduino, cartif, libelium, ntua, upv, unimi, gorenje;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		play = (Button)findViewById(R.id.PlayBtn);
		instruct = (Button)findViewById(R.id.InstrBtn);
		close = (Button)findViewById(R.id.closeBtn);
		credits = (Button)findViewById(R.id.creditsBtn);
		creditLay = (RelativeLayout)findViewById(R.id.creditsLay);
		sands = (ImageView)findViewById(R.id.sands);
		fire = (ImageView)findViewById(R.id.fire);
		europa = (ImageView)findViewById(R.id.europa);
		amis = (ImageView)findViewById(R.id.amis);
		arduino = (ImageView)findViewById(R.id.arduino);
		cartif = (ImageView)findViewById(R.id.cartif);
		libelium = (ImageView)findViewById(R.id.libelium);
		ntua = (ImageView)findViewById(R.id.uniaten);
		upv = (ImageView)findViewById(R.id.upv);
		unimi = (ImageView)findViewById(R.id.unimi);
		gorenje = (ImageView)findViewById(R.id.gorenje);
		Main_Controller controller = new Main_Controller(this);
		play.setOnClickListener(controller);
		instruct.setOnClickListener(controller);
		close.setOnClickListener(controller);
		credits.setOnClickListener(controller);
		sands.setOnClickListener(controller);
		fire.setOnClickListener(controller);
		europa.setOnClickListener(controller);
		amis.setOnClickListener(controller);
		arduino.setOnClickListener(controller);
		cartif.setOnClickListener(controller);
		libelium.setOnClickListener(controller);
		ntua.setOnClickListener(controller);
		upv.setOnClickListener(controller);
		unimi.setOnClickListener(controller);
		gorenje.setOnClickListener(controller);
	}
//	@Override
//	public boolean onKeyDown(int keyCode, KeyEvent event) {
//	    if ((keyCode == KeyEvent.KEYCODE_BACK)) {
//	        // start new Activity here
//	    	Intent showMain = new Intent(this,
//					MainActivity.class);
//			this.startActivity(showMain);
//	    	this.finish();
//	    }
//	    return super.onKeyDown(keyCode, event);
//	}
}
