Merge pull request #6045 from ByteHamster/clear-search-box

Clear search box when coming back from search
This commit is contained in:
ByteHamster 2022-08-28 12:39:14 +02:00 committed by GitHub
commit 0bf6f2f1fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -163,8 +163,7 @@ public class AddFeedFragment extends Fragment {
private void performSearch() {
viewBinding.combinedFeedSearchEditText.clearFocus();
InputMethodManager in = (InputMethodManager)
getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
InputMethodManager in = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
in.hideSoftInputFromWindow(viewBinding.combinedFeedSearchEditText.getWindowToken(), 0);
String query = viewBinding.combinedFeedSearchEditText.getText().toString();
if (query.matches("http[s]?://.*")) {
@ -172,6 +171,7 @@ public class AddFeedFragment extends Fragment {
return;
}
activity.loadChildFragment(OnlineSearchFragment.newInstance(CombinedSearcher.class, query));
viewBinding.combinedFeedSearchEditText.post(() -> viewBinding.combinedFeedSearchEditText.setText(""));
}
@Override