diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d1d38295a66f494563427c5f7738986d58f6085d..3dc1501721998538ab33dbcff98aa6d803e79714 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -75,5 +75,5 @@ update-default-branch:
LOCAL_BRANCH: main
UPSTREAM_BRANCH: upstream/master
UPSTREAM_DEFAULT_BRANCH: main
- UPSTREAM_URL: https://github.com/k9mail/k-9.git
+ UPSTREAM_URL: https://github.com/thundernest/k-9.git
TEMP_LATEST_TAG_BRANCH: latest_upstream_tag_branch
diff --git a/app/core/src/main/java/com/fsck/k9/OsAccountManagerUtil.kt b/app/core/src/main/java/com/fsck/k9/OsAccountManagerUtil.kt
index 3c2330118ea03c1c81accaa97112d0a8cca05e38..b1401bde172be79bd5dcf67e1e5e7a17fe5ae077 100644
--- a/app/core/src/main/java/com/fsck/k9/OsAccountManagerUtil.kt
+++ b/app/core/src/main/java/com/fsck/k9/OsAccountManagerUtil.kt
@@ -20,7 +20,7 @@ import android.accounts.Account
import android.accounts.AccountManager
import android.content.ContentResolver
import android.content.Context
-import com.fsck.k9.setup.AccountManagerConstants
+import app.k9mail.core.android.common.accountmanager.AccountManagerConstants
import timber.log.Timber
object OsAccountManagerUtil {
diff --git a/app/core/src/main/java/com/fsck/k9/setup/EeloAccountHelper.kt b/app/core/src/main/java/com/fsck/k9/setup/EeloAccountHelper.kt
index 2ff0157fdc57b6a537b5f0c64c2fc5327f3c0c93..fe27b5d24c8ffb40e837a45801185db01c65356c 100644
--- a/app/core/src/main/java/com/fsck/k9/setup/EeloAccountHelper.kt
+++ b/app/core/src/main/java/com/fsck/k9/setup/EeloAccountHelper.kt
@@ -17,6 +17,7 @@
package com.fsck.k9.setup
import android.content.Context
+import app.k9mail.core.android.common.accountmanager.AccountManagerConstants
import com.fsck.k9.Account
import com.fsck.k9.mail.AuthType
import com.fsck.k9.mail.oauth.AuthStateStorage
diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/account/AccountSyncReceiver.kt b/app/ui/legacy/src/main/java/com/fsck/k9/account/AccountSyncReceiver.kt
index f34820adb7e16bae642c24baa0c263ccbf5f4af4..9b1d30494a3a4b067b485b3d2315df5714c4a96d 100644
--- a/app/ui/legacy/src/main/java/com/fsck/k9/account/AccountSyncReceiver.kt
+++ b/app/ui/legacy/src/main/java/com/fsck/k9/account/AccountSyncReceiver.kt
@@ -22,12 +22,12 @@ import android.content.Context
import android.content.Intent
import android.os.Build
import androidx.annotation.RequiresApi
+import app.k9mail.core.android.common.accountmanager.AccountManagerConstants
import com.fsck.k9.Account
import com.fsck.k9.Preferences
import com.fsck.k9.activity.setup.accountmanager.EeloAccountCreator
import com.fsck.k9.controller.push.PushController
import com.fsck.k9.job.K9JobManager
-import com.fsck.k9.setup.AccountManagerConstants
import java.util.concurrent.Executors
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt
index 88b85115e075353685d39f52ad015b18c8cfaedd..c5fc82bad9393434ad92185a556bab03b558f58c 100644
--- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt
+++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt
@@ -48,6 +48,7 @@ import androidx.fragment.app.commitNow
import androidx.lifecycle.lifecycleScope
import app.k9mail.core.android.common.contact.CachingRepository
import app.k9mail.core.android.common.contact.ContactRepository
+import app.k9mail.core.android.common.accountmanager.AccountManagerConstants
import app.k9mail.feature.launcher.FeatureLauncherActivity
import com.fsck.k9.Account
import com.fsck.k9.K9
@@ -69,7 +70,6 @@ import com.fsck.k9.search.SearchSpecification
import com.fsck.k9.search.SearchSpecification.SearchCondition
import com.fsck.k9.search.SearchSpecification.SearchField
import com.fsck.k9.search.isUnifiedInbox
-import com.fsck.k9.setup.AccountManagerConstants
import com.fsck.k9.ui.BuildConfig
import com.fsck.k9.ui.K9Drawer
import com.fsck.k9.ui.R
diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.kt
index b56f3c3a2dd4a62c3851a871fd56d6e643c7755f..28cbfeebf49ede635a7e7653b66b66c9d7fc2caa 100644
--- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.kt
+++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.kt
@@ -1,6 +1,5 @@
package com.fsck.k9.activity.setup
-import android.accounts.AccountManager
import android.app.Activity
import android.content.Context
import android.content.Intent
@@ -14,12 +13,12 @@ import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import app.k9mail.autodiscovery.api.DiscoveredServerSettings
import app.k9mail.autodiscovery.providersxml.ProvidersXmlDiscovery
+import app.k9mail.core.android.common.accountmanager.AccountManagerHelper
import com.fsck.k9.Account
import com.fsck.k9.Core
import com.fsck.k9.EmailAddressValidator
import com.fsck.k9.Preferences
import com.fsck.k9.account.AccountCreatorHelper
-import com.fsck.k9.activity.MessageList
import com.fsck.k9.activity.setup.AccountSetupCheckSettings.CheckDirection
import com.fsck.k9.activity.setup.accountmanager.MailAutoConfigDiscovery
import com.fsck.k9.helper.SimpleTextWatcher
@@ -27,7 +26,6 @@ import com.fsck.k9.helper.Utility.requiredFieldValid
import com.fsck.k9.mail.AuthType
import com.fsck.k9.mail.ServerSettings
import com.fsck.k9.mailstore.SpecialLocalFoldersCreator
-import com.fsck.k9.setup.AccountManagerConstants
import com.fsck.k9.ui.ConnectionSettings
import com.fsck.k9.ui.R
import com.fsck.k9.ui.base.K9Activity
@@ -220,21 +218,12 @@ class AccountSetupBasics : K9Activity() {
}
private fun handleOpenIdAuthFlow(hostname: String): Boolean {
- val accountType = AccountManagerConstants.getOpenIdAccountTypeByHostName(hostname) ?: return false
+ val accountType = AccountManagerHelper.getOpenIdAccountTypeByHostName(hostname) ?: return false
- startOpenIdOAuthFlow(accountType)
+ AccountManagerHelper.startOpenIdOAuthFlow(this, accountType, emailView.text?.toString())
return true
}
- private fun startOpenIdOAuthFlow(accountType: String) {
- val osAccountManager = AccountManager.get(this)
- val options = Bundle()
- options.putString(AccountManagerConstants.OPEN_APP_PACKAGE_AFTER_AUTH, packageName)
- options.putString(AccountManagerConstants.OPEN_APP_ACTIVITY_AFTER_AUTH, MessageList::class.java.name)
- options.putString(AccountManagerConstants.USERNAME_HINT, emailView.text?.toString())
- osAccountManager.addAccount(accountType, null, null, options, this, null, null)
- }
-
private fun startPasswordFlow() {
uiState = UiState.PASSWORD_FLOW
diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java
index 185ee1e587b3ae71ea734cdc438941a1990ceb5b..2b001f7a98034943b980438cf5b3f6b4926f2458 100644
--- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java
+++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java
@@ -31,6 +31,7 @@ import androidx.annotation.WorkerThread;
import app.k9mail.autodiscovery.api.DiscoveredServerSettings;
import app.k9mail.autodiscovery.api.DiscoveryResults;
import app.k9mail.autodiscovery.providersxml.ProvidersXmlDiscovery;
+import app.k9mail.core.android.common.accountmanager.AccountManagerConstants;
import app.k9mail.core.common.mail.Protocols;
import com.fsck.k9.Account;
import com.fsck.k9.Account.DeletePolicy;
@@ -44,7 +45,6 @@ import com.fsck.k9.mail.AuthType;
import com.fsck.k9.mail.ConnectionSecurity;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mailstore.SpecialLocalFoldersCreator;
-import com.fsck.k9.setup.AccountManagerConstants;
import com.fsck.k9.ui.ConnectionSettings;
import timber.log.Timber;
diff --git a/core/android/common/src/main/kotlin/app/k9mail/core/android/common/ContextExtensions.kt b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/ContextExtensions.kt
new file mode 100644
index 0000000000000000000000000000000000000000..606fc55549902f6d5f1e8690d535eb287ff50d5a
--- /dev/null
+++ b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/ContextExtensions.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright MURENA SAS 2023
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package app.k9mail.core.android.common
+
+import android.app.Activity
+import android.content.Context
+import android.content.ContextWrapper
+
+tailrec fun Context.findActivity(): Activity? {
+ return this as? Activity ?: (this as? ContextWrapper)?.baseContext?.findActivity()
+}
diff --git a/app/core/src/main/java/com/fsck/k9/setup/AccountManagerConstants.kt b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/accountmanager/AccountManagerConstants.kt
similarity index 79%
rename from app/core/src/main/java/com/fsck/k9/setup/AccountManagerConstants.kt
rename to core/android/common/src/main/kotlin/app/k9mail/core/android/common/accountmanager/AccountManagerConstants.kt
index 85ad1d27d4ff2d936b747c8831e033331fb27302..286deefbd8711caf818d121f3f53a8f1c4f5317e 100644
--- a/app/core/src/main/java/com/fsck/k9/setup/AccountManagerConstants.kt
+++ b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/accountmanager/AccountManagerConstants.kt
@@ -1,5 +1,5 @@
/*
- * Copyright ECORP SAS 2022
+ * Copyright MURENA SAS 2023
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -14,7 +14,7 @@
* along with this program. If not, see .
*/
-package com.fsck.k9.setup
+package app.k9mail.core.android.common.accountmanager
object AccountManagerConstants {
const val EELO_ACCOUNT_TYPE = "e.foundation.webdav.eelo"
@@ -34,11 +34,15 @@ object AccountManagerConstants {
val OPENID_ACCOUNT_TYPES = listOf(EELO_ACCOUNT_TYPE, GOOGLE_ACCOUNT_TYPE, YAHOO_ACCOUNT_TYPE)
val ALL_ACCOUNT_TYPES = listOf(EELO_ACCOUNT_TYPE, GOOGLE_ACCOUNT_TYPE, YAHOO_ACCOUNT_TYPE)
- fun getOpenIdAccountTypeByHostName(hostname: String): String? {
- return when(hostname) {
- in listOf("imap.gmail.com", "imap.googlemail.com", "smtp.gmail.com", "smtp.googlemail.com") -> GOOGLE_ACCOUNT_TYPE
- in listOf("imap.mail.yahoo.com", "smtp.mail.yahoo.com") -> YAHOO_ACCOUNT_TYPE
- else -> null
- }
- }
+ val GOOGLE_DOMAIN_LIST = listOf(
+ ".gmail.com",
+ ".googlemail.com",
+ ".google.com",
+ )
+
+ val YAHOO_DOMAIN_LIST = listOf(
+ ".yahoo.com",
+ )
+
+ const val toOpenAfterAuthActivity = "com.fsck.k9.activity.MessageList"
}
diff --git a/core/android/common/src/main/kotlin/app/k9mail/core/android/common/accountmanager/AccountManagerHelper.kt b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/accountmanager/AccountManagerHelper.kt
new file mode 100644
index 0000000000000000000000000000000000000000..7a4421e7d8dbe8185a894b04f328c93e6d325965
--- /dev/null
+++ b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/accountmanager/AccountManagerHelper.kt
@@ -0,0 +1,61 @@
+/*
+ * Copyright MURENA SAS 2023
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package app.k9mail.core.android.common.accountmanager
+
+import android.accounts.AccountManager
+import android.content.Context
+import android.os.Bundle
+import app.k9mail.core.android.common.findActivity
+
+object AccountManagerHelper {
+
+ fun startOpenIdOAuthFlow(context: Context, accountType: String, email: String?) {
+ val activity = context.findActivity() ?: return
+
+ val accountManager = AccountManager.get(activity.applicationContext)
+
+ val options = Bundle()
+ options.putString(AccountManagerConstants.OPEN_APP_PACKAGE_AFTER_AUTH, activity.packageName)
+ options.putString(
+ AccountManagerConstants.OPEN_APP_ACTIVITY_AFTER_AUTH,
+ AccountManagerConstants.toOpenAfterAuthActivity,
+ )
+ options.putString(AccountManagerConstants.USERNAME_HINT, email)
+
+ accountManager.addAccount(accountType, null, null, options, activity, null, null)
+ }
+
+ fun getOpenIdAccountTypeByHostName(hostname: String): String? {
+ if (containedInDomain(AccountManagerConstants.GOOGLE_DOMAIN_LIST, hostname)) {
+ return AccountManagerConstants.GOOGLE_ACCOUNT_TYPE
+ } else if (containedInDomain(AccountManagerConstants.YAHOO_DOMAIN_LIST, hostname)) {
+ return AccountManagerConstants.YAHOO_ACCOUNT_TYPE
+ }
+
+ return null
+ }
+
+ private fun containedInDomain(domainList: List, hostname: String): Boolean {
+ for (domain in domainList) {
+ if (hostname.lowercase().endsWith(domain)) {
+ return true
+ }
+ }
+
+ return false
+ }
+}
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Checkbox.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Checkbox.kt
index b3e8ed3b46c9b1b4bbd83d23d9893efaedfedec6..74b51f80ef7061aa58b7e9d3516602fc85660595 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Checkbox.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Checkbox.kt
@@ -1,8 +1,10 @@
package app.k9mail.core.ui.compose.designsystem.atom
+import androidx.compose.material.CheckboxDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
+import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.Checkbox as MaterialCheckbox
@@ -18,6 +20,10 @@ fun Checkbox(
onCheckedChange = onCheckedChange,
modifier = modifier,
enabled = enabled,
+ colors = CheckboxDefaults.colors(
+ checkedColor = MainTheme.colors.primary,
+ checkmarkColor = MainTheme.colors.onPrimary,
+ ),
)
}
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Icon.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Icon.kt
index df0bb7febaeabfafdcc1c9101e4f10bed89892c3..bf81d05bef72a0ad11d02447771868223973fc4c 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Icon.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Icon.kt
@@ -1,13 +1,12 @@
package app.k9mail.core.ui.compose.designsystem.atom
-import androidx.compose.material.LocalContentAlpha
-import androidx.compose.material.LocalContentColor
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.theme.Icons
+import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.Icon as MaterialIcon
@@ -15,7 +14,7 @@ import androidx.compose.material.Icon as MaterialIcon
fun Icon(
imageVector: ImageVector,
modifier: Modifier = Modifier,
- tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current),
+ tint: Color = MainTheme.colors.secondary,
) {
MaterialIcon(
imageVector = imageVector,
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Switch.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Switch.kt
index 1c449c3bb03f61a7a1198edac0cd8b02e9683055..1a421fe515fa51cfd0af3dd5c6607e5b17bc700d 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Switch.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/Switch.kt
@@ -1,8 +1,10 @@
package app.k9mail.core.ui.compose.designsystem.atom
+import androidx.compose.material.SwitchDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
+import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.Switch as MaterialSwitch
@@ -18,6 +20,9 @@ fun Switch(
onCheckedChange = onCheckedChange,
modifier = modifier,
enabled = enabled,
+ colors = SwitchDefaults.colors(
+ checkedThumbColor = MainTheme.colors.primary,
+ ),
)
}
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/Button.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/Button.kt
index 5165145b8b60f03751cc1ff0834d9d4c2a0a9df9..eb8f4835c618d694f125248ee4353d113020a429 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/Button.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/Button.kt
@@ -1,11 +1,13 @@
package app.k9mail.core.ui.compose.designsystem.atom.button
import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.designsystem.atom.text.TextButton
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
@@ -27,6 +29,7 @@ fun Button(
colors = ButtonDefaults.buttonColors(
backgroundColor = color ?: MainTheme.colors.primary,
),
+ shape = RoundedCornerShape(6.dp),
contentPadding = contentPadding,
) {
TextButton(text = text)
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/ButtonOutlined.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/ButtonOutlined.kt
index fcde407636e41a69541711915b77c723861f1978..bd386ff7ff8497f3afa9d70378666b9afb67e901 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/ButtonOutlined.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/button/ButtonOutlined.kt
@@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.button
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@@ -40,6 +41,7 @@ fun ButtonOutlined(
)
},
),
+ shape = RoundedCornerShape(6.dp),
contentPadding = contentPadding,
) {
TextButton(text = text)
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt
index 09cacd61ee08098ef45a4ee80f929c6458010e95..0ea3bb0c624011a294fbd71b801f106d1ea83c83 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt
@@ -10,6 +10,8 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.TextUnit
+import androidx.compose.ui.unit.sp
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.Text as MaterialText
@@ -20,6 +22,8 @@ fun TextBody1(
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
textAlign: TextAlign? = null,
+ fontSize: TextUnit = TextUnit.Unspecified,
+ fontWeight: FontWeight? = null,
) {
MaterialText(
text = text,
@@ -27,6 +31,8 @@ fun TextBody1(
color = color,
textAlign = textAlign,
style = MainTheme.typography.body1,
+ fontSize = fontSize,
+ fontWeight = fontWeight,
)
}
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt
index eabd641148fbee2e27d1b38568c5af8f3790ecd9..83dcbe767bf70c3262aa2f227ade3e994a25b1fc 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt
@@ -10,6 +10,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.TextUnit
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.Text as MaterialText
@@ -20,6 +21,8 @@ fun TextHeadline2(
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
textAlign: TextAlign? = null,
+ fontSize: TextUnit = TextUnit.Unspecified,
+ fontWeight: FontWeight? = null,
) {
MaterialText(
text = text,
@@ -27,6 +30,8 @@ fun TextHeadline2(
color = color,
textAlign = textAlign,
style = MainTheme.typography.h2,
+ fontSize = fontSize,
+ fontWeight = fontWeight,
)
}
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlined.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlined.kt
index 79ebb45ab1f479ea6b70dea4a827b44e26ef747f..ec6a7dc71871e7f6a7a214876ab703f19e35d97c 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlined.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlined.kt
@@ -1,8 +1,10 @@
package app.k9mail.core.ui.compose.designsystem.atom.textfield
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.designsystem.atom.Icon
import app.k9mail.core.ui.compose.theme.Icons
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
@@ -23,6 +25,7 @@ fun TextFieldOutlined(
isSingleLine: Boolean = true,
) {
MaterialOutlinedTextField(
+ shape = RoundedCornerShape(6.dp),
value = value,
onValueChange = onValueChange,
modifier = modifier,
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedEmailAddress.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedEmailAddress.kt
index abf2d929ba271f496bda28b06d0c3bbce8da8cb3..17fa3045041522acc4f384367505ed70b3940890 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedEmailAddress.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedEmailAddress.kt
@@ -1,10 +1,12 @@
package app.k9mail.core.ui.compose.designsystem.atom.textfield
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.OutlinedTextField as MaterialOutlinedTextField
@@ -21,6 +23,7 @@ fun TextFieldOutlinedEmailAddress(
hasError: Boolean = false,
) {
MaterialOutlinedTextField(
+ shape = RoundedCornerShape(6.dp),
value = value,
onValueChange = onValueChange,
modifier = modifier,
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedFakeSelect.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedFakeSelect.kt
index 2ccee8475c3890bf9adc42ea27ebf7714df61189..ba4f1e1d0f05273e3d44ba5d153483708041a754 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedFakeSelect.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedFakeSelect.kt
@@ -3,12 +3,14 @@ package app.k9mail.core.ui.compose.designsystem.atom.textfield
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.PressInteraction
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.designsystem.atom.Icon
import app.k9mail.core.ui.compose.theme.Icons
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
@@ -22,6 +24,7 @@ fun TextFieldOutlinedFakeSelect(
label: String? = null,
) {
MaterialOutlinedTextField(
+ shape = RoundedCornerShape(6.dp),
value = text,
onValueChange = { },
modifier = Modifier
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedNumber.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedNumber.kt
index 25ee4e7a8cece2d264fe6d40831dd5d89b1f9630..7bae357a828158c5fca85fa9a93e44102ecceb9f 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedNumber.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedNumber.kt
@@ -1,10 +1,12 @@
package app.k9mail.core.ui.compose.designsystem.atom.textfield
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.OutlinedTextField as MaterialOutlinedTextField
@@ -21,6 +23,7 @@ fun TextFieldOutlinedNumber(
hasError: Boolean = false,
) {
MaterialOutlinedTextField(
+ shape = RoundedCornerShape(6.dp),
value = value?.toString() ?: "",
onValueChange = {
onValueChange(
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedPassword.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedPassword.kt
index 55cb2516082b047bf3ebb670c75353c9dbe299ce..9d02ae8ba13957cc1a805167ba789718b22dd9a1 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedPassword.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedPassword.kt
@@ -1,5 +1,6 @@
package app.k9mail.core.ui.compose.designsystem.atom.textfield
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
@@ -14,6 +15,7 @@ import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.designsystem.R
import app.k9mail.core.ui.compose.theme.Icons
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
@@ -34,6 +36,7 @@ fun TextFieldOutlinedPassword(
var passwordVisibilityState by rememberSaveable { mutableStateOf(false) }
MaterialOutlinedTextField(
+ shape = RoundedCornerShape(6.dp),
value = value,
onValueChange = onValueChange,
modifier = modifier,
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedSelect.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedSelect.kt
index 867030175311b0484d60874239fee316fbf0db98..650306914bd0615154e611a3e310caaa2019ee12 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedSelect.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/textfield/TextFieldOutlinedSelect.kt
@@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.textfield
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ExposedDropdownMenuBox
@@ -11,6 +12,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.designsystem.atom.Icon
import app.k9mail.core.ui.compose.theme.Icons
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
@@ -39,6 +41,7 @@ fun TextFieldOutlinedSelect(
onValueChange = onValueChange,
) { expanded ->
MaterialOutlinedTextField(
+ shape = RoundedCornerShape(6.dp),
value = optionToStringTransformation(selectedOption),
onValueChange = { },
modifier = Modifier
diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/molecule/ErrorView.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/molecule/ErrorView.kt
index d60281fcef9bbe2330aa98851a7406ce4130bac2..c86e636e58656bc8ec408aeeaea4a00cd01405f0 100644
--- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/molecule/ErrorView.kt
+++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/molecule/ErrorView.kt
@@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.requiredSize
import androidx.compose.material.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@@ -49,7 +50,9 @@ fun ErrorView(
imageVector = Icons.Filled.error,
contentDescription = null,
tint = MainTheme.colors.error,
- modifier = Modifier.padding(top = MainTheme.spacings.default),
+ modifier = Modifier
+ .requiredSize(MainTheme.sizes.medium)
+ .padding(top = MainTheme.spacings.default),
)
TextSubtitle1(
text = title,
diff --git a/core/ui/compose/designsystem/src/main/res/values-de/strings.xml b/core/ui/compose/designsystem/src/main/res/values-de/strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4948d36103d41dacad7377add39b192b8341f762
--- /dev/null
+++ b/core/ui/compose/designsystem/src/main/res/values-de/strings.xml
@@ -0,0 +1,8 @@
+
+
+ Passwort verbergen
+ Passwort anzeigen
+ E-Mail-Adresse
+ Passwort
+ Wiederholen
+
diff --git a/core/ui/compose/designsystem/src/main/res/values-es/strings.xml b/core/ui/compose/designsystem/src/main/res/values-es/strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f295a9720d97ec84964757d7c056e903b73e5743
--- /dev/null
+++ b/core/ui/compose/designsystem/src/main/res/values-es/strings.xml
@@ -0,0 +1,8 @@
+
+
+ Contraseña oculta
+ Mostrar contraseña
+ Dirección de correo
+ Contraseña
+ Reintentar
+
diff --git a/core/ui/compose/designsystem/src/main/res/values-fr/strings.xml b/core/ui/compose/designsystem/src/main/res/values-fr/strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..edbb4be063bc39b5b09cc9b5ee159fc2c781c8f9
--- /dev/null
+++ b/core/ui/compose/designsystem/src/main/res/values-fr/strings.xml
@@ -0,0 +1,8 @@
+
+
+ Masquer le mot de passe
+ Montrer le mot de passe
+ Adresse courriel
+ Mot de passe
+ Réessayer
+
diff --git a/core/ui/compose/designsystem/src/main/res/values-it/strings.xml b/core/ui/compose/designsystem/src/main/res/values-it/strings.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4794e074439bda79fbd040828deccdaafe150b79
--- /dev/null
+++ b/core/ui/compose/designsystem/src/main/res/values-it/strings.xml
@@ -0,0 +1,8 @@
+
+
+ Nascondi la password
+ Mostra password
+ Indirizzo email
+ Password
+ Riprova
+
diff --git a/core/ui/compose/theme/build.gradle.kts b/core/ui/compose/theme/build.gradle.kts
index 30b8ecc1ae6ecab856b32c170b4a1fd9d497f22e..44fa033080f43e82f05553a458f900213e5034b1 100644
--- a/core/ui/compose/theme/build.gradle.kts
+++ b/core/ui/compose/theme/build.gradle.kts
@@ -12,4 +12,5 @@ dependencies {
implementation(libs.accompanist.systemuicontroller)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material.icons.extended)
+ implementation(libs.elib)
}
diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Icons.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Icons.kt
index d53125475fa1247d13ece1c2954f26f44b144006..c0e2a0d13d15be7145b054786b1036575b3f6055 100644
--- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Icons.kt
+++ b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Icons.kt
@@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.theme
import androidx.compose.material.icons.filled.AccountCircle
import androidx.compose.material.icons.filled.Check
+import androidx.compose.material.icons.filled.CheckCircle
import androidx.compose.material.icons.filled.Error
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material.icons.filled.MoveToInbox
@@ -34,6 +35,7 @@ object Icons {
val passwordVisibility = MaterialIcons.Filled.Visibility
val passwordVisibilityOff = MaterialIcons.Filled.VisibilityOff
val user = MaterialIcons.Filled.AccountCircle
+ val checkCircle = MaterialIcons.Filled.CheckCircle
}
object Outlined {
diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/K9Theme.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/K9Theme.kt
index c14681151656314f7e9262100375cd3cf44e7642..c5a71203b4f45303923df2afaa5953fb9c878159 100644
--- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/K9Theme.kt
+++ b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/K9Theme.kt
@@ -2,8 +2,10 @@ package app.k9mail.core.ui.compose.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
+import androidx.compose.ui.platform.LocalContext
import app.k9mail.core.ui.compose.theme.color.MaterialColor
import app.k9mail.core.ui.compose.theme.color.darkColors
+import app.k9mail.core.ui.compose.theme.color.eOsColors
import app.k9mail.core.ui.compose.theme.color.lightColors
private val k9LightColorPalette = lightColors(
@@ -29,8 +31,8 @@ fun K9Theme(
val images = Images(logo = R.drawable.core_ui_theme_k9_logo)
MainTheme(
- lightColorPalette = k9LightColorPalette,
- darkColorPalette = k9DarkColorPalette,
+ lightColorPalette = eOsColors(LocalContext.current, true),
+ darkColorPalette = eOsColors(LocalContext.current, false),
lightImages = images,
darkImages = images,
darkTheme = darkTheme,
diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/ThunderbirdTheme.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/ThunderbirdTheme.kt
index 48a33971d6c51954bdf60cd8631139a2c9dd36f7..d9d79735393609bd465f6db4fec7af2ce0035501 100644
--- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/ThunderbirdTheme.kt
+++ b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/ThunderbirdTheme.kt
@@ -2,8 +2,10 @@ package app.k9mail.core.ui.compose.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
+import androidx.compose.ui.platform.LocalContext
import app.k9mail.core.ui.compose.theme.color.MaterialColor
import app.k9mail.core.ui.compose.theme.color.darkColors
+import app.k9mail.core.ui.compose.theme.color.eOsColors
import app.k9mail.core.ui.compose.theme.color.lightColors
private val thunderbirdLightColorPalette = lightColors(
@@ -28,8 +30,8 @@ fun ThunderbirdTheme(
val images = Images(logo = R.drawable.core_ui_theme_thunderbird_logo)
MainTheme(
- lightColorPalette = thunderbirdLightColorPalette,
- darkColorPalette = thunderbirdDarkColorPalette,
+ lightColorPalette = eOsColors(LocalContext.current, true),
+ darkColorPalette = eOsColors(LocalContext.current, false),
lightImages = images,
darkImages = images,
darkTheme = darkTheme,
diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/Colors.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/Colors.kt
index 12e1fff377972b94798649730d533c93029ee148..ca60eae43b0ae5be27f643718fa7a5b13eaed06c 100644
--- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/Colors.kt
+++ b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/Colors.kt
@@ -1,8 +1,11 @@
package app.k9mail.core.ui.compose.theme.color
+import android.content.Context
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
+import androidx.core.content.ContextCompat
+import foundation.e.elib.R
import androidx.compose.material.Colors as MaterialColors
@Immutable
@@ -102,6 +105,28 @@ internal fun darkColors(
isLight = false,
)
+internal fun eOsColors(context: Context, isLight: Boolean): Colors {
+ return Colors(
+ primary = Color(ContextCompat.getColor(context, R.color.e_accent)),
+ primaryVariant = Color(ContextCompat.getColor(context, R.color.e_accent)),
+ secondary = Color(ContextCompat.getColor(context, R.color.e_icon_color)),
+ secondaryVariant = Color(ContextCompat.getColor(context, R.color.e_icon_color)),
+ background = Color(ContextCompat.getColor(context, R.color.e_background)),
+ surface = Color(ContextCompat.getColor(context, R.color.e_floating_background)),
+ success = Color(ContextCompat.getColor(context, R.color.e_accent_green)),
+ error = CustomColor.error_red,
+ warning = CustomColor.warning_orange,
+ info = if (isLight) MaterialColor.yellow_600 else MaterialColor.yellow_300,
+ onPrimary = Color(ContextCompat.getColor(context, R.color.e_background)),
+ onSecondary = Color(ContextCompat.getColor(context, R.color.e_background)),
+ onBackground = Color(ContextCompat.getColor(context, R.color.e_primary_text_color)),
+ onSurface = Color(ContextCompat.getColor(context, R.color.e_primary_text_color)),
+ onMessage = Color(ContextCompat.getColor(context, R.color.e_background)),
+ toolbar = Color(ContextCompat.getColor(context, R.color.e_action_bar)),
+ isLight = isLight,
+ )
+}
+
internal fun Colors.toMaterialColors(): MaterialColors {
return MaterialColors(
primary = primary,
diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/CustomColor.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/CustomColor.kt
new file mode 100644
index 0000000000000000000000000000000000000000..06e85bb8097c3e22e52b2fc92d644a1a7f6018c6
--- /dev/null
+++ b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/CustomColor.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright MURENA SAS 2023
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package app.k9mail.core.ui.compose.theme.color
+
+import androidx.compose.ui.graphics.Color
+
+internal object CustomColor {
+ val warning_orange = Color(color = 0xFFFF7A00)
+ val error_red = Color(color = 0xFFF8432E)
+}
diff --git a/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_k9_logo.xml b/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_k9_logo.xml
index 9a99f8f051bba0371092d8eec4b5519eddf457a1..c4907d00ba8b467c1f474c2d9841e9d171ced7b8 100644
--- a/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_k9_logo.xml
+++ b/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_k9_logo.xml
@@ -1,5 +1,4 @@
-
-