package viewbg;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.*;

public class EventItemView extends AbsoluteLayout{

	private TextView event_name;
	private TextView event_time;
	private TextView event_addr;
	private ImageView event_img;
	
	public EventItemView(Context context,String[] eAttrs,Drawable drawable) {
		super(context);
		// TODO Auto-generated constructor stub
		event_img=new ImageView(context);
		event_img.setImageDrawable(drawable);
		event_img.setPadding(0, 2, 5, 2); 
		this.addView(event_img, new AbsoluteLayout.LayoutParams(50,50,10,0));
		
		LinearLayout text=new LinearLayout(context);
		text.setOrientation(LinearLayout.VERTICAL);
		
		
		event_name=new TextView(context);
		event_name.setText(eAttrs[0]);
		text.addView(event_name, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
		
		event_time=new TextView(context);
		event_time.setText(eAttrs[1]);
		text.addView(event_time, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
		
		event_addr=new TextView(context);
		event_addr.setText(eAttrs[2]);
		text.addView(event_addr, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
		
		this.addView(text, new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 70, 0));
	}
	
	public void setName(String name)
	{
		event_name.setText(name);
	}
	public void setTime(String time)
	{
		event_time.setText(time);
	}
	public void setAddr(String addr)
	{
		event_addr.setText(addr);
	}
	public void setImg(Drawable img)
	{
		event_img.setImageDrawable(img);
	}
	

}
