package viewbg;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class BrowserTextView extends LinearLayout{

	private TextView tv;
	private ImageView iv;
	
	public BrowserTextView(Context context,BrowserItem item) {
		super(context);
		// TODO Auto-generated constructor stub
		
		this.setOrientation(LinearLayout.HORIZONTAL);
		iv=new ImageView(context);
		iv.setImageDrawable(item.getIcon());
		iv.setPadding(0, 2, 5, 0);
		addView(iv,new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		
		tv=new TextView(context);
		tv.setText(item.getText());
		addView(tv,new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

	}
	
	public void setIcon(Drawable d)
	{
		iv.setImageDrawable(d);
	}
	
	public void setText(String text)
	{
		tv.setText(text);
	}

}
