mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 23:28:52 -04:00
Fix keyboard flashing white when closing
This commit is contained in:
parent
3ac6a31685
commit
af1a05003a
@ -100,15 +100,16 @@ public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText
|
||||
* @return if the keyboard is set to be shown.
|
||||
*/
|
||||
public boolean switchKeyboardState(){
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||
//If an hard keyboard is present, never trigger the soft one
|
||||
if(hasFocus()
|
||||
|| (getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY
|
||||
&& getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES)){
|
||||
imm.hideSoftInputFromWindow(getWindowToken(), 0);
|
||||
clear();
|
||||
disable();
|
||||
return false;
|
||||
}else{
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||
enable();
|
||||
imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user