-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2baaa76
commit cdb260f
Showing
19 changed files
with
506 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
link/src/main/java/com/stripe/android/link/NativeLinkArgs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.stripe.android.link | ||
|
||
import android.os.Parcelable | ||
import androidx.annotation.RestrictTo | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
@Parcelize | ||
internal data class NativeLinkArgs( | ||
val configuration: LinkConfiguration, | ||
val publishableKey: String, | ||
val stripeAccountId: String? | ||
) : Parcelable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
link/src/main/java/com/stripe/android/link/injection/NativeLinkComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.stripe.android.link.injection | ||
|
||
import android.content.Context | ||
import com.stripe.android.core.Logger | ||
import com.stripe.android.core.injection.PUBLISHABLE_KEY | ||
import com.stripe.android.core.injection.STRIPE_ACCOUNT_ID | ||
import com.stripe.android.link.LinkActivityViewModel | ||
import com.stripe.android.link.LinkConfiguration | ||
import com.stripe.android.link.account.LinkAccountManager | ||
import com.stripe.android.link.analytics.LinkEventsReporter | ||
import dagger.BindsInstance | ||
import dagger.Component | ||
import javax.inject.Named | ||
import javax.inject.Scope | ||
|
||
@Scope | ||
@Retention(AnnotationRetention.RUNTIME) | ||
internal annotation class NativeLinkScope | ||
|
||
@NativeLinkScope | ||
@Component( | ||
modules = [ | ||
NativeLinkModule::class, | ||
] | ||
) | ||
internal interface NativeLinkComponent { | ||
val linkAccountManager: LinkAccountManager | ||
val configuration: LinkConfiguration | ||
val linkEventsReporter: LinkEventsReporter | ||
val logger: Logger | ||
val viewModel: LinkActivityViewModel | ||
|
||
@Component.Builder | ||
interface Builder { | ||
@BindsInstance | ||
fun configuration(configuration: LinkConfiguration): Builder | ||
|
||
@BindsInstance | ||
fun publishableKeyProvider(@Named(PUBLISHABLE_KEY) publishableKeyProvider: () -> String): Builder | ||
|
||
@BindsInstance | ||
fun stripeAccountIdProvider(@Named(STRIPE_ACCOUNT_ID) stripeAccountIdProvider: () -> String?): Builder | ||
|
||
@BindsInstance | ||
fun context(context: Context): Builder | ||
|
||
fun build(): NativeLinkComponent | ||
} | ||
} |
Oops, something went wrong.