From f8f5b348349299c7bb16041576562dac34017e60 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Tue, 7 Jun 2016 11:18:17 +0800 Subject: [PATCH] fixed activity model version --- .../template/StatusAnnotationTemplate.java | 3 +- .../model/ParcelableMessageConversation.java | 36 +++++++++++++++++++ .../twidere/model/ParcelableMessageEntry.java | 25 ------------- .../twidere/provider/TwidereDataStore.java | 11 ++++-- 4 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageConversation.java delete mode 100644 twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageEntry.java diff --git a/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/template/StatusAnnotationTemplate.java b/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/template/StatusAnnotationTemplate.java index 69dc69098..3633ce805 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/template/StatusAnnotationTemplate.java +++ b/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/template/StatusAnnotationTemplate.java @@ -14,7 +14,8 @@ import org.mariotaku.restfu.annotation.param.Queries; @KeyValue(key = "include_reply_count", valueKey = "include_reply_count"), @KeyValue(key = "include_descendent_reply_count", valueKey = "include_descendent_reply_count"), @KeyValue(key = "include_ext_alt_text", valueKey = "include_ext_alt_text"), - @KeyValue(key = "tweet_mode", valueKey = "tweet_mode") + @KeyValue(key = "tweet_mode", valueKey = "tweet_mode"), + @KeyValue(key = "model_version", valueKey = "model_version") }) public class StatusAnnotationTemplate { } diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageConversation.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageConversation.java new file mode 100644 index 000000000..3e5e8fb0c --- /dev/null +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageConversation.java @@ -0,0 +1,36 @@ +package org.mariotaku.twidere.model; + +import org.mariotaku.commons.objectcursor.LoganSquareCursorFieldConverter; +import org.mariotaku.library.objectcursor.annotation.CursorField; +import org.mariotaku.library.objectcursor.annotation.CursorObject; +import org.mariotaku.twidere.model.util.UserKeyCursorFieldConverter; +import org.mariotaku.twidere.provider.TwidereDataStore; +import org.mariotaku.twidere.provider.TwidereDataStore.Messages.Conversations; + +/** + * Created by mariotaku on 16/6/6. + */ +@CursorObject(tableInfo = true, valuesCreator = true) +public class ParcelableMessageConversation { + @CursorField(value = Conversations._ID, type = TwidereDataStore.TYPE_PRIMARY_KEY) + public long _id; + @CursorField(Conversations.CONVERSATION_ID) + public String id; + @CursorField(value = Conversations.ACCOUNT_KEY, converter = UserKeyCursorFieldConverter.class) + public UserKey account_key; + @CursorField(value = Conversations.LAST_SEND_AT) + public long last_send_at; + @CursorField(Conversations.TEXT_UNESCAPED) + public String text_unescaped; + @CursorField(value = Conversations.MEDIA_JSON, converter = LoganSquareCursorFieldConverter.class) + public ParcelableMedia[] media; + @CursorField(value = Conversations.PARTICIPANTS, converter = LoganSquareCursorFieldConverter.class) + public ParcelableUser[] participants; + @CursorField(value = Conversations.SENDER_KEY, converter = UserKeyCursorFieldConverter.class) + public UserKey sender_key; + @CursorField(value = Conversations.RECIPIENT_KEY, converter = UserKeyCursorFieldConverter.class) + public UserKey recipient_key; + @CursorField(value = Conversations.REQUEST_CURSOR) + public String request_cursor; + +} diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageEntry.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageEntry.java deleted file mode 100644 index ec80bcbdd..000000000 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMessageEntry.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.mariotaku.twidere.model; - -import org.mariotaku.library.objectcursor.annotation.CursorField; -import org.mariotaku.library.objectcursor.annotation.CursorObject; -import org.mariotaku.twidere.model.util.UserKeyCursorFieldConverter; -import org.mariotaku.twidere.provider.TwidereDataStore.Messages.Entries; - -/** - * Created by mariotaku on 16/3/28. - */ -@CursorObject -public class ParcelableMessageEntry { - - @CursorField(value = Entries._ID, excludeWrite = true) - public long id; - @CursorField(value = Entries.ACCOUNT_KEY, converter = UserKeyCursorFieldConverter.class) - public UserKey account_key; - @CursorField(value = Entries.CONVERSATION_ID) - public String conversation_id; - @CursorField(value = Entries.UPDATED_AT) - public long updated_at; - @CursorField(value = Entries.TEXT_CONTENT) - public String text_content; - -} diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/provider/TwidereDataStore.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/provider/TwidereDataStore.java index 5b1840530..d4908dbbb 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/provider/TwidereDataStore.java +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/provider/TwidereDataStore.java @@ -374,10 +374,15 @@ public interface TwidereDataStore { interface Messages extends BaseColumns, InsertedDateColumns, AccountSupportColumns { - interface Entries extends BaseColumns, InsertedDateColumns, AccountSupportColumns { + interface Conversations extends BaseColumns, AccountSupportColumns { String CONVERSATION_ID = "conversation_id"; - String UPDATED_AT = "updated_at"; - String TEXT_CONTENT = "text_content"; + String TEXT_UNESCAPED = "text_unescaped"; + String LAST_SEND_AT = "last_send_at"; + String MEDIA_JSON = "media_json"; + String PARTICIPANTS = "participants"; + String SENDER_KEY = "sender_key"; + String RECIPIENT_KEY = "recipient_key"; + String REQUEST_CURSOR = "request_cursor"; } }