package com.chaoran.entiry;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.Gravity;
import android.widget.Button;
import android.widget.LinearLayout;

public class PhotographUi extends LinearLayout {
	private SelfImage image;
	private Button pz;

	public PhotographUi(Context context, int h) {
		super(context);
		this.setOrientation(VERTICAL);
		setGravity(Gravity.CENTER_VERTICAL);
		this.setVerticalGravity(1);
		image = new SelfImage(context,true);
		addView(image, new LayoutParams(LayoutParams.MATCH_PARENT,
				h));
		pz = new Button(context);
		pz.setText("拍照");
		addView(pz, new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.WRAP_CONTENT));
	}
	public void setOnClickListener(OnClickListener clickListener){
		pz.setOnClickListener(clickListener);
	}
	public void setImageOnClickListener(OnClickListener clickListener){
		image.setOnClickListener(clickListener);
	}
	public void setImageBitmap(Bitmap bitmap){
	    image.setBitmap(bitmap);
	}
	public Bitmap getImageBitmap(){
		return image.getBitmap();
	}
}
