mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
ThrottleLast the notification drawer manager
This commit is contained in:
parent
535b41d818
commit
e90aeff417
1 changed files with 10 additions and 3 deletions
|
@ -168,13 +168,20 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
|||
|
||||
|
||||
fun refreshNotificationDrawer() {
|
||||
backgroundHandler.post {
|
||||
refreshNotificationDrawerBg()
|
||||
}
|
||||
// Implement last throttler
|
||||
Timber.w("refreshNotificationDrawer()")
|
||||
backgroundHandler.removeCallbacksAndMessages(null)
|
||||
backgroundHandler.postDelayed(
|
||||
{
|
||||
refreshNotificationDrawerBg()
|
||||
}
|
||||
, 200)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun refreshNotificationDrawerBg() {
|
||||
Timber.w("refreshNotificationDrawerBg()")
|
||||
|
||||
val session = activeSessionHolder.getActiveSession()
|
||||
val user = session.getUser(session.sessionParams.credentials.userId)
|
||||
val myUserDisplayName = user?.displayName ?: ""
|
||||
|
|
Loading…
Add table
Reference in a new issue