1、修复libaoactivity、libaodetailactivity崩溃

2、处理部分toolbar
3、处理输入法弹出、隐藏
This commit is contained in:
CsHeng
2017-12-15 17:23:34 +08:00
parent a022526e7e
commit 40fccea23a
33 changed files with 298 additions and 347 deletions

View File

@ -30,6 +30,7 @@ import com.gh.gamecenter.entity.UserDataEntity;
import com.gh.gamecenter.entity.VersionVoteEntity;
import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.lightgame.utils.Util_System_Keyboard;
import com.lightgame.utils.Utils;
import org.json.JSONException;
@ -172,15 +173,15 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
TextView title = (TextView) view.findViewById(R.id.dialog_nickname_title);
title.setText(R.string.vote_input_hint);
final EditText input = (EditText) view.findViewById(R.id.dialog_nickname_input);
input.setHint("");
input.setSelection(input.getText().length());
final EditText mEdtInput = (EditText) view.findViewById(R.id.dialog_nickname_input);
mEdtInput.setHint("");
mEdtInput.setSelection(mEdtInput.getText().length());
input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
mEdtInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
String nickname = input.getText().toString().trim();
String nickname = mEdtInput.getText().toString().trim();
if (TextUtils.isEmpty(nickname)) {
Utils.toast(VoteActivity.this, getString(R.string.vote_empty_hint));
return true;
@ -207,7 +208,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String nickname = input.getText().toString().trim();
String nickname = mEdtInput.getText().toString().trim();
if (TextUtils.isEmpty(nickname)) {
Utils.toast(VoteActivity.this, getString(R.string.vote_empty_hint));
return;
@ -220,8 +221,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
InputMethodManager imm = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(input.getWindowToken(), 0);
Util_System_Keyboard.hideSoftKeyboard(VoteActivity.this);
}
});
@ -232,9 +232,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
mVoteRv.postDelayed(new Runnable() {
@Override
public void run() {
InputMethodManager imm = (InputMethodManager) getApplicationContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(input, InputMethodManager.SHOW_FORCED);
Util_System_Keyboard.showSoftKeyboard(VoteActivity.this, mEdtInput);
}
}, 300);
}