|
@@ -342,30 +342,30 @@ public class StaticInfoAdapter extends BaseRecyclerViewAdapter<Infos> {
|
|
|
editText.addTextChangedListener(textWatcher);
|
|
|
editText.setTag(textWatcher);
|
|
|
|
|
|
-// editText.getViewTreeObserver().addOnGlobalLayoutListener(
|
|
|
-// () -> {
|
|
|
-// Rect r = new Rect();
|
|
|
-// editText.getWindowVisibleDisplayFrame(r);
|
|
|
-// int screenHeight = editText.getRootView()
|
|
|
-// .getHeight();
|
|
|
-// int heightDifference = screenHeight - (r.bottom);
|
|
|
-// if (heightDifference > 200) {
|
|
|
-// //软键盘显示
|
|
|
-// editText.setFocusable(true);
|
|
|
-// } else {
|
|
|
-// //软键盘隐藏
|
|
|
-// editText.clearFocus();
|
|
|
-//
|
|
|
-// }
|
|
|
-// });
|
|
|
-// editText.setOnClickListener(v -> {
|
|
|
-// editText.setFocusable(true);
|
|
|
-// editText.setFocusableInTouchMode(true);
|
|
|
-// editText.requestFocus();
|
|
|
-// editText.findFocus();
|
|
|
-// InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
-// imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);// 显示输入法
|
|
|
-// });
|
|
|
+ editText.getViewTreeObserver().addOnGlobalLayoutListener(
|
|
|
+ () -> {
|
|
|
+ Rect r = new Rect();
|
|
|
+ editText.getWindowVisibleDisplayFrame(r);
|
|
|
+ int screenHeight = editText.getRootView()
|
|
|
+ .getHeight();
|
|
|
+ int heightDifference = screenHeight - (r.bottom);
|
|
|
+ if (heightDifference > 200) {
|
|
|
+ //软键盘显示
|
|
|
+ editText.setFocusable(true);
|
|
|
+ } else {
|
|
|
+ //软键盘隐藏
|
|
|
+ editText.clearFocus();
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ editText.setOnClickListener(v -> {
|
|
|
+ editText.setFocusable(true);
|
|
|
+ editText.setFocusableInTouchMode(true);
|
|
|
+ editText.requestFocus();
|
|
|
+ editText.findFocus();
|
|
|
+ InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
+ imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);// 显示输入法
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|