From 69f37208a5549c3ec0ffca026a8ff9b1a6be73ca Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 13 Sep 2020 23:49:30 +0300 Subject: [PATCH] chats: disable pagination for chat listing, another finalization of chat bubble design --- .../25.json | 8 +- app/src/husky/res/values/strings.xml | 7 +- .../tusky/adapter/ChatMessagesAdapter.kt | 48 +-- .../tusky/adapter/ChatsAdapter.kt | 37 +- .../tusky/components/chat/ChatActivity.kt | 332 +++++++++++++++++- .../components/compose/MediaPreviewAdapter.kt | 1 - .../keylesspalace/tusky/db/AppDatabase.java | 2 +- .../tusky/db/ChatMessageEntity.kt | 2 +- .../com/keylesspalace/tusky/db/ChatsDao.kt | 2 +- .../keylesspalace/tusky/di/NetworkModule.kt | 4 +- .../keylesspalace/tusky/entity/Attachment.kt | 10 + .../com/keylesspalace/tusky/entity/Chat.kt | 5 +- .../tusky/fragment/ChatsFragment.kt | 99 +++--- .../tusky/repository/ChatRepository.kt | 29 +- .../tusky/util/ViewDataUtils.java | 3 +- .../tusky/viewdata/ChatViewData.kt | 73 +++- app/src/main/res/layout/activity_chat.xml | 2 +- app/src/main/res/layout/item_our_message.xml | 67 ++-- .../main/res/layout/item_their_message.xml | 70 ++-- app/src/main/res/values/dimens.xml | 1 + 20 files changed, 597 insertions(+), 205 deletions(-) diff --git a/app/schemas/com.keylesspalace.tusky.db.AppDatabase/25.json b/app/schemas/com.keylesspalace.tusky.db.AppDatabase/25.json index 7a1c47fc..f879ddd9 100644 --- a/app/schemas/com.keylesspalace.tusky.db.AppDatabase/25.json +++ b/app/schemas/com.keylesspalace.tusky.db.AppDatabase/25.json @@ -2,7 +2,7 @@ "formatVersion": 1, "database": { "version": 25, - "identityHash": "322074fec4881114e2d85da67166e31f", + "identityHash": "8c97dfd1b3d04602e25139ec97d2a282", "entities": [ { "tableName": "TootEntity", @@ -802,7 +802,7 @@ }, { "tableName": "ChatMessageEntity", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`localId` INTEGER NOT NULL, `messageId` TEXT NOT NULL, `content` TEXT NOT NULL, `chatId` TEXT NOT NULL, `accountId` TEXT NOT NULL, `createdAt` INTEGER NOT NULL, `attachment` TEXT, `emojis` TEXT NOT NULL, PRIMARY KEY(`localId`, `messageId`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`localId` INTEGER NOT NULL, `messageId` TEXT NOT NULL, `content` TEXT, `chatId` TEXT NOT NULL, `accountId` TEXT NOT NULL, `createdAt` INTEGER NOT NULL, `attachment` TEXT, `emojis` TEXT NOT NULL, PRIMARY KEY(`localId`, `messageId`))", "fields": [ { "fieldPath": "localId", @@ -820,7 +820,7 @@ "fieldPath": "content", "columnName": "content", "affinity": "TEXT", - "notNull": true + "notNull": false }, { "fieldPath": "chatId", @@ -867,7 +867,7 @@ "views": [], "setupQueries": [ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '322074fec4881114e2d85da67166e31f')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '8c97dfd1b3d04602e25139ec97d2a282')" ] } } \ No newline at end of file diff --git a/app/src/husky/res/values/strings.xml b/app/src/husky/res/values/strings.xml index 7d1bdcc3..66d9ea72 100644 --- a/app/src/husky/res/values/strings.xml +++ b/app/src/husky/res/values/strings.xml @@ -1,6 +1,7 @@ Chats + You: %s Mark as read Reply to @@ -31,6 +32,11 @@ Hide muted users Enable bigger custom emojis Enable experimental Pleroma-FE stickers(if available) + + Image + Video + Audio + Attachment Post visibility @@ -87,7 +93,6 @@ Scheduled posts Repeated by Post - Just landed in L.A.