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:
parent
01234bb94b
commit
63e4c1d4e0
15 changed files with 1247 additions and 28 deletions
|
@ -15,10 +15,7 @@
|
|||
|
||||
package com.keylesspalace.tusky.entity
|
||||
|
||||
import com.google.gson.JsonDeserializationContext
|
||||
import com.google.gson.JsonDeserializer
|
||||
import com.google.gson.JsonElement
|
||||
import com.google.gson.JsonParseException
|
||||
import com.google.gson.*
|
||||
import com.google.gson.annotations.JsonAdapter
|
||||
|
||||
data class Notification(
|
||||
|
@ -28,26 +25,28 @@ data class Notification(
|
|||
val status: Status?) {
|
||||
|
||||
@JsonAdapter(NotificationTypeAdapter::class)
|
||||
enum class Type {
|
||||
UNKNOWN,
|
||||
MENTION,
|
||||
REBLOG,
|
||||
FAVOURITE,
|
||||
FOLLOW;
|
||||
enum class Type(val presentation: String) {
|
||||
UNKNOWN("unknown"),
|
||||
MENTION("mention"),
|
||||
REBLOG("reblog"),
|
||||
FAVOURITE("favourite"),
|
||||
FOLLOW("follow");
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun byString(s: String): Type {
|
||||
return when (s) {
|
||||
"mention" -> MENTION
|
||||
"reblog" -> REBLOG
|
||||
"favourite" -> FAVOURITE
|
||||
"follow" -> FOLLOW
|
||||
else -> UNKNOWN
|
||||
values().forEach {
|
||||
if (s == it.presentation)
|
||||
return it
|
||||
}
|
||||
return UNKNOWN
|
||||
}
|
||||
val asList = listOf(MENTION,REBLOG,FAVOURITE,FOLLOW)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return presentation
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue