mirror of https://github.com/M66B/FairEmail.git
Max 3 search suggestions
This commit is contained in:
parent
4035e66772
commit
cebc18794f
|
@ -593,8 +593,8 @@ public interface DaoMessage {
|
|||
" GROUP BY sender" +
|
||||
|
||||
" ORDER BY sender, subject" +
|
||||
" LIMIT 5")
|
||||
Cursor getSuggestions(Long account, Long folder, String query);
|
||||
" LIMIT :limit")
|
||||
Cursor getSuggestions(Long account, Long folder, String query, int limit);
|
||||
|
||||
@Query("SELECT language FROM message" +
|
||||
" WHERE (:account IS NULL OR message.account = :account)" +
|
||||
|
|
|
@ -57,6 +57,8 @@ import java.util.Calendar;
|
|||
import java.util.List;
|
||||
|
||||
public class FragmentDialogSearch extends FragmentDialogBase {
|
||||
private static final int MAX_SUGGESTIONS = 3;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
|
@ -141,7 +143,8 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|||
return db.message().getSuggestions(
|
||||
account < 0 ? null : account,
|
||||
folder < 0 ? null : folder,
|
||||
"%" + query + "%");
|
||||
"%" + query + "%",
|
||||
MAX_SUGGESTIONS);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue