aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java13
-rw-r--r--app/src/main/res/values/attr.xml3
2 files changed, 6 insertions, 10 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;
}
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 @@
<attr name="backgroundColor" format="color"/>
<attr name="cardViewBackgroundColor" format="color"/>
</declare-styleable>
-
- <attr name="backIconAlpha"/>
- <attr name="iconsAlpha"/>
</resources> \ No newline at end of file