From 05eb9855cca76ea336ccb6ebdf9c731fec202a3a Mon Sep 17 00:00:00 2001 From: Kingsley Adio Date: Sat, 20 Nov 2021 15:16:27 +0100 Subject: [PATCH] Make application component Factory a nested interface --- .../whetstone/component/ApplicationComponent.kt | 12 ++++++------ .../whetstone/component/ApplicationComponentOwner.kt | 7 +++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponent.kt b/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponent.kt index 83e8134..1a3f820 100644 --- a/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponent.kt +++ b/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponent.kt @@ -16,11 +16,11 @@ import javax.inject.Singleton @Singleton public interface ApplicationComponent { public fun getMembersInjectorMap(): MembersInjectorMap -} -/** - * Interface for creating an [ApplicationComponent]. - */ -public interface ApplicationComponentFactory { - public fun create(@BindsInstance application: Application): ApplicationComponent + /** + * Interface for creating an [ApplicationComponent]. + */ + public interface Factory { + public fun create(@BindsInstance application: Application): ApplicationComponent + } } diff --git a/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponentOwner.kt b/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponentOwner.kt index 3068f42..3db8736 100644 --- a/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponentOwner.kt +++ b/whetstone/src/main/java/com/deliveryhero/whetstone/component/ApplicationComponentOwner.kt @@ -1,5 +1,12 @@ package com.deliveryhero.whetstone.component +/** + * Interface that should be implemented by the [android.app.Application] to supply + * the instance of the root [ApplicationComponent]. + * + * It's strongly recommended that [applicationComponent] always returns the same + * instance across multiple invocations. + */ public interface ApplicationComponentOwner { public val applicationComponent: ApplicationComponent