Add AccountOwnerNameProvider
This commit is contained in:
parent
dbdbb25cdb
commit
88a4b7913f
5 changed files with 32 additions and 0 deletions
|
@ -2,6 +2,7 @@ package app.k9mail.feature.preview
|
|||
|
||||
import app.k9mail.core.common.oauth.OAuthConfigurationFactory
|
||||
import app.k9mail.feature.account.setup.featureAccountSetupModule
|
||||
import app.k9mail.feature.preview.account.AccountOwnerNameProvider
|
||||
import app.k9mail.feature.preview.account.AccountSetupFinishedLauncher
|
||||
import app.k9mail.feature.preview.auth.AndroidKeyStoreDirectoryProvider
|
||||
import app.k9mail.feature.preview.auth.AppOAuthConfigurationFactory
|
||||
|
@ -16,6 +17,7 @@ import org.koin.core.module.Module
|
|||
import org.koin.dsl.module
|
||||
|
||||
val accountModule: Module = module {
|
||||
factory { AccountOwnerNameProvider() }
|
||||
factory {
|
||||
AccountSetupFinishedLauncher(
|
||||
context = androidContext(),
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package app.k9mail.feature.preview.account
|
||||
|
||||
import app.k9mail.feature.account.setup.domain.ExternalContract
|
||||
|
||||
class AccountOwnerNameProvider: ExternalContract.AccountOwnerNameProvider {
|
||||
override fun getOwnerName(): String? {
|
||||
return null
|
||||
}
|
||||
}
|
|
@ -4,6 +4,11 @@ import org.koin.android.ext.koin.androidContext
|
|||
import org.koin.dsl.module
|
||||
|
||||
val newAccountModule = module {
|
||||
factory {
|
||||
AccountOwnerNameProvider(
|
||||
preferences = get(),
|
||||
)
|
||||
}
|
||||
factory {
|
||||
AccountSetupFinishedLauncher(
|
||||
context = androidContext(),
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.fsck.k9.account
|
||||
|
||||
import app.k9mail.feature.account.setup.domain.ExternalContract
|
||||
import com.fsck.k9.Preferences
|
||||
|
||||
class AccountOwnerNameProvider(
|
||||
private val preferences: Preferences,
|
||||
) : ExternalContract.AccountOwnerNameProvider {
|
||||
override fun getOwnerName(): String? {
|
||||
return preferences.defaultAccount?.senderName
|
||||
}
|
||||
}
|
|
@ -1,6 +1,10 @@
|
|||
package app.k9mail.feature.account.setup.domain
|
||||
|
||||
interface ExternalContract {
|
||||
fun interface AccountOwnerNameProvider {
|
||||
fun getOwnerName(): String?
|
||||
}
|
||||
|
||||
fun interface AccountSetupFinishedLauncher {
|
||||
fun launch(accountUuid: String)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue