Add CLEAR and FILTER buttons to notifications (#1168)

* Issue tuskyapp#762 add clear notifications button to the top of the Notifications adapter

* Issue tuskyapp#764 add the notifications filter

* Update notifications top bar buttons

* Replace PopupMenu with PopupWindow. Save notifications filter to the account table

* Disable hide top bar on empty content at the notification screen

* Add app bar behavior to the sw640 notification layout

* Fix issue with click on top notification tab
This commit is contained in:
pandasoft0 2019-04-09 20:13:54 +03:00 committed by Konrad Pozniak
commit 63e4c1d4e0
15 changed files with 1247 additions and 28 deletions

View file

@ -51,7 +51,8 @@ data class AccountEntity(@field:PrimaryKey(autoGenerate = true) var id: Long,
var lastNotificationId: String = "0",
var activeNotifications: String = "[]",
var emojis: List<Emoji> = emptyList(),
var tabPreferences: List<TabData> = defaultTabs()) {
var tabPreferences: List<TabData> = defaultTabs(),
var notificationsFilter: String = "[]") {
val identifier: String
get() = "$domain:$accountId"

View file

@ -30,7 +30,7 @@ import androidx.annotation.NonNull;
@Database(entities = {TootEntity.class, AccountEntity.class, InstanceEntity.class, TimelineStatusEntity.class,
TimelineAccountEntity.class, ConversationEntity.class
}, version = 13)
}, version = 14)
public abstract class AppDatabase extends RoomDatabase {
public abstract TootDao tootDao();
@ -256,6 +256,13 @@ public abstract class AppDatabase extends RoomDatabase {
}
};
public static final Migration MIGRATION_13_14 = new Migration(13, 14) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE `AccountEntity` ADD COLUMN `notificationsFilter` TEXT NOT NULL DEFAULT '[]'");
}
};
public static final Migration MIGRATION_10_13 = new Migration(10, 13) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {