From 2dd2a8db6ca21e4dc6106710ef95eacd62dc77e6 Mon Sep 17 00:00:00 2001 From: ganfra Date: Wed, 8 Jan 2020 11:54:42 +0100 Subject: [PATCH] Emoji data source as singleton --- .../src/main/java/im/vector/riotx/core/di/VectorComponent.kt | 3 +++ .../im/vector/riotx/features/reactions/data/EmojiDataSource.kt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/core/di/VectorComponent.kt b/vector/src/main/java/im/vector/riotx/core/di/VectorComponent.kt index b78e291506..283b43a004 100644 --- a/vector/src/main/java/im/vector/riotx/core/di/VectorComponent.kt +++ b/vector/src/main/java/im/vector/riotx/core/di/VectorComponent.kt @@ -44,6 +44,7 @@ import im.vector.riotx.features.notifications.* import im.vector.riotx.features.rageshake.BugReporter import im.vector.riotx.features.rageshake.VectorFileLogger import im.vector.riotx.features.rageshake.VectorUncaughtExceptionHandler +import im.vector.riotx.features.reactions.data.EmojiDataSource import im.vector.riotx.features.session.SessionListener import im.vector.riotx.features.settings.VectorPreferences import im.vector.riotx.features.share.ShareRoomListDataSource @@ -124,6 +125,8 @@ interface VectorComponent { fun uiStateRepository(): UiStateRepository + fun emojiDataSource(): EmojiDataSource + @Component.Factory interface Factory { fun create(@BindsInstance context: Context): VectorComponent diff --git a/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt b/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt index 9317c645c4..2917dce68a 100644 --- a/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt +++ b/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt @@ -20,8 +20,9 @@ import com.squareup.moshi.Moshi import im.vector.riotx.R import im.vector.riotx.core.di.ScreenScope import javax.inject.Inject +import javax.inject.Singleton -@ScreenScope +@Singleton class EmojiDataSource @Inject constructor( resources: Resources ) {