Remove unused implementation

This commit is contained in:
Wolf-Martell Montwé 2024-01-25 14:47:45 +01:00
parent 6d791153aa
commit 9e2e146dac
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
5 changed files with 0 additions and 177 deletions

View file

@ -1,24 +0,0 @@
package app.k9mail.feature.account.setup.ui.autodiscovery.item
import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import app.k9mail.feature.account.common.domain.input.BooleanInputField
import app.k9mail.feature.account.common.ui.item.ListItem
import app.k9mail.feature.account.setup.ui.autodiscovery.view.AutoDiscoveryResultApprovalView
@Composable
internal fun LazyItemScope.AutoDiscoveryResultApprovalItem(
approvalState: BooleanInputField,
onApprovalChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
) {
ListItem(
modifier = modifier,
) {
AutoDiscoveryResultApprovalView(
approvalState = approvalState,
onApprovalChange = onApprovalChange,
)
}
}

View file

@ -1,24 +0,0 @@
package app.k9mail.feature.account.setup.ui.autodiscovery.item
import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import app.k9mail.autodiscovery.api.AutoDiscoveryResult
import app.k9mail.feature.account.common.ui.item.ListItem
import app.k9mail.feature.account.setup.ui.autodiscovery.view.AutoDiscoveryResultView
@Composable
internal fun LazyItemScope.AutoDiscoveryResultItem(
autoDiscoverySettings: AutoDiscoveryResult.Settings?,
onEditConfigurationClick: () -> Unit,
modifier: Modifier = Modifier,
) {
ListItem(
modifier = modifier,
) {
AutoDiscoveryResultView(
settings = autoDiscoverySettings,
onEditConfigurationClick = onEditConfigurationClick,
)
}
}

View file

@ -1,63 +0,0 @@
package app.k9mail.feature.account.setup.ui.autodiscovery.item
import androidx.compose.foundation.lazy.LazyListScope
import app.k9mail.feature.account.common.ui.item.ListItem
import app.k9mail.feature.account.oauth.ui.AccountOAuthContract
import app.k9mail.feature.account.oauth.ui.AccountOAuthView
import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.ConfigStep
import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.Event
import app.k9mail.feature.account.setup.ui.autodiscovery.AccountAutoDiscoveryContract.State
internal fun LazyListScope.contentItems(
state: State,
onEvent: (Event) -> Unit,
oAuthViewModel: AccountOAuthContract.ViewModel,
) {
if (state.configStep != ConfigStep.EMAIL_ADDRESS) {
item(key = "autodiscovery") {
AutoDiscoveryResultItem(
autoDiscoverySettings = state.autoDiscoverySettings,
onEditConfigurationClick = { onEvent(Event.OnEditConfigurationClicked) },
)
}
if (state.autoDiscoverySettings != null && state.autoDiscoverySettings.isTrusted.not()) {
item(key = "result_approval") {
AutoDiscoveryResultApprovalItem(
approvalState = state.configurationApproved,
onApprovalChange = { onEvent(Event.ResultApprovalChanged(it)) },
)
}
}
}
item(key = "email") {
EmailAddressItem(
emailAddress = state.emailAddress.value,
error = state.emailAddress.error,
onEmailAddressChange = { onEvent(Event.EmailAddressChanged(it)) },
)
}
if (state.configStep == ConfigStep.PASSWORD) {
item(key = "password") {
PasswordItem(
password = state.password.value,
error = state.password.error,
onPasswordChange = { onEvent(Event.PasswordChanged(it)) },
)
}
} else if (state.configStep == ConfigStep.OAUTH) {
item(key = "oauth") {
ListItem {
val isAutoDiscoverySettingsTrusted = state.autoDiscoverySettings?.isTrusted ?: false
val isConfigurationApproved = state.configurationApproved.value ?: false
AccountOAuthView(
onOAuthResult = { result -> onEvent(Event.OnOAuthResult(result)) },
viewModel = oAuthViewModel,
isEnabled = isAutoDiscoverySettingsTrusted || isConfigurationApproved,
)
}
}
}
}

View file

@ -1,34 +0,0 @@
package app.k9mail.feature.account.setup.ui.autodiscovery.item
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.ui.compose.designsystem.molecule.input.EmailAddressInput
import app.k9mail.feature.account.common.ui.item.ListItem
import app.k9mail.feature.account.setup.ui.autodiscovery.toResourceString
@Composable
internal fun LazyItemScope.EmailAddressItem(
emailAddress: String,
error: ValidationError?,
onEmailAddressChange: (String) -> Unit,
modifier: Modifier = Modifier,
isEnabled: Boolean = true,
) {
val resources = LocalContext.current.resources
ListItem(
modifier = modifier,
) {
EmailAddressInput(
emailAddress = emailAddress,
errorMessage = error?.toResourceString(resources),
onEmailAddressChange = onEmailAddressChange,
isEnabled = isEnabled,
contentPadding = PaddingValues(),
)
}
}

View file

@ -1,32 +0,0 @@
package app.k9mail.feature.account.setup.ui.autodiscovery.item
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import app.k9mail.core.common.domain.usecase.validation.ValidationError
import app.k9mail.core.ui.compose.designsystem.molecule.input.PasswordInput
import app.k9mail.feature.account.common.ui.item.ListItem
import app.k9mail.feature.account.server.settings.ui.common.mapper.toResourceString
@Composable
internal fun LazyItemScope.PasswordItem(
password: String,
error: ValidationError?,
onPasswordChange: (String) -> Unit,
modifier: Modifier = Modifier,
) {
val resources = LocalContext.current.resources
ListItem(
modifier = modifier,
) {
PasswordInput(
password = password,
errorMessage = error?.toResourceString(resources),
onPasswordChange = onPasswordChange,
contentPadding = PaddingValues(),
)
}
}