From 92c76f2e12c414f8607068f9d91d47c53473b463 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Fri, 24 Sep 2021 21:10:15 -0400 Subject: Update a bunch of libraries --- .../infinityforreddit/activities/SearchActivity.java | 13 ++++++------- app/src/main/res/values/attr.xml | 3 --- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java index 66369953..c7cbf120 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java @@ -203,13 +203,13 @@ public class SearchActivity extends BaseActivity { simpleSearchView.setOnQueryTextListener(new SimpleSearchView.OnQueryTextListener() { @Override - public boolean onQueryTextSubmit(String query) { + public boolean onQueryTextSubmit(@NonNull String query) { search(query); return true; } @Override - public boolean onQueryTextChange(String newText) { + public boolean onQueryTextChange(@NonNull String newText) { if (!newText.isEmpty()) { if (subredditAutocompleteCall != null) { subredditAutocompleteCall.cancel(); @@ -384,11 +384,10 @@ public class SearchActivity extends BaseActivity { protected void onStart() { super.onStart(); simpleSearchView.showSearch(false); - simpleSearchView.getSearchEditText().requestFocus(); + simpleSearchView.requestFocus(); if (query != null) { - simpleSearchView.getSearchEditText().setText(query); - simpleSearchView.getSearchEditText().setSelection(query.length()); + simpleSearchView.setQuery(query, false); query = null; } @@ -403,13 +402,13 @@ public class SearchActivity extends BaseActivity { super.onPause(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null) { - imm.hideSoftInputFromWindow(simpleSearchView.getSearchEditText().getWindowToken(), 0); + imm.hideSoftInputFromWindow(simpleSearchView.getWindowToken(), 0); } } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { - if (simpleSearchView.onActivityResult(requestCode, resultCode, data)) { + if (data != null && simpleSearchView.onActivityResult(requestCode, resultCode, data)) { return; } diff --git a/app/src/main/res/values/attr.xml b/app/src/main/res/values/attr.xml index 0cfd9358..a14ca442 100644 --- a/app/src/main/res/values/attr.xml +++ b/app/src/main/res/values/attr.xml @@ -49,7 +49,4 @@ - - - \ No newline at end of file -- cgit v1.2.3