mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Limited number of search items in search bar
This commit is contained in:
parent
55c335d7fc
commit
fa70039ff5
2 changed files with 3 additions and 3 deletions
|
|
@ -80,10 +80,10 @@ public class RecentSearchRepository {
|
|||
}
|
||||
}
|
||||
|
||||
public List<String> getRecentSearchSuggestion() {
|
||||
public List<String> getRecentSearchSuggestion(int limit) {
|
||||
List<String> recent = new ArrayList<>();
|
||||
|
||||
RecentThreadSafe suggestionsThread = new RecentThreadSafe(recentSearchDao,10);
|
||||
RecentThreadSafe suggestionsThread = new RecentThreadSafe(recentSearchDao,limit);
|
||||
Thread thread = new Thread(suggestionsThread);
|
||||
thread.start();
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class SearchViewModel extends AndroidViewModel {
|
|||
|
||||
public List<String> getRecentSearchSuggestion() {
|
||||
ArrayList<String> suggestions = new ArrayList<>();
|
||||
suggestions.addAll(recentSearchRepository.getRecentSearchSuggestion());
|
||||
suggestions.addAll(recentSearchRepository.getRecentSearchSuggestion(5));
|
||||
|
||||
return suggestions;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue