package fishrungames.kobserver;

import fishrungames.kobserver.JniWrapper;

import android.app.Activity;
import android.content.Intent;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;
import android.widget.EditText;


public class AlarmActivity extends Activity
{
	
	@Override
	protected void onCreate(Bundle icicle)
	{

		super.onCreate(icicle);

		setContentView(R.layout.alarm_layout);	
		
		Button backbtn = (Button) findViewById(R.id.backButton_alarm);
		backbtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), MainMenuActivity.class);
                startActivityForResult(myIntent, 0);
            }
        });
		
		
		
		Button exclusionButton = (Button) findViewById(R.id.exclusionButton);
		exclusionButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                
            	JniWrapper.MapState = 3;
            	JniWrapper.SetAlarmExclusion();

            	
            }
        });
		
		
		Button injectionButton = (Button) findViewById(R.id.injectionButton);
		injectionButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                
            	JniWrapper.MapState = 4;
            	JniWrapper.SetAlarmInjection();
    
            	
            }
        });
		
		
		Button carouselButton = (Button) findViewById(R.id.carouselButton);
		carouselButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                
            	JniWrapper.MapState = 5;
            	JniWrapper.SetAlarmCarousel();

            	
            }
        });
		
		
		Button assaultButton = (Button) findViewById(R.id.assaultButton);
		assaultButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                
            	JniWrapper.MapState = 6;
            	JniWrapper.SetAlarmAssault();
                
            	
            }
        });
		
		Button sendAdditionalMessageButton = (Button) findViewById(R.id.sendAdditionalMessageButton);
		sendAdditionalMessageButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
            	
            	EditText additionalMessageEdit = (EditText) findViewById(R.id.additionalMessageEdit);
                
            	JniWrapper.SendMessage(additionalMessageEdit.getText().toString());
            	
            	additionalMessageEdit.setText("");
                
            	
            }
        });
		
		
		

	}
}