|
|
@@ -1,6 +1,9 @@
|
|
|
package com.uas.appme.settings.activity;
|
|
|
|
|
|
+import android.app.AlertDialog;
|
|
|
+import android.content.DialogInterface;
|
|
|
import android.os.Bundle;
|
|
|
+import android.view.View;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
@@ -14,7 +17,7 @@ import com.uas.appme.R;
|
|
|
* function:
|
|
|
*/
|
|
|
|
|
|
-public class PersonSettingActivity extends BaseActivity {
|
|
|
+public class PersonSettingActivity extends BaseActivity implements View.OnClickListener{
|
|
|
private TextView mNameTv;
|
|
|
private FormEditText mUserNameTv;
|
|
|
private FormEditText mUserSexTv;
|
|
|
@@ -48,5 +51,62 @@ public class PersonSettingActivity extends BaseActivity {
|
|
|
mEmailTv = (TextView) findViewById(R.id.email_tv);
|
|
|
mUserEmailTv = (FormEditText) findViewById(R.id.user_email_tv);
|
|
|
mBtnSave = (Button) findViewById(R.id.btn_save);
|
|
|
+
|
|
|
+ mUserSexTv.setKeyListener(null);
|
|
|
+ mUserSexTv.setFocusable(false);
|
|
|
+ mUserSexTv.setOnClickListener(this);
|
|
|
+ mUserDepartmentTv.setKeyListener(null);
|
|
|
+ mUserDepartmentTv.setFocusable(false);
|
|
|
+ mUserDepartmentTv.setOnClickListener(this);
|
|
|
+
|
|
|
+ mBtnSave.setOnClickListener(this);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (v.getId() == R.id.user_sex_tv){
|
|
|
+ showSelectSexDialog();
|
|
|
+ }else if (v.getId() == R.id.user_department_tv){
|
|
|
+
|
|
|
+ }else if (v.getId() == R.id.btn_save){
|
|
|
+ saveJudge();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void saveJudge() {
|
|
|
+ if (mUserNameTv.testValidity() && mUserSexTv.testValidity()
|
|
|
+ && mUserDepartmentTv.testValidity() && mUserJobTv.testValidity() &&
|
|
|
+ mUserTelTv.testValidity()&& mUserEmailTv.testValidity()
|
|
|
+ ){
|
|
|
+
|
|
|
+ if (mUserEmailTv.getText().toString().contains("@")){
|
|
|
+ saveRequest();
|
|
|
+ }else {
|
|
|
+ ToastMessage(getString(com.uas.appcontact.R.string.Please_imput_the_correct_email_format));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void saveRequest() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void showSelectSexDialog() {
|
|
|
+ // 1是男,0是女,2是全部
|
|
|
+ String[] sexs = new String[]{ getString(com.uas.appcontact.R.string.user_body), getString(com.uas.appcontact.R.string.user_girl)};
|
|
|
+ int checkItem = 0;
|
|
|
+ new AlertDialog.Builder(this).setTitle(getString(com.uas.appcontact.R.string.select_sex_title))
|
|
|
+ .setSingleChoiceItems(sexs, checkItem, new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ if (which == 0) {
|
|
|
+ mUserSexTv.setText(R.string.user_body);
|
|
|
+ } else {
|
|
|
+ mUserSexTv.setText(R.string.user_girl);
|
|
|
+ }
|
|
|
+ dialog.dismiss();
|
|
|
+ }
|
|
|
+ }).setCancelable(true).create().show();
|
|
|
}
|
|
|
}
|