package com.espritmobile.sim.restocheck.entities;

import com.espritmobile.sim.restocheck.R;

import android.content.Context;
import android.graphics.Typeface;
import android.text.style.TextAppearanceSpan;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.RelativeLayout.LayoutParams;

public class Plate extends RelativeLayout {

	ImageView img;
	TextView txt;

	public Plate(Context context, int image, String text,
			android.widget.RelativeLayout.LayoutParams lp) {
		super(context);
		img = new ImageView(context);
		txt = new TextView(context);
		txt.setText(text);
		txt.setTextColor(getResources().getColor(R.color.vert));
		RelativeLayout.LayoutParams layoutParams = new LayoutParams(
				LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
		layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT,
				RelativeLayout.TRUE);
		txt.setLayoutParams(layoutParams);
		txt.setGravity(Gravity.CENTER);
		txt.setTextSize(20);
		txt.setTextColor(getResources().getColor(R.color.vert));
		img.setImageResource(image);
		img.setLayoutParams(lp);
		this.addView(img);
		this.addView(txt);

	}

}
