mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 23:59:21 -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.
|
* @return if the keyboard is set to be shown.
|
||||||
*/
|
*/
|
||||||
public boolean switchKeyboardState(){
|
public boolean switchKeyboardState(){
|
||||||
|
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||||
//If an hard keyboard is present, never trigger the soft one
|
//If an hard keyboard is present, never trigger the soft one
|
||||||
if(hasFocus()
|
if(hasFocus()
|
||||||
|| (getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY
|
|| (getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY
|
||||||
&& getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES)){
|
&& getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES)){
|
||||||
|
imm.hideSoftInputFromWindow(getWindowToken(), 0);
|
||||||
clear();
|
clear();
|
||||||
disable();
|
disable();
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
|
|
||||||
enable();
|
enable();
|
||||||
imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT);
|
imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user