Show search history first

This commit is contained in:
NekoInverter committed 2020-11-21 15:30:43 +08:00
1 parent 097dc17d53
commit 3209cdefb3
1 file changed
+5 -5
@@ -177,6 +177,11 @@ public class SearchBar extends MaterialCardView implements View.OnClickListener,
}
}
String[] keywords = mSearchDatabase.getSuggestions(text, 128);
for (String keyword : keywords) {
mSuggestionList.add(new KeywordSuggestion(keyword));
}
EhTagDatabase ehTagDatabase = EhTagDatabase.getInstance(getContext());
if (!TextUtils.isEmpty(text) && ehTagDatabase != null && !text.endsWith(" ")) {
String[] s = text.split(" ");
@@ -191,11 +196,6 @@ public class SearchBar extends MaterialCardView implements View.OnClickListener,
}
}
String[] keywords = mSearchDatabase.getSuggestions(text, 128);
for (String keyword : keywords) {
mSuggestionList.add(new KeywordSuggestion(keyword));
}
if (mSuggestionList.size() == 0) {
removeListHeader();
} else {