mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Rename all @BindingContainer types with a BindingContainer suffix
Metro's @BindingContainer replaced Dagger's @Module, but the declarations kept the old Module suffix. Rename them (and their dedicated files) so the type name matches the annotation, matching UserStatusBindingContainer which already followed this convention. No behaviour change: Metro discovers containers via @ContributesTo, so there were only two call sites to update, both in tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import kotlin.reflect.KClass
|
|||||||
*
|
*
|
||||||
* @BindingContainer
|
* @BindingContainer
|
||||||
* @ContributesTo(Scope::class)
|
* @ContributesTo(Scope::class)
|
||||||
* abstract class YourNodeModule {
|
* abstract class YourNodeBindingContainer {
|
||||||
|
|
||||||
* @Binds
|
* @Binds
|
||||||
* @IntoMap
|
* @IntoMap
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ import java.io.File
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object AppModule {
|
object AppBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@BaseDirectory
|
@BaseDirectory
|
||||||
fun providesBaseDirectory(@ApplicationContext context: Context): File {
|
fun providesBaseDirectory(@ApplicationContext context: Context): File {
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.Presenter
|
|||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface AnalyticsModule {
|
interface AnalyticsBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindAnalyticsPreferencesPresenter(presenter: AnalyticsPreferencesPresenter): Presenter<AnalyticsPreferencesState>
|
fun bindAnalyticsPreferencesPresenter(presenter: AnalyticsPreferencesPresenter): Presenter<AnalyticsPreferencesState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -21,7 +21,7 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
object ContentScannerModule {
|
object ContentScannerBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@SingleIn(RoomScope::class)
|
@SingleIn(RoomScope::class)
|
||||||
fun providesContentScannerService(
|
fun providesContentScannerService(
|
||||||
+5
-5
@@ -15,16 +15,16 @@ import io.element.android.tests.testutils.testCoroutineDispatchers
|
|||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class ContentScannerModuleTest {
|
class ContentScannerBindingContainerTest {
|
||||||
@Test
|
@Test
|
||||||
fun `ContentScannerModule provides NoopContentScannerService when ContentScanner is null`() = runTest {
|
fun `ContentScannerBindingContainer provides NoopContentScannerService when ContentScanner is null`() = runTest {
|
||||||
// Given
|
// Given
|
||||||
val contentScanner: ContentScanner? = null
|
val contentScanner: ContentScanner? = null
|
||||||
val sessionCoroutineScope = backgroundScope
|
val sessionCoroutineScope = backgroundScope
|
||||||
val coroutineDispatchers = testCoroutineDispatchers()
|
val coroutineDispatchers = testCoroutineDispatchers()
|
||||||
|
|
||||||
// When
|
// When
|
||||||
val contentScannerService = ContentScannerModule.providesContentScannerService(
|
val contentScannerService = ContentScannerBindingContainer.providesContentScannerService(
|
||||||
contentScanner = contentScanner,
|
contentScanner = contentScanner,
|
||||||
coroutineScope = sessionCoroutineScope,
|
coroutineScope = sessionCoroutineScope,
|
||||||
coroutineDispatchers = coroutineDispatchers,
|
coroutineDispatchers = coroutineDispatchers,
|
||||||
@@ -35,14 +35,14 @@ class ContentScannerModuleTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `ContentScannerModule provides DefaultContentScannerService when ContentScanner is not null`() = runTest {
|
fun `ContentScannerBindingContainer provides DefaultContentScannerService when ContentScanner is not null`() = runTest {
|
||||||
// Given
|
// Given
|
||||||
val contentScanner: ContentScanner? = FakeContentScanner()
|
val contentScanner: ContentScanner? = FakeContentScanner()
|
||||||
val sessionCoroutineScope = backgroundScope
|
val sessionCoroutineScope = backgroundScope
|
||||||
val coroutineDispatchers = testCoroutineDispatchers()
|
val coroutineDispatchers = testCoroutineDispatchers()
|
||||||
|
|
||||||
// When
|
// When
|
||||||
val contentScannerService = ContentScannerModule.providesContentScannerService(
|
val contentScannerService = ContentScannerBindingContainer.providesContentScannerService(
|
||||||
contentScanner = contentScanner,
|
contentScanner = contentScanner,
|
||||||
coroutineScope = sessionCoroutineScope,
|
coroutineScope = sessionCoroutineScope,
|
||||||
coroutineDispatchers = coroutineDispatchers,
|
coroutineDispatchers = coroutineDispatchers,
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
|||||||
|
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface FtueModule {
|
interface FtueBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindChooseSelfVerificationMethodPresenter(presenter: ChooseSelfVerificationModePresenter): Presenter<ChooseSelfVerificationModeState>
|
fun bindChooseSelfVerificationMethodPresenter(presenter: ChooseSelfVerificationModePresenter): Presenter<ChooseSelfVerificationModeState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
interface HomeSpacesModule {
|
interface HomeSpacesBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindHomeSpacesPresenter(presenter: HomeSpacesPresenter): Presenter<HomeSpacesState>
|
fun bindHomeSpacesPresenter(presenter: HomeSpacesPresenter): Presenter<HomeSpacesState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -26,7 +26,7 @@ import io.element.android.libraries.di.SessionScope
|
|||||||
|
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface RoomListModule {
|
interface RoomListBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindRoomListPresenter(presenter: RoomListPresenter): Presenter<RoomListState>
|
fun bindRoomListPresenter(presenter: RoomListPresenter): Presenter<RoomListState>
|
||||||
|
|
||||||
+1
-1
@@ -22,7 +22,7 @@ import io.element.android.libraries.matrix.api.MatrixClient
|
|||||||
|
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface InviteModule {
|
interface InviteBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindAcceptDeclinePresenter(presenter: AcceptDeclineInvitePresenter): Presenter<AcceptDeclineInviteState>
|
fun bindAcceptDeclinePresenter(presenter: AcceptDeclineInvitePresenter): Presenter<AcceptDeclineInviteState>
|
||||||
|
|
||||||
+1
-1
@@ -27,7 +27,7 @@ import java.util.Optional
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
object JoinRoomModule {
|
object JoinRoomBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun providesJoinRoomPresenterFactory(
|
fun providesJoinRoomPresenterFactory(
|
||||||
client: MatrixClient,
|
client: MatrixClient,
|
||||||
+1
-1
@@ -20,7 +20,7 @@ import io.element.android.libraries.matrix.api.room.powerlevels.permissionsFlow
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
object KnockRequestsModule {
|
object KnockRequestsBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@SingleIn(RoomScope::class)
|
@SingleIn(RoomScope::class)
|
||||||
fun knockRequestsService(room: JoinedRoom): KnockRequestsService {
|
fun knockRequestsService(room: JoinedRoom): KnockRequestsService {
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
|||||||
|
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface LeaveRoomModule {
|
interface LeaveRoomBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindLeaveRoomPresenter(presenter: LeaveRoomPresenter): Presenter<LeaveRoomState>
|
fun bindLeaveRoomPresenter(presenter: LeaveRoomPresenter): Presenter<LeaveRoomState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -27,7 +27,7 @@ data class LockScreenConfig(
|
|||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
object LockScreenConfigModule {
|
object LockScreenConfigBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun providesLockScreenConfig(): LockScreenConfig = LockScreenConfig(
|
fun providesLockScreenConfig(): LockScreenConfig = LockScreenConfig(
|
||||||
isPinMandatory = AppConfigLockScreenConfig.IS_PIN_MANDATORY,
|
isPinMandatory = AppConfigLockScreenConfig.IS_PIN_MANDATORY,
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import io.element.android.libraries.architecture.Presenter
|
|||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface LoginModule {
|
interface LoginBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindChangeServerPresenter(presenter: ChangeServerPresenter): Presenter<ChangeServerState>
|
fun bindChangeServerPresenter(presenter: ChangeServerPresenter): Presenter<ChangeServerState>
|
||||||
|
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
|||||||
|
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface LogoutModule {
|
interface LogoutBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindDirectLogoutPresenter(presenter: DirectLogoutPresenter): Presenter<DirectLogoutState>
|
fun bindDirectLogoutPresenter(presenter: DirectLogoutPresenter): Presenter<DirectLogoutState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -34,7 +34,7 @@ import io.element.android.libraries.di.RoomScope
|
|||||||
|
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface MessagesBindsModule {
|
interface MessagesBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindPinnedMessagesBannerPresenter(presenter: PinnedMessagesBannerPresenter): Presenter<PinnedMessagesBannerState>
|
fun bindPinnedMessagesBannerPresenter(presenter: PinnedMessagesBannerPresenter): Presenter<PinnedMessagesBannerState>
|
||||||
|
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.timeline.Timeline
|
|||||||
|
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
object MessagesProvidesModule {
|
object MessagesProvidesBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@LiveTimeline
|
@LiveTimeline
|
||||||
fun provideLiveTimeline(joinedRoom: JoinedRoom): Timeline = joinedRoom.liveTimeline
|
fun provideLiveTimeline(joinedRoom: JoinedRoom): Timeline = joinedRoom.liveTimeline
|
||||||
+1
-1
@@ -27,7 +27,7 @@ import kotlin.reflect.KClass
|
|||||||
*/
|
*/
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
interface TimelineItemPresenterFactoriesModule {
|
interface TimelineItemPresenterFactoriesBindingContainer {
|
||||||
@Multibinds
|
@Multibinds
|
||||||
fun multiBindTimelineItemPresenterFactories(): @JvmSuppressWildcards Map<KClass<out TimelineItemEventContent>, TimelineItemPresenterFactory<*, *>>
|
fun multiBindTimelineItemPresenterFactories(): @JvmSuppressWildcards Map<KClass<out TimelineItemEventContent>, TimelineItemPresenterFactory<*, *>>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ import io.element.android.libraries.voiceplayer.api.VoiceMessageState
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
interface VoiceMessagePresenterModule {
|
interface VoiceMessagePresenterBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
@IntoMap
|
@IntoMap
|
||||||
@TimelineItemEventContentKey(TimelineItemVoiceContent::class)
|
@TimelineItemEventContentKey(TimelineItemVoiceContent::class)
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.Presenter
|
|||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface DeveloperSettingsModule {
|
interface DeveloperSettingsBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindAppDeveloperSettingsPresenter(presenter: AppDeveloperSettingsPresenter): Presenter<AppDeveloperSettingsState>
|
fun bindAppDeveloperSettingsPresenter(presenter: AppDeveloperSettingsPresenter): Presenter<AppDeveloperSettingsState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -22,7 +22,7 @@ import io.element.android.libraries.architecture.Presenter
|
|||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface RageshakeModule {
|
interface RageshakeBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindRageshakePreferencesPresenter(presenter: RageshakePreferencesPresenter): Presenter<RageshakePreferencesState>
|
fun bindRageshakePreferencesPresenter(presenter: RageshakePreferencesPresenter): Presenter<RageshakePreferencesState>
|
||||||
|
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.core.RoomAlias
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
object RoomAliasResolverModule {
|
object RoomAliasResolverBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun providesJoinRoomPresenterFactory(
|
fun providesJoinRoomPresenterFactory(
|
||||||
client: MatrixClient,
|
client: MatrixClient,
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.RoomScope
|
|||||||
|
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface RoomCallModule {
|
interface RoomCallBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindRoomCallStatePresenter(presenter: RoomCallStatePresenter): Presenter<RoomCallState>
|
fun bindRoomCallStatePresenter(presenter: RoomCallStatePresenter): Presenter<RoomCallState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -21,7 +21,7 @@ import io.element.android.libraries.matrix.api.room.JoinedRoom
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
object RoomMemberModule {
|
object RoomMemberBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun provideRoomMemberDetailsPresenterFactory(
|
fun provideRoomMemberDetailsPresenterFactory(
|
||||||
room: JoinedRoom,
|
room: JoinedRoom,
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.RoomScope
|
|||||||
|
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface RoomMemberModerationModule {
|
interface RoomMemberModerationBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindRoomMemberModerationPresenter(presenter: RoomMemberModerationPresenter): Presenter<RoomMemberModerationState>
|
fun bindRoomMemberModerationPresenter(presenter: RoomMemberModerationPresenter): Presenter<RoomMemberModerationState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -22,7 +22,7 @@ import timber.log.Timber
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object CacheStoreModule {
|
object CacheStoreBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
fun provideCacheDatabase(
|
fun provideCacheDatabase(
|
||||||
+1
-1
@@ -18,7 +18,7 @@ internal const val ANDROID_KEYSTORE = "AndroidKeyStore"
|
|||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
object CryptographyModule {
|
object CryptographyBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun providesAndroidKeyStore(): KeyStore {
|
fun providesAndroidKeyStore(): KeyStore {
|
||||||
return KeyStore.getInstance(ANDROID_KEYSTORE).apply {
|
return KeyStore.getInstance(ANDROID_KEYSTORE).apply {
|
||||||
+1
-1
@@ -19,7 +19,7 @@ import kotlin.time.Clock
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object DateFormatterModule {
|
object DateFormatterBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun providesClock(): Clock = Clock.System
|
fun providesClock(): Clock = Clock.System
|
||||||
|
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.featureflag.impl.PreferencesFeatureFlagProvi
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object FeatureFlagModule {
|
object FeatureFlagBindingContainer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
@Provides
|
@Provides
|
||||||
@ElementsIntoSet
|
@ElementsIntoSet
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.fullscreenintent.impl.FullScreenIntentPermis
|
|||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
interface FullScreenIntentModule {
|
interface FullScreenIntentBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
fun bindFullScreenIntentPermissionsPresenter(presenter: FullScreenIntentPermissionsPresenter): Presenter<FullScreenIntentPermissionsState>
|
fun bindFullScreenIntentPermissionsPresenter(presenter: FullScreenIntentPermissionsPresenter): Presenter<FullScreenIntentPermissionsState>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -18,7 +18,7 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
object RoomModule {
|
object RoomBindingContainer {
|
||||||
@RoomCoroutineScope
|
@RoomCoroutineScope
|
||||||
@Provides
|
@Provides
|
||||||
fun providesSessionCoroutineScope(room: BaseRoom): CoroutineScope {
|
fun providesSessionCoroutineScope(room: BaseRoom): CoroutineScope {
|
||||||
+1
-1
@@ -34,7 +34,7 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
object SessionMatrixModule {
|
object SessionMatrixBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun providesSessionId(matrixClient: MatrixClient): SessionId {
|
fun providesSessionId(matrixClient: MatrixClient): SessionId {
|
||||||
return matrixClient.sessionId
|
return matrixClient.sessionId
|
||||||
+1
-1
@@ -46,7 +46,7 @@ interface SimplePlayer {
|
|||||||
|
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
object SimplePlayerModule {
|
object SimplePlayerBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun simplePlayerProvider(
|
fun simplePlayerProvider(
|
||||||
@ApplicationContext context: Context,
|
@ApplicationContext context: Context,
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ import kotlin.reflect.KClass
|
|||||||
*/
|
*/
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
interface MediaItemPresenterFactoriesModule {
|
interface MediaItemPresenterFactoriesBindingContainer {
|
||||||
@Multibinds
|
@Multibinds
|
||||||
fun multiBindMediaItemPresenterFactories(): @JvmSuppressWildcards Map<KClass<out MediaItem.Event>, MediaItemPresenterFactory<*, *>>
|
fun multiBindMediaItemPresenterFactories(): @JvmSuppressWildcards Map<KClass<out MediaItem.Event>, MediaItemPresenterFactory<*, *>>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ import kotlin.time.Duration
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
interface VoiceMessagePresenterModule {
|
interface VoiceMessagePresenterBindingContainer {
|
||||||
@Binds
|
@Binds
|
||||||
@IntoMap
|
@IntoMap
|
||||||
@MediaItemEventContentKey(MediaItem.Voice::class)
|
@MediaItemEventContentKey(MediaItem.Voice::class)
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object NetworkModule {
|
object NetworkBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
fun providesOkHttpClient(
|
fun providesOkHttpClient(
|
||||||
+1
-1
@@ -19,7 +19,7 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(SessionScope::class)
|
@ContributesTo(SessionScope::class)
|
||||||
object SessionPreferencesModule {
|
object SessionPreferencesBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun providesSessionPreferencesStore(
|
fun providesSessionPreferencesStore(
|
||||||
defaultSessionPreferencesStoreFactory: DefaultSessionPreferencesStoreFactory,
|
defaultSessionPreferencesStoreFactory: DefaultSessionPreferencesStoreFactory,
|
||||||
+1
-1
@@ -22,7 +22,7 @@ import io.element.android.libraries.push.impl.battery.BatteryOptimizationPresent
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
interface PushModule {
|
interface PushBindingContainer {
|
||||||
companion object {
|
companion object {
|
||||||
@Provides
|
@Provides
|
||||||
fun provideNotificationCompatManager(@ApplicationContext context: Context): NotificationManagerCompat {
|
fun provideNotificationCompatManager(@ApplicationContext context: Context): NotificationManagerCompat {
|
||||||
+1
-1
@@ -23,7 +23,7 @@ import timber.log.Timber
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object PushHistoryModule {
|
object PushHistoryBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
fun providePushDatabase(
|
fun providePushDatabase(
|
||||||
+1
-1
@@ -23,7 +23,7 @@ import timber.log.Timber
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object SessionStorageModule {
|
object SessionStorageBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
fun provideMatrixDatabase(
|
fun provideMatrixDatabase(
|
||||||
+1
-1
@@ -22,7 +22,7 @@ import io.element.android.opusencoder.OggOpusEncoder
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(RoomScope::class)
|
@ContributesTo(RoomScope::class)
|
||||||
object VoiceRecorderModule {
|
object VoiceRecorderBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun provideAudioConfig(): AudioConfig {
|
fun provideAudioConfig(): AudioConfig {
|
||||||
val sampleRate = SampleRate
|
val sampleRate = SampleRate
|
||||||
+2
-2
@@ -18,7 +18,7 @@ import io.element.android.libraries.voicerecorder.api.VoiceRecorderState
|
|||||||
import io.element.android.libraries.voicerecorder.impl.audio.Audio
|
import io.element.android.libraries.voicerecorder.impl.audio.Audio
|
||||||
import io.element.android.libraries.voicerecorder.impl.audio.AudioConfig
|
import io.element.android.libraries.voicerecorder.impl.audio.AudioConfig
|
||||||
import io.element.android.libraries.voicerecorder.impl.audio.SampleRate
|
import io.element.android.libraries.voicerecorder.impl.audio.SampleRate
|
||||||
import io.element.android.libraries.voicerecorder.impl.di.VoiceRecorderModule
|
import io.element.android.libraries.voicerecorder.impl.di.VoiceRecorderBindingContainer
|
||||||
import io.element.android.libraries.voicerecorder.test.FakeAudioLevelCalculator
|
import io.element.android.libraries.voicerecorder.test.FakeAudioLevelCalculator
|
||||||
import io.element.android.libraries.voicerecorder.test.FakeAudioReaderFactory
|
import io.element.android.libraries.voicerecorder.test.FakeAudioReaderFactory
|
||||||
import io.element.android.libraries.voicerecorder.test.FakeEncoder
|
import io.element.android.libraries.voicerecorder.test.FakeEncoder
|
||||||
@@ -151,7 +151,7 @@ class DefaultVoiceRecorderTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun TestScope.createDefaultVoiceRecorder(): DefaultVoiceRecorder {
|
private fun TestScope.createDefaultVoiceRecorder(): DefaultVoiceRecorder {
|
||||||
val fileConfig = VoiceRecorderModule.provideVoiceFileConfig()
|
val fileConfig = VoiceRecorderBindingContainer.provideVoiceFileConfig()
|
||||||
return DefaultVoiceRecorder(
|
return DefaultVoiceRecorder(
|
||||||
dispatchers = testCoroutineDispatchers(),
|
dispatchers = testCoroutineDispatchers(),
|
||||||
timeSource = timeSource,
|
timeSource = timeSource,
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.annotations.ApplicationContext
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object WorkManagerModule {
|
object WorkManagerBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
fun providesWorkManager(
|
fun providesWorkManager(
|
||||||
+1
-1
@@ -15,7 +15,7 @@ import io.element.android.libraries.di.identifiers.SentrySdkDsn
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object NoopAnalyticsModule {
|
object NoopAnalyticsBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun provideSentrySdkDsn(): SentrySdkDsn? = null
|
fun provideSentrySdkDsn(): SentrySdkDsn? = null
|
||||||
}
|
}
|
||||||
+1
-1
@@ -17,7 +17,7 @@ import io.element.android.services.analyticsproviders.sentry.SentryConfig
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object SentryModule {
|
object SentryBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun provideSentryDsn(): SentryDsn? = SentryConfig.DSN.takeIf { it.isNotBlank() }?.let(::SentryDsn)
|
fun provideSentryDsn(): SentryDsn? = SentryConfig.DSN.takeIf { it.isNotBlank() }?.let(::SentryDsn)
|
||||||
|
|
||||||
+1
-1
@@ -20,7 +20,7 @@ import io.element.android.services.appnavstate.impl.initializer.AppForegroundSta
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object AppNavStateModule {
|
object AppNavStateBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun provideAppForegroundStateService(
|
fun provideAppForegroundStateService(
|
||||||
@ApplicationContext context: Context
|
@ApplicationContext context: Context
|
||||||
+1
-1
@@ -16,7 +16,7 @@ import kotlin.time.TimeSource
|
|||||||
|
|
||||||
@BindingContainer
|
@BindingContainer
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object TimeModule {
|
object TimeBindingContainer {
|
||||||
@Provides
|
@Provides
|
||||||
fun timeSource(): TimeSource {
|
fun timeSource(): TimeSource {
|
||||||
return TimeSource.Monotonic
|
return TimeSource.Monotonic
|
||||||
Reference in New Issue
Block a user