Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 -> {
Expand Down Expand Up @@ -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) {
Expand Down
Loading