Show drafts in conversation list snippets

// FREEBIE
This commit is contained in:
Jake McGinty
2014-12-11 17:13:01 -08:00
parent 1d0c9536fc
commit b05967f2c9
7 changed files with 80 additions and 23 deletions

View File

@@ -115,7 +115,7 @@ public class ThreadDatabase extends Database {
private void updateThread(long threadId, long count, String body, long date, long type)
{
ContentValues contentValues = new ContentValues(3);
ContentValues contentValues = new ContentValues(4);
contentValues.put(DATE, date - date % 1000);
contentValues.put(MESSAGE_COUNT, count);
contentValues.put(SNIPPET, body);
@@ -126,6 +126,15 @@ public class ThreadDatabase extends Database {
notifyConversationListListeners();
}
public void updateSnippet(long threadId, String snippet, long type) {
ContentValues contentValues = new ContentValues(3);
contentValues.put(SNIPPET, snippet);
contentValues.put(SNIPPET_TYPE, type);
SQLiteDatabase db = databaseHelper.getWritableDatabase();
db.update(TABLE_NAME, contentValues, ID + " = ?", new String[] {threadId + ""});
notifyConversationListListeners();
}
private void deleteThread(long threadId) {
SQLiteDatabase db = databaseHelper.getWritableDatabase();
db.delete(TABLE_NAME, ID_WHERE, new String[] {threadId+""});