Implemented full-text search.

You can now use the search bar on the conversation list to find
conversations, messages, and contacts.
This commit is contained in:
Greyson Parrelli
2018-04-06 18:15:24 -07:00
parent c0b75c2ef5
commit 0449647cf9
28 changed files with 1505 additions and 70 deletions

View File

@@ -9,13 +9,15 @@ import org.whispersystems.libsignal.util.Pair;
public class ConversationLoader extends AbstractCursorLoader {
private final long threadId;
private long limit;
private int offset;
private int limit;
private long lastSeen;
private boolean hasSent;
public ConversationLoader(Context context, long threadId, long limit, long lastSeen) {
public ConversationLoader(Context context, long threadId, int offset, int limit, long lastSeen) {
super(context);
this.threadId = threadId;
this.offset = offset;
this.limit = limit;
this.lastSeen = lastSeen;
this.hasSent = true;
@@ -25,6 +27,14 @@ public class ConversationLoader extends AbstractCursorLoader {
return limit > 0;
}
public boolean hasOffset() {
return offset > 0;
}
public int getOffset() {
return offset;
}
public long getLastSeen() {
return lastSeen;
}
@@ -43,6 +53,6 @@ public class ConversationLoader extends AbstractCursorLoader {
this.lastSeen = lastSeenAndHasSent.first();
}
return DatabaseFactory.getMmsSmsDatabase(context).getConversation(threadId, limit);
return DatabaseFactory.getMmsSmsDatabase(context).getConversation(threadId, offset, limit);
}
}