aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorTacoTheDank <SkytkRSfan3895@gmail.com>2021-09-25 01:10:15 +0000
committerTacoTheDank <SkytkRSfan3895@gmail.com>2021-09-25 01:10:15 +0000
commit92c76f2e12c414f8607068f9d91d47c53473b463 (patch)
treef21b5bbd84141970f8cf62b32b2855997bb2c389 /app/src/main/java
parente46408296488d1989159335b75f8181f05ca5afd (diff)
downloadinfinity-for-reddit-92c76f2e12c414f8607068f9d91d47c53473b463.tar
infinity-for-reddit-92c76f2e12c414f8607068f9d91d47c53473b463.tar.gz
infinity-for-reddit-92c76f2e12c414f8607068f9d91d47c53473b463.tar.bz2
infinity-for-reddit-92c76f2e12c414f8607068f9d91d47c53473b463.tar.lz
infinity-for-reddit-92c76f2e12c414f8607068f9d91d47c53473b463.tar.xz
infinity-for-reddit-92c76f2e12c414f8607068f9d91d47c53473b463.tar.zst
infinity-for-reddit-92c76f2e12c414f8607068f9d91d47c53473b463.zip
Update a bunch of libraries
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java13
1 files changed, 6 insertions, 7 deletions
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;
}