package example.com.velezguiatour;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.google.android.gms.maps.model.LatLng;

public class ShoopingAddress extends Activity {

	final Integer[] images = { R.drawable.sh,R.drawable.sh1,R.drawable.sh2,R.drawable.sh3, };

	final String[] addresses = { "Avda. Juan Carlos I, s/n, 29740 Vélez-Málaga, Málaga",
			"Avda. Juan Carlos I, s/n, 29740 Vélez-Málaga, Málaga",
			"Avda. Juan Carlos I, s/n, 29740 Vélez-Málaga, Málaga",
			"Avda. Juan Carlos I, s/n, 29740 Vélez-Málaga, Málaga"};

	LatLng[] latLangs = { new LatLng( 36.754999,  -4.100996),
			new LatLng( 36.754999,  -4.100996),
			new LatLng( 36.754999,  -4.100996),
			new LatLng( 36.754999,  -4.100996)};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_shopping_adapter);
		Button btnmap = (Button) findViewById(R.id.btnmap);

		
		String name = getIntent().getExtras().getString("name");
		final int index = getIntent().getExtras().getInt("index");

		ImageView imageView = (ImageView) findViewById(R.id.fullImageViewShop);
		imageView.setImageResource(images[index]);

		TextView addressView = (TextView) findViewById(R.id.txtViewShopAdress);
		addressView.setText(addresses[index]);

		TextView descriptionView = (TextView) findViewById(R.id.txtViewShopDescription);
		descriptionView.setText(name);
		
		
		btnmap.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent i = new Intent(ShoopingAddress.this,
						MyMapp.class);
				i.putExtra("latlang", latLangs[index]);
				startActivity(i);
			}
		});

	}



	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
