3532: Show badge on conversations tab on new conversations (#3890)

Fixes #3532

(Old PR, now closed: https://github.com/tuskyapp/Tusky/pull/3533)

Listens on new notifications and if a "direct mention" is detected a
badge (red dot) is shown on the conversations tab if present.

I am missing things like this a lot and also big accounts are unhappy
with the usability so far:
https://mastodon.social/@pallenberg/110129889996182814
This commit is contained in:
UlrichKu 2023-10-15 21:39:38 +02:00 committed by GitHub
commit b286255630
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 1109 additions and 4 deletions

View file

@ -33,6 +33,8 @@
* see <http://www.gnu.org/licenses>. */
package com.keylesspalace.tusky.util
import androidx.paging.CombinedLoadStates
import androidx.paging.LoadState
import com.keylesspalace.tusky.entity.Notification
import com.keylesspalace.tusky.entity.Status
import com.keylesspalace.tusky.entity.TrendingTag
@ -87,3 +89,7 @@ fun List<TrendingTag>.toViewData(): List<TrendingViewData.Tag> {
)
}
}
fun CombinedLoadStates.isAnyLoading(): Boolean {
return this.refresh == LoadState.Loading || this.append == LoadState.Loading || this.prepend == LoadState.Loading
}