This repository was archived by the owner on Sep 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/keyboard Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import static android .content .Context .INPUT_METHOD_SERVICE ;
55
6- import android .annotation .SuppressLint ;
76import android .content .Context ;
87import android .text .Editable ;
8+ import android .text .Selection ;
99import android .util .AttributeSet ;
1010import android .view .KeyEvent ;
1111import android .view .inputmethod .InputMethodManager ;
@@ -78,13 +78,15 @@ public void switchKeyboardState(){
7878 * Clear the EditText from any leftover inputs
7979 * It does not affect the in-game input
8080 */
81- @ SuppressLint ("SetTextI18n" )
8281 public void clear (){
8382 mIsDoingInternalChanges = true ;
83+ // Edit the Editable directly as it doesn't affect the state
84+ // of the TextView.
85+ Editable editable = getEditableText ();
86+ editable .clear ();
8487 //Braille space, doesn't trigger keyboard auto-complete
85- //replacing directly the text without though setText avoids notifying changes
86- setText (TEXT_FILLER );
87- setSelection (TEXT_FILLER .length ());
88+ editable .append (TEXT_FILLER );
89+ Selection .setSelection (editable , TEXT_FILLER .length ());
8890 mIsDoingInternalChanges = false ;
8991 }
9092
You can’t perform that action at this time.
0 commit comments