Inject IconLoader and BitmapLoader

This commit is contained in:
Benoit Marty 2019-07-08 10:30:45 +02:00
parent 62a81a556e
commit 8c872caf78
3 changed files with 10 additions and 6 deletions

View File

@ -22,8 +22,11 @@ import androidx.annotation.WorkerThread
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.DecodeFormat
import timber.log.Timber 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 * Avatar Url -> Icon

View File

@ -24,8 +24,11 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.RequestOptions
import timber.log.Timber 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 * Avatar Url -> Icon

View File

@ -45,6 +45,8 @@ import javax.inject.Singleton
@Singleton @Singleton
class NotificationDrawerManager @Inject constructor(private val context: Context, class NotificationDrawerManager @Inject constructor(private val context: Context,
private val activeSessionHolder: ActiveSessionHolder, private val activeSessionHolder: ActiveSessionHolder,
private val iconLoader: IconLoader,
private val bitmapLoader: BitmapLoader,
private val outdatedDetector: OutdatedEventDetector?) { private val outdatedDetector: OutdatedEventDetector?) {


private val handlerThread: HandlerThread = HandlerThread("NotificationDrawerManager", Thread.MIN_PRIORITY) 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 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. 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 The notification corresponding to this event will not be displayed until