mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +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:
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.Presenter
|
||||
|
||||
@ContributesTo(AppScope::class)
|
||||
@BindingContainer
|
||||
interface AnalyticsModule {
|
||||
interface AnalyticsBindingContainer {
|
||||
@Binds
|
||||
fun bindAnalyticsPreferencesPresenter(presenter: AnalyticsPreferencesPresenter): Presenter<AnalyticsPreferencesState>
|
||||
}
|
||||
+1
-1
@@ -21,7 +21,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||
|
||||
@BindingContainer
|
||||
@ContributesTo(RoomScope::class)
|
||||
object ContentScannerModule {
|
||||
object ContentScannerBindingContainer {
|
||||
@Provides
|
||||
@SingleIn(RoomScope::class)
|
||||
fun providesContentScannerService(
|
||||
+5
-5
@@ -15,16 +15,16 @@ import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
|
||||
class ContentScannerModuleTest {
|
||||
class ContentScannerBindingContainerTest {
|
||||
@Test
|
||||
fun `ContentScannerModule provides NoopContentScannerService when ContentScanner is null`() = runTest {
|
||||
fun `ContentScannerBindingContainer provides NoopContentScannerService when ContentScanner is null`() = runTest {
|
||||
// Given
|
||||
val contentScanner: ContentScanner? = null
|
||||
val sessionCoroutineScope = backgroundScope
|
||||
val coroutineDispatchers = testCoroutineDispatchers()
|
||||
|
||||
// When
|
||||
val contentScannerService = ContentScannerModule.providesContentScannerService(
|
||||
val contentScannerService = ContentScannerBindingContainer.providesContentScannerService(
|
||||
contentScanner = contentScanner,
|
||||
coroutineScope = sessionCoroutineScope,
|
||||
coroutineDispatchers = coroutineDispatchers,
|
||||
@@ -35,14 +35,14 @@ class ContentScannerModuleTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ContentScannerModule provides DefaultContentScannerService when ContentScanner is not null`() = runTest {
|
||||
fun `ContentScannerBindingContainer provides DefaultContentScannerService when ContentScanner is not null`() = runTest {
|
||||
// Given
|
||||
val contentScanner: ContentScanner? = FakeContentScanner()
|
||||
val sessionCoroutineScope = backgroundScope
|
||||
val coroutineDispatchers = testCoroutineDispatchers()
|
||||
|
||||
// When
|
||||
val contentScannerService = ContentScannerModule.providesContentScannerService(
|
||||
val contentScannerService = ContentScannerBindingContainer.providesContentScannerService(
|
||||
contentScanner = contentScanner,
|
||||
coroutineScope = sessionCoroutineScope,
|
||||
coroutineDispatchers = coroutineDispatchers,
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
||||
|
||||
@ContributesTo(SessionScope::class)
|
||||
@BindingContainer
|
||||
interface FtueModule {
|
||||
interface FtueBindingContainer {
|
||||
@Binds
|
||||
fun bindChooseSelfVerificationMethodPresenter(presenter: ChooseSelfVerificationModePresenter): Presenter<ChooseSelfVerificationModeState>
|
||||
}
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
||||
|
||||
@BindingContainer
|
||||
@ContributesTo(SessionScope::class)
|
||||
interface HomeSpacesModule {
|
||||
interface HomeSpacesBindingContainer {
|
||||
@Binds
|
||||
fun bindHomeSpacesPresenter(presenter: HomeSpacesPresenter): Presenter<HomeSpacesState>
|
||||
}
|
||||
+1
-1
@@ -26,7 +26,7 @@ import io.element.android.libraries.di.SessionScope
|
||||
|
||||
@ContributesTo(SessionScope::class)
|
||||
@BindingContainer
|
||||
interface RoomListModule {
|
||||
interface RoomListBindingContainer {
|
||||
@Binds
|
||||
fun bindRoomListPresenter(presenter: RoomListPresenter): Presenter<RoomListState>
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import io.element.android.libraries.matrix.api.MatrixClient
|
||||
|
||||
@ContributesTo(SessionScope::class)
|
||||
@BindingContainer
|
||||
interface InviteModule {
|
||||
interface InviteBindingContainer {
|
||||
@Binds
|
||||
fun bindAcceptDeclinePresenter(presenter: AcceptDeclineInvitePresenter): Presenter<AcceptDeclineInviteState>
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import java.util.Optional
|
||||
|
||||
@BindingContainer
|
||||
@ContributesTo(SessionScope::class)
|
||||
object JoinRoomModule {
|
||||
object JoinRoomBindingContainer {
|
||||
@Provides
|
||||
fun providesJoinRoomPresenterFactory(
|
||||
client: MatrixClient,
|
||||
+1
-1
@@ -20,7 +20,7 @@ import io.element.android.libraries.matrix.api.room.powerlevels.permissionsFlow
|
||||
|
||||
@BindingContainer
|
||||
@ContributesTo(RoomScope::class)
|
||||
object KnockRequestsModule {
|
||||
object KnockRequestsBindingContainer {
|
||||
@Provides
|
||||
@SingleIn(RoomScope::class)
|
||||
fun knockRequestsService(room: JoinedRoom): KnockRequestsService {
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
||||
|
||||
@ContributesTo(SessionScope::class)
|
||||
@BindingContainer
|
||||
interface LeaveRoomModule {
|
||||
interface LeaveRoomBindingContainer {
|
||||
@Binds
|
||||
fun bindLeaveRoomPresenter(presenter: LeaveRoomPresenter): Presenter<LeaveRoomState>
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ data class LockScreenConfig(
|
||||
|
||||
@ContributesTo(AppScope::class)
|
||||
@BindingContainer
|
||||
object LockScreenConfigModule {
|
||||
object LockScreenConfigBindingContainer {
|
||||
@Provides
|
||||
fun providesLockScreenConfig(): LockScreenConfig = LockScreenConfig(
|
||||
isPinMandatory = AppConfigLockScreenConfig.IS_PIN_MANDATORY,
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import io.element.android.libraries.architecture.Presenter
|
||||
|
||||
@ContributesTo(AppScope::class)
|
||||
@BindingContainer
|
||||
interface LoginModule {
|
||||
interface LoginBindingContainer {
|
||||
@Binds
|
||||
fun bindChangeServerPresenter(presenter: ChangeServerPresenter): Presenter<ChangeServerState>
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
||||
|
||||
@ContributesTo(SessionScope::class)
|
||||
@BindingContainer
|
||||
interface LogoutModule {
|
||||
interface LogoutBindingContainer {
|
||||
@Binds
|
||||
fun bindDirectLogoutPresenter(presenter: DirectLogoutPresenter): Presenter<DirectLogoutState>
|
||||
}
|
||||
+1
-1
@@ -34,7 +34,7 @@ import io.element.android.libraries.di.RoomScope
|
||||
|
||||
@ContributesTo(RoomScope::class)
|
||||
@BindingContainer
|
||||
interface MessagesBindsModule {
|
||||
interface MessagesBindingContainer {
|
||||
@Binds
|
||||
fun bindPinnedMessagesBannerPresenter(presenter: PinnedMessagesBannerPresenter): Presenter<PinnedMessagesBannerState>
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.timeline.Timeline
|
||||
|
||||
@ContributesTo(RoomScope::class)
|
||||
@BindingContainer
|
||||
object MessagesProvidesModule {
|
||||
object MessagesProvidesBindingContainer {
|
||||
@Provides
|
||||
@LiveTimeline
|
||||
fun provideLiveTimeline(joinedRoom: JoinedRoom): Timeline = joinedRoom.liveTimeline
|
||||
+1
-1
@@ -27,7 +27,7 @@ import kotlin.reflect.KClass
|
||||
*/
|
||||
@BindingContainer
|
||||
@ContributesTo(RoomScope::class)
|
||||
interface TimelineItemPresenterFactoriesModule {
|
||||
interface TimelineItemPresenterFactoriesBindingContainer {
|
||||
@Multibinds
|
||||
fun multiBindTimelineItemPresenterFactories(): @JvmSuppressWildcards Map<KClass<out TimelineItemEventContent>, TimelineItemPresenterFactory<*, *>>
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import io.element.android.libraries.voiceplayer.api.VoiceMessageState
|
||||
|
||||
@BindingContainer
|
||||
@ContributesTo(RoomScope::class)
|
||||
interface VoiceMessagePresenterModule {
|
||||
interface VoiceMessagePresenterBindingContainer {
|
||||
@Binds
|
||||
@IntoMap
|
||||
@TimelineItemEventContentKey(TimelineItemVoiceContent::class)
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.Presenter
|
||||
|
||||
@ContributesTo(AppScope::class)
|
||||
@BindingContainer
|
||||
interface DeveloperSettingsModule {
|
||||
interface DeveloperSettingsBindingContainer {
|
||||
@Binds
|
||||
fun bindAppDeveloperSettingsPresenter(presenter: AppDeveloperSettingsPresenter): Presenter<AppDeveloperSettingsState>
|
||||
}
|
||||
+1
-1
@@ -22,7 +22,7 @@ import io.element.android.libraries.architecture.Presenter
|
||||
|
||||
@ContributesTo(AppScope::class)
|
||||
@BindingContainer
|
||||
interface RageshakeModule {
|
||||
interface RageshakeBindingContainer {
|
||||
@Binds
|
||||
fun bindRageshakePreferencesPresenter(presenter: RageshakePreferencesPresenter): Presenter<RageshakePreferencesState>
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.core.RoomAlias
|
||||
|
||||
@BindingContainer
|
||||
@ContributesTo(SessionScope::class)
|
||||
object RoomAliasResolverModule {
|
||||
object RoomAliasResolverBindingContainer {
|
||||
@Provides
|
||||
fun providesJoinRoomPresenterFactory(
|
||||
client: MatrixClient,
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.RoomScope
|
||||
|
||||
@ContributesTo(RoomScope::class)
|
||||
@BindingContainer
|
||||
interface RoomCallModule {
|
||||
interface RoomCallBindingContainer {
|
||||
@Binds
|
||||
fun bindRoomCallStatePresenter(presenter: RoomCallStatePresenter): Presenter<RoomCallState>
|
||||
}
|
||||
+1
-1
@@ -21,7 +21,7 @@ import io.element.android.libraries.matrix.api.room.JoinedRoom
|
||||
|
||||
@BindingContainer
|
||||
@ContributesTo(RoomScope::class)
|
||||
object RoomMemberModule {
|
||||
object RoomMemberBindingContainer {
|
||||
@Provides
|
||||
fun provideRoomMemberDetailsPresenterFactory(
|
||||
room: JoinedRoom,
|
||||
+1
-1
@@ -18,7 +18,7 @@ import io.element.android.libraries.di.RoomScope
|
||||
|
||||
@ContributesTo(RoomScope::class)
|
||||
@BindingContainer
|
||||
interface RoomMemberModerationModule {
|
||||
interface RoomMemberModerationBindingContainer {
|
||||
@Binds
|
||||
fun bindRoomMemberModerationPresenter(presenter: RoomMemberModerationPresenter): Presenter<RoomMemberModerationState>
|
||||
}
|
||||
Reference in New Issue
Block a user