|
@@ -91,7 +91,7 @@ public class MyInfoActivity extends BaseActivity implements View.OnClickListener
|
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.activity_my_info);
|
|
|
getSupportActionBar().hide();
|
|
|
- findViewById(R.id.iv_title_left).setOnClickListener(view -> finish());
|
|
|
+ findViewById(R.id.iv_title_left).setOnClickListener(view -> clickBack());
|
|
|
TextView tvTitle = (TextView) findViewById(R.id.tv_title_center);
|
|
|
tvTitle.setText(R.string.my_details);
|
|
|
mUser = coreManager.getSelf();
|
|
@@ -247,12 +247,12 @@ public class MyInfoActivity extends BaseActivity implements View.OnClickListener
|
|
|
|
|
|
|
|
|
private void showEditNickname() {
|
|
|
- EditText editText = new EditText(this);
|
|
|
+ final EditText editText = new EditText(this);
|
|
|
final AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
|
|
.setView(editText)
|
|
|
.setTitle(R.string.modify_nickname)
|
|
|
.setPositiveButton(R.string.confirm, (d,i)->{
|
|
|
- String nickName = edtDiyName.getText().toString();
|
|
|
+ String nickName = editText.getText().toString();
|
|
|
tvNickname.setText(nickName);
|
|
|
|
|
|
mTempUserData.setNickName(nickName);
|
|
@@ -282,13 +282,30 @@ public class MyInfoActivity extends BaseActivity implements View.OnClickListener
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (mUser != null && !mUser.equals(coreManager)) {// 数据改变了,提交数据
|
|
|
- updateData();
|
|
|
- } else {
|
|
|
- finish();
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ public void clickBack(){
|
|
|
+ if (mUser != null && !mUser.equals(coreManager)) {// 数据改变了,提交数据
|
|
|
+ TextView textView = new TextView(this);
|
|
|
+ textView.setText(R.string.user_data_changed);
|
|
|
+ AlertDialog.Builder builder = new AlertDialog.Builder(this).setTitle(InternationalizationHelper.getString("SELECT_AVATARS"))
|
|
|
+ .setTitle(R.string.system_notification_user_name)
|
|
|
+ .setView(textView)
|
|
|
+ .setPositiveButton(R.string.save,((dialog, which) -> {
|
|
|
+ updateData();
|
|
|
+ }))
|
|
|
+ .setNegativeButton(R.string.cancel,((dialog, which) -> {
|
|
|
+ finish();
|
|
|
+ }));
|
|
|
+ builder.show();
|
|
|
+ } else {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
private void showSelectAvatarDialog() {
|
|
|
String[] items = new String[]{InternationalizationHelper.getString("PHOTOGRAPH"), InternationalizationHelper.getString("ALBUM")};
|
|
@@ -575,4 +592,9 @@ public class MyInfoActivity extends BaseActivity implements View.OnClickListener
|
|
|
finish();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onBackPressed() {
|
|
|
+ clickBack();
|
|
|
+
|
|
|
+ }
|
|
|
}
|