Tab customization & direct messages tab (#1012)
* custom tabs * custom tabs interface * implement custom tab functionality * add database migration * fix bugs, improve ThemeUtils nullability handling * implement conversationsfragment * setup ConversationViewHolder * implement favs * add button functionality * revert 10.json * revert item_status_notification.xml * implement more menu, replying, fix stuff, clean up * fix tests * fix bug with expanding statuses * min and max number of tabs * settings support, fix bugs * database migration * fix scrolling to top after refresh * fix bugs * fix warning in item_conversation
This commit is contained in:
parent
adf573646e
commit
e371fa0e24
75 changed files with 3663 additions and 296 deletions
|
|
@ -15,6 +15,9 @@
|
|||
|
||||
package com.keylesspalace.tusky.db;
|
||||
|
||||
import com.keylesspalace.tusky.TabDataKt;
|
||||
import com.keylesspalace.tusky.components.conversation.ConversationEntity;
|
||||
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.RoomDatabase;
|
||||
|
|
@ -25,14 +28,15 @@ import androidx.annotation.NonNull;
|
|||
* DB version & declare DAO
|
||||
*/
|
||||
|
||||
@Database(entities = {TootEntity.class, AccountEntity.class, InstanceEntity.class,TimelineStatusEntity.class,
|
||||
TimelineAccountEntity.class
|
||||
}, version = 11)
|
||||
@Database(entities = {TootEntity.class, AccountEntity.class, InstanceEntity.class, TimelineStatusEntity.class,
|
||||
TimelineAccountEntity.class, ConversationEntity.class
|
||||
}, version = 12)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract TootDao tootDao();
|
||||
public abstract AccountDao accountDao();
|
||||
public abstract InstanceDao instanceDao();
|
||||
public abstract ConversationsDao conversationDao();
|
||||
public abstract TimelineDao timelineDao();
|
||||
|
||||
public static final Migration MIGRATION_2_3 = new Migration(2, 3) {
|
||||
|
|
@ -166,4 +170,41 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||
}
|
||||
};
|
||||
|
||||
public static final Migration MIGRATION_11_12 = new Migration(11, 12) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
String defaultTabs = TabDataKt.HOME + ";" +
|
||||
TabDataKt.NOTIFICATIONS + ";" +
|
||||
TabDataKt.LOCAL + ";" +
|
||||
TabDataKt.FEDERATED;
|
||||
database.execSQL("ALTER TABLE `AccountEntity` ADD COLUMN `tabPreferences` TEXT NOT NULL DEFAULT '" + defaultTabs + "'");
|
||||
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS `ConversationEntity` (" +
|
||||
"`accountId` INTEGER NOT NULL, " +
|
||||
"`id` TEXT NOT NULL, " +
|
||||
"`accounts` TEXT NOT NULL, " +
|
||||
"`unread` INTEGER NOT NULL, " +
|
||||
"`s_id` TEXT NOT NULL, " +
|
||||
"`s_url` TEXT, " +
|
||||
"`s_inReplyToId` TEXT, " +
|
||||
"`s_inReplyToAccountId` TEXT, " +
|
||||
"`s_account` TEXT NOT NULL, " +
|
||||
"`s_content` TEXT NOT NULL, " +
|
||||
"`s_createdAt` INTEGER NOT NULL, " +
|
||||
"`s_emojis` TEXT NOT NULL, " +
|
||||
"`s_favouritesCount` INTEGER NOT NULL, " +
|
||||
"`s_favourited` INTEGER NOT NULL, " +
|
||||
"`s_sensitive` INTEGER NOT NULL, " +
|
||||
"`s_spoilerText` TEXT NOT NULL, " +
|
||||
"`s_attachments` TEXT NOT NULL, " +
|
||||
"`s_mentions` TEXT NOT NULL, " +
|
||||
"`s_showingHiddenContent` INTEGER NOT NULL, " +
|
||||
"`s_expanded` INTEGER NOT NULL, " +
|
||||
"`s_collapsible` INTEGER NOT NULL, " +
|
||||
"`s_collapsed` INTEGER NOT NULL, " +
|
||||
"PRIMARY KEY(`id`, `accountId`))");
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue