package com.smart.gtstrvl;

import com.example.mountaintravel.base.BaseActivity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class CreateTeamActivity extends BaseActivity {
	private EditText createteam_editText;
	private TextView createteam_tverr;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_create_team);
		initTitleBar("创建团队");
		createteam_editText = (EditText) findViewById(R.id.createteam_editText);
		createteam_tverr = (TextView) findViewById(R.id.createteam_tverr);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.findpass2, menu);
		return true;
	}

	public void button(View v) {
		if (TextUtils.isEmpty(createteam_editText.getText().toString().trim())) {
			createteam_tverr.setVisibility(View.VISIBLE);
			createteam_tverr.setText("  名称不能为空");
			return;
		}
		if (createteam_editText.getText().toString().trim().length() > 5) {
			createteam_tverr.setVisibility(View.VISIBLE);
			createteam_tverr.setText("  名称不能超过五个字");
			return;
			// 有一个接口判断是否已注册过if
		}

		createteam_tverr.setVisibility(View.GONE);

		new Thread(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
			}

		}).start();
	}

}
