mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-19 13:00:12 -07:00
Better use of the SRP for the 2.2 input system
This commit is contained in:
parent
29a96330aa
commit
4ccfe06263
3 changed files with 27 additions and 20 deletions
|
|
@ -902,25 +902,6 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Toggle on and off the soft keyboard, depending of the state
|
||||
* The condition is prone to errors if the keyboard is being hidden without the consent
|
||||
* of the current TouchCharInput
|
||||
*/
|
||||
public void switchKeyboardState(){
|
||||
//If an hard keyboard is present, never trigger the soft one
|
||||
if(touchCharInput.hasFocus()
|
||||
|| getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY){
|
||||
touchCharInput.clear();
|
||||
touchCharInput.disable();
|
||||
|
||||
}else{
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||
touchCharInput.enable();
|
||||
touchCharInput.postDelayed(() -> imm.showSoftInput(touchCharInput, InputMethodManager.SHOW_IMPLICIT), 200);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setRightOverride(boolean val) {
|
||||
this.rightOverride = val;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue