diff --git a/app/src/main/java/it/niedermann/owncloud/notes/share/NoteShareActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/share/NoteShareActivity.java index 7d9c0689a..7c0abf583 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/share/NoteShareActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/share/NoteShareActivity.java @@ -22,6 +22,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodManager; import androidx.activity.OnBackPressedCallback; import androidx.activity.result.ActivityResultLauncher; @@ -223,7 +224,9 @@ private void setupSearchView(@Nullable SearchManager searchManager, ComponentNam binding.searchView.setIconifiedByDefault(false); binding.searchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); binding.searchView.setQueryHint(getResources().getString(R.string.note_share_activity_search_text)); - binding.searchView.setInputType(InputType.TYPE_NULL); + binding.searchView.setInputType(InputType.TYPE_CLASS_TEXT); + binding.searchView.setFocusable(true); + binding.searchView.setFocusableInTouchMode(true); View closeButton = binding.searchView.findViewById(androidx.appcompat.R.id.search_close_btn); closeButton.setOnClickListener(v -> { @@ -285,6 +288,13 @@ public boolean onQueryTextChange(String newText) { } }); + binding.searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> { + if (hasFocus) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(binding.searchView.findFocus(), InputMethodManager.SHOW_IMPLICIT); + } + }); + binding.searchView.setOnSuggestionListener(new SearchView.OnSuggestionListener() { @Override public boolean onSuggestionSelect(int position) {