package com.view;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;

public class UserProfile extends Activity {
	EditText et_userName;
	EditText et_intro;
	ImageView iv_head;
	Button bt_getHead;
	CheckBox cb_showAddr;
	Button bt_ok;
	Button bt_cancel;
	
	boolean if_show_addr;
	String username;
	String intro;
	String head_path;
	
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.userprofile);
		
		et_userName=(EditText)findViewById(R.id.username_in_profile);
		et_intro=(EditText)findViewById(R.id.intro_in_profile);
		iv_head=(ImageView)findViewById(R.id.head_in_profile);
		bt_getHead=(Button)findViewById(R.id.get_pic_in_profile);
		cb_showAddr=(CheckBox)findViewById(R.id.show_addr_in_profile);
		bt_ok=(Button)findViewById(R.id.ok_in_profile);
		bt_cancel=(Button)findViewById(R.id.cancel_in_profile);
		
		bt_getHead.setOnClickListener(click_pic);
		bt_ok.setOnClickListener(click_ok);
		bt_cancel.setOnClickListener(click_cancel);
		
	}
	
	OnClickListener click_pic=new OnClickListener()
	{
		public void onClick(View view)
		{
			Intent intent=new Intent(UserProfile.this,LocalBrowser.class);
			startActivity(intent);
		}
	};
	
	OnClickListener click_ok=new OnClickListener()
	{
		public void onClick(View view)
		{
			
		}
	};
	
	OnClickListener click_cancel=new OnClickListener()
	{
		public void onClick(View view)
		{
			
		}
	};
	
	OnClickListener click_showAddr=new OnClickListener()
	{
		public void onClick(View view)
		{
			if(cb_showAddr.isChecked())
				if_show_addr=true;
			else
				if_show_addr=false;
		}
	};
	
	OnClickListener click_getHead=new OnClickListener()
	{
		public void onClick(View view)
		{
			Intent intent=new Intent(UserProfile.this,LocalBrowser.class);
			startActivity(intent);
		}
	};
	

	public String getUserName(){return username;}
	public String getUserHead(){return head_path;}
	public String getIntro(){return intro;}
}
