forked from GitHub-Mirror/riotX-android
Inject IconLoader and BitmapLoader
This commit is contained in:
parent
62a81a556e
commit
8c872caf78
@ -22,8 +22,11 @@ import androidx.annotation.WorkerThread
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.DecodeFormat
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
class BitmapLoader(val context: Context) {
|
||||
@Singleton
|
||||
class BitmapLoader @Inject constructor(val context: Context) {
|
||||
|
||||
/**
|
||||
* Avatar Url -> Icon
|
||||
|
@ -24,8 +24,11 @@ import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.DecodeFormat
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
class IconLoader(val context: Context) {
|
||||
@Singleton
|
||||
class IconLoader @Inject constructor(val context: Context) {
|
||||
|
||||
/**
|
||||
* Avatar Url -> Icon
|
||||
|
@ -45,6 +45,8 @@ import javax.inject.Singleton
|
||||
@Singleton
|
||||
class NotificationDrawerManager @Inject constructor(private val context: Context,
|
||||
private val activeSessionHolder: ActiveSessionHolder,
|
||||
private val iconLoader: IconLoader,
|
||||
private val bitmapLoader: BitmapLoader,
|
||||
private val outdatedDetector: OutdatedEventDetector?) {
|
||||
|
||||
private val handlerThread: HandlerThread = HandlerThread("NotificationDrawerManager", Thread.MIN_PRIORITY)
|
||||
@ -64,10 +66,6 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
||||
|
||||
private var currentRoomId: String? = null
|
||||
|
||||
private var iconLoader = IconLoader(context)
|
||||
|
||||
private var bitmapLoader = BitmapLoader(context)
|
||||
|
||||
/**
|
||||
Should be called as soon as a new event is ready to be displayed.
|
||||
The notification corresponding to this event will not be displayed until
|
||||
|
Loading…
Reference in New Issue
Block a user