字符串hardcode问题

This commit is contained in:
kehaoyuan
2017-11-11 09:34:01 +08:00
parent c4c499532a
commit 3a2c67152e
16 changed files with 153 additions and 124 deletions

View File

@ -170,7 +170,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
View view = View.inflate(VoteActivity.this, R.layout.dialog_modify_nickname, null);
TextView title = (TextView) view.findViewById(R.id.dialog_nickname_title);
title.setText("输入选项名字");
title.setText(R.string.vote_input_hint);
final EditText input = (EditText) view.findViewById(R.id.dialog_nickname_input);
input.setHint("");
@ -182,7 +182,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
if (actionId == EditorInfo.IME_ACTION_DONE) {
String nickname = input.getText().toString().trim();
if (TextUtils.isEmpty(nickname)) {
Utils.toast(VoteActivity.this, "请输入名字");
Utils.toast(VoteActivity.this, getString(R.string.vote_empty_hint));
return true;
}
postVersionVote(nickname, true);
@ -209,7 +209,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
public void onClick(View v) {
String nickname = input.getText().toString().trim();
if (TextUtils.isEmpty(nickname)) {
Utils.toast(VoteActivity.this, "请输入名字");
Utils.toast(VoteActivity.this, getString(R.string.vote_empty_hint));
return;
}
postVersionVote(nickname, true);
@ -245,14 +245,14 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
if (name.equals(voteEntity.getName())) {
UserDataEntity userDataEntity = voteEntity.getUserData();
if (userDataEntity != null && userDataEntity.isVersionRequested()) {
Utils.toast(this, "投票成功");
Utils.toast(this, getString(R.string.vote_success));
return;
}
}
}
}
final Dialog waitDialog = DialogUtils.showWaitDialog(VoteActivity.this, "提交中...");
final Dialog waitDialog = DialogUtils.showWaitDialog(VoteActivity.this, getString(R.string.vote_post));
JSONObject object = new JSONObject();
try {
@ -281,7 +281,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
String id = responseObject.getString("_id");
if (cast) {
Utils.toast(VoteActivity.this, "投票成功");
Utils.toast(VoteActivity.this, getString(R.string.vote_success));
} else {
if (isNewVote) {
Utils.toast(VoteActivity.this, "已经存在相同的选项");