Skip to content

Commit

Permalink
feature: long-click on switch button opens InputMethodPicker (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEmperor committed Jul 5, 2024
1 parent 5532791 commit 92b261e
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.TextView;

Expand Down Expand Up @@ -212,6 +213,12 @@ public void run() {
}
});

switchButton.setOnLongClickListener(v -> {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) imm.showInputMethodPicker();
return true;
});

spaceButton.setOnClickListener(v -> {
vibrate();

Expand Down

0 comments on commit 92b261e

Please sign in to comment.