diff --git a/app/k9mail/src/main/res/values-night/colors.xml b/app/k9mail/src/main/res/values-night/colors.xml index 8b7b4c3e098d883a1318236e76386c3b4d45740e..9eb56540ccb004a434df2a03f233e15f0d7c6673 100644 --- a/app/k9mail/src/main/res/values-night/colors.xml +++ b/app/k9mail/src/main/res/values-night/colors.xml @@ -1,8 +1,23 @@ + + #121212 #2F2F2F - #61FFFFFF + #1FFFFFFF #DEFFFFFF #99FFFFFF #61FFFFFF diff --git a/app/k9mail/src/main/res/values/colors.xml b/app/k9mail/src/main/res/values/colors.xml index 43d0c5328d49dad3956a0541dc79aa5f269ffd17..2ae4f8e80400c94284aeb0b0d0b2f3e9aff0f7b6 100644 --- a/app/k9mail/src/main/res/values/colors.xml +++ b/app/k9mail/src/main/res/values/colors.xml @@ -1,4 +1,19 @@ + + @lineageos.platform:color/color_default_primary @lineageos.platform:color/color_default_primary_dark @@ -14,7 +29,7 @@ @lineageos.platform:color/color_default_selector_background #DCDCDC - #61000000 + #14212121 @android:color/white #ededed diff --git a/app/k9mail/src/main/res/values/themes.xml b/app/k9mail/src/main/res/values/themes.xml index 6331080f774460ed1038ad841be0f5ca09e5a6ef..b18641e71eaf9745ef735e9e6bef39d946562f2c 100644 --- a/app/k9mail/src/main/res/values/themes.xml +++ b/app/k9mail/src/main/res/values/themes.xml @@ -7,8 +7,17 @@ + + @@ -43,7 +52,7 @@ @drawable/ic_send @drawable/ic_alert_octagon @drawable/ic_trash_can - @drawable/ic_messagelist_attachment + @drawable/ic_add_attachment @drawable/ic_archive @drawable/ic_pencil @drawable/ic_trash_can @@ -99,10 +108,10 @@ @color/color_message_list_selected_background @color/color_default_background @color/color_message_list_unread_background - ?android:attr/colorBackground + @color/color_default_primary_text @drawable/thread_count_box_light @color/color_default_accent - @color/color_default_secondary_text + @color/color_default_ternary_text @color/color_default_divider @color/default_icon_color @drawable/ic_messagelist_attachment @@ -169,7 +178,7 @@ @drawable/ic_send @drawable/ic_alert_octagon @drawable/ic_trash_can - @drawable/ic_messagelist_attachment + @drawable/ic_add_attachment @drawable/ic_archive @drawable/ic_pencil @drawable/ic_trash_can @@ -225,10 +234,10 @@ @color/color_message_list_selected_background #c0cdcdcd @color/color_message_list_unread_background - ?android:attr/colorBackground + @color/color_default_primary_text @drawable/thread_count_box_light @color/color_default_accent - @color/color_default_secondary_text + @color/color_default_ternary_text @color/color_default_divider #bbbbbb @drawable/ic_messagelist_attachment diff --git a/app/ui/base/src/main/res/drawable/edittext_cursor.xml b/app/ui/base/src/main/res/drawable/edittext_cursor.xml index 8f3f1ae2372079089a5b9f1c541f703df316c6f1..bc3ba972d37891d968b04af2c8be74ae60fb5b97 100644 --- a/app/ui/base/src/main/res/drawable/edittext_cursor.xml +++ b/app/ui/base/src/main/res/drawable/edittext_cursor.xml @@ -1,5 +1,20 @@ - + + + - + diff --git a/app/ui/base/src/main/res/drawable/ic_arrow_back.xml b/app/ui/base/src/main/res/drawable/ic_arrow_back.xml index 37041792403339bf0b5828c37d6feb90a03b7f63..4ee8f72dd7c745b77097be6c0cf06575eb0f4dfc 100644 --- a/app/ui/base/src/main/res/drawable/ic_arrow_back.xml +++ b/app/ui/base/src/main/res/drawable/ic_arrow_back.xml @@ -1,3 +1,18 @@ + + + + #121212 #DEFFFFFF diff --git a/app/ui/base/src/main/res/values/colors.xml b/app/ui/base/src/main/res/values/colors.xml index 5b0ddc7556cd9b321cbfca5669fd3535a6f79f67..c0877b8880e65ec2097009a2a6fa832ea3d7f784 100644 --- a/app/ui/base/src/main/res/values/colors.xml +++ b/app/ui/base/src/main/res/values/colors.xml @@ -1,7 +1,21 @@ + + @color/color_default_secondary_text - @lineageos.platform:color/color_default_blue3 @lineageos.platform:color/color_default_primary @lineageos.platform:color/color_default_primary_dark diff --git a/app/ui/base/src/main/res/values/styles.xml b/app/ui/base/src/main/res/values/styles.xml index c4c022a5d1dcf0593d94a1718f059559785cc5e7..9b3825838f1ddec26174823bad10b25185c21163 100644 --- a/app/ui/base/src/main/res/values/styles.xml +++ b/app/ui/base/src/main/res/values/styles.xml @@ -3,10 +3,25 @@ + + + \ No newline at end of file diff --git a/app/ui/legacy/src/debug/res/values/colors.xml b/app/ui/legacy/src/debug/res/values/colors.xml index 109450a4a736de3e3c199837d2578ea396fdfd21..f80243d09f5e97c7d00aac1c3806d39ba4881546 100644 --- a/app/ui/legacy/src/debug/res/values/colors.xml +++ b/app/ui/legacy/src/debug/res/values/colors.xml @@ -1,4 +1,19 @@ + + #E4D9FF diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java index 53dd04ee093bd01851b1e8ab37cf2c94649e0087..510b4e405c7268ac9af019a140c83c16a6e5faab 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java @@ -1141,7 +1141,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, if (draftMessageId == null) { builder .setMessage(R.string.save_or_discard_draft_message_instructions_fmt) - .setNegativeButton(R.string.discard_action, new DialogInterface.OnClickListener() { + .setPositiveButton(R.string.discard_action, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { dismissDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE); @@ -1151,7 +1151,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, } else { builder .setMessage(R.string.save_or_discard_draft_message_changes) - .setNegativeButton(R.string.discard_action, new DialogInterface.OnClickListener() { + .setPositiveButton(R.string.discard_action, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { dismissDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE); @@ -1160,7 +1160,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, }); } return builder - .setPositiveButton(R.string.save_draft_action, new DialogInterface.OnClickListener() { + .setNegativeButton(R.string.cancel_action, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { dismissDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE); 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 06908f3dd0e7c29c5a13522d7fb212aa5d873342..e181cbe78900b4453f90255b09795b810ad40dd1 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 @@ -8,6 +8,7 @@ import android.content.Intent import android.content.IntentSender import android.content.res.Configuration import android.graphics.Color +import android.graphics.PorterDuffColorFilter import android.os.Bundle import android.os.Parcelable import android.util.TypedValue @@ -21,6 +22,7 @@ import android.widget.Toast import androidx.appcompat.app.ActionBar import androidx.appcompat.widget.SearchView import androidx.appcompat.widget.Toolbar +import androidx.core.content.ContextCompat import androidx.drawerlayout.widget.DrawerLayout import androidx.drawerlayout.widget.DrawerLayout.DrawerListener import androidx.fragment.app.FragmentManager @@ -334,6 +336,7 @@ open class MessageList : private fun initializeLayout() { progressBar = findViewById(R.id.message_list_progress) + progressBar?.progressDrawable?.colorFilter = PorterDuffColorFilter(ContextCompat.getColor(this, R.color.color_default_accent), android.graphics.PorterDuff.Mode.SRC_IN) messageViewPlaceHolder = PlaceholderFragment() } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java index 43878dc830e9dd62c70ebbc6b9c85873a2025f30..30d9521fd4bfafb114a3bee0d48c07aab8df0f9c 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java @@ -43,6 +43,7 @@ import com.fsck.k9.view.ClientCertificateSpinner; import com.fsck.k9.view.ClientCertificateSpinner.OnClientCertificateChangedListener; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; +import org.openintents.openpgp.util.OpenPgpProviderUtil; import timber.log.Timber; /** @@ -197,6 +198,7 @@ public class AccountSetupBasics extends K9Activity if (split.length == 2) { String domain = split[1]; xoauth2 = OAuth2Provider.Companion.isXOAuth2(domain); + } } @@ -251,6 +253,7 @@ public class AccountSetupBasics extends K9Activity if (mAccount == null) { mAccount = Preferences.getPreferences(this).newAccount(); mAccount.setChipColor(accountCreator.pickColor()); + mAccount.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(getApplicationContext())); } mAccount.setSenderName(getOwnerName()); @@ -304,12 +307,13 @@ public class AccountSetupBasics extends K9Activity onManualSetup(); return; } - if(xoauth2){ + String email = mEmailView.getText().toString(); + + if(OAuth2Provider.Companion.getProvider(email).toString().trim().equals("GMAIL")){ Intent intent = new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT); startActivity(intent); } else { - String email = mEmailView.getText().toString(); ConnectionSettings extraConnectionSettings = ExtraAccountDiscovery.discover(email); if (extraConnectionSettings != null) { finishAutoSetup(extraConnectionSettings); @@ -368,6 +372,7 @@ public class AccountSetupBasics extends K9Activity if (mAccount == null) { mAccount = Preferences.getPreferences(this).newAccount(); mAccount.setChipColor(accountCreator.pickColor()); + mAccount.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(getApplicationContext())); } mAccount.setSenderName(getOwnerName()); mAccount.setEmail(email); 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 25f1fbcf30d2aab53a133d0cf2053944f6ad5a69..d139c1cd194fb5be0bc1ed34426cbd5245c9e7cf 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 @@ -19,6 +19,7 @@ import com.fsck.k9.mail.ServerSettings; import com.fsck.k9.mailstore.SpecialLocalFoldersCreator; import com.fsck.k9.preferences.Protocols; import com.fsck.k9.ui.ConnectionSettings; +import org.openintents.openpgp.util.OpenPgpProviderUtil; import timber.log.Timber; @@ -34,6 +35,7 @@ public class EeloAccountCreator { account.setChipColor(accountCreator.pickColor()); account.setEmail(emailId); account.setName(emailId); + account.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(context.getApplicationContext())); ConnectionSettings connectionSettings = providersXmlDiscoveryDiscover(emailId); if (connectionSettings == null) { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt index b09882b3c5c9b5ea5570668d9ebff8a8ad280ff2..4b462b7ce429b9cb178e1a7e000279181bacdfc5 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt @@ -3,7 +3,6 @@ package com.fsck.k9.fragment import android.content.Context import android.content.res.Resources import android.content.res.Resources.Theme -import android.graphics.Color import android.graphics.Typeface import android.graphics.drawable.Drawable import android.text.Spannable @@ -12,13 +11,14 @@ import android.text.style.StyleSpan import android.view.LayoutInflater import android.view.View import android.view.View.GONE +import android.view.View.INVISIBLE import android.view.View.OnClickListener +import android.view.View.VISIBLE import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.ImageView import android.widget.TextView import androidx.core.content.ContextCompat -import androidx.core.graphics.drawable.DrawableCompat import androidx.core.view.isVisible import com.fsck.k9.FontSizes import com.fsck.k9.contacts.ContactPictureLoader @@ -46,10 +46,13 @@ class MessageListAdapter internal constructor( private val forwardedIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListForwarded) private val answeredIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListAnswered) private val forwardedAnsweredIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListAnsweredForwarded) - private val activeItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListActiveItemBackgroundColor) - private val selectedItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListSelectedBackgroundColor) + private val activeItemBackgroundColor: Int = + theme.resolveColorAttribute(R.attr.messageListActiveItemBackgroundColor) + private val selectedItemBackgroundColor: Int = + theme.resolveColorAttribute(R.attr.messageListSelectedBackgroundColor) private val readItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListReadItemBackgroundColor) - private val unreadItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListUnreadItemBackgroundColor) + private val unreadItemBackgroundColor: Int = + theme.resolveColorAttribute(R.attr.messageListUnreadItemBackgroundColor) var messages: List = emptyList() set(value) { @@ -98,6 +101,7 @@ class MessageListAdapter internal constructor( override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { val message = getItem(position) val view: View = convertView ?: newView(parent) + bindView(view, context, message) return view @@ -108,9 +112,6 @@ class MessageListAdapter internal constructor( val holder = MessageViewHolder(view) - view.findViewById(R.id.contact_picture_container).isVisible = appearance.showContactPicture - holder.contactPicture.setOnClickListener(contactPictureClickListener) - appearance.fontSizes.setViewTextSize(holder.subject, subjectViewFontSize) appearance.fontSizes.setViewTextSize(holder.date, appearance.fontSizes.messageListDate) @@ -118,7 +119,10 @@ class MessageListAdapter internal constructor( holder.preview.setLines(max(appearance.previewLines, 0)) appearance.fontSizes.setViewTextSize(holder.displayName, appearance.fontSizes.messageListSender) appearance.fontSizes.setViewTextSize(holder.preview, appearance.fontSizes.messageListPreview) - appearance.fontSizes.setViewTextSize(holder.threadCount, appearance.fontSizes.messageListSubject) // thread count is next to subject + appearance.fontSizes.setViewTextSize( + holder.threadCount, + appearance.fontSizes.messageListSubject + ) // thread count is next to subject holder.flagged.isVisible = false holder.flagged.tag = holder @@ -130,24 +134,37 @@ class MessageListAdapter internal constructor( } private fun bindView(view: View, context: Context, message: MessageListItem) { + + if (message.displayName.trim().toString().equals(res.getString(R.string.unknown_sender)) + && message.subject?.trim().toString().equals(res.getString(R.string.general_no_subject)) + ) { + view.setVisibility(View.GONE) + return + } + view.setVisibility(View.VISIBLE) val isSelected = selected.contains(message.uniqueId) val isActive = isActiveMessage(message) val holder = view.tag as MessageViewHolder - if (appearance.showContactPicture) { - if (isInSelectionMode) { - holder.contactPicture.isVisible = false - if (isSelected) { - holder.selected.setImageResource(R.drawable.ic_check_circle_large) - } else { - holder.selected.setImageResource(R.drawable.ic_non_check_circle_large) - } - holder.selected.isVisible = true + if (isInSelectionMode) { + if (isSelected) { + holder.selected.setImageResource(R.drawable.ic_check_circle_large) + holder.endDivider.setBackgroundResource(R.color.color_selected_divider) } else { - holder.selected.isVisible = false - holder.contactPicture.isVisible = true + holder.selected.setImageResource(R.drawable.ic_non_check_circle_large) + holder.endDivider.setBackgroundResource(R.color.color_default_divider) } + holder.selected.isVisible = true + holder.date.visibility = INVISIBLE + holder.rightCheveron.visibility = INVISIBLE + holder.threadCount.isVisible = false + holder.attachment.isVisible = false + } else { + holder.selected.isVisible = false + holder.date.visibility = VISIBLE + holder.rightCheveron.visibility = VISIBLE + holder.endDivider.setBackgroundResource(R.color.color_default_divider) } with(message) { @@ -162,14 +179,11 @@ class MessageListAdapter internal constructor( holder.flagged.isVisible = false } holder.position = position - if (appearance.showContactPicture && holder.contactPicture.isVisible) { - setContactPicture(holder.contactPicture, displayAddress) - } - setBackgroundColor(view, isSelected, isRead, isActive) - updateWithThreadCount(holder, displayThreadCount) + + setBackgroundColor(view, isSelected, isActive) + holder.unreadMessageIndicator.visibility = if (isRead) INVISIBLE else VISIBLE val beforePreviewText = if (appearance.senderAboveSubject) subject else displayName holder.displayName.setText(beforePreviewText, TextView.BufferType.SPANNABLE) - formatDisplayText(holder.displayName, isRead) if (appearance.previewLines > 0) { val preview = getPreview(isMessageEncrypted, previewText) holder.preview.setText(preview, TextView.BufferType.SPANNABLE) @@ -185,7 +199,10 @@ class MessageListAdapter internal constructor( } holder.date.text = displayDate - holder.attachment.isVisible = hasAttachments + if (!isInSelectionMode) { + holder.attachment.isVisible = hasAttachments + updateWithThreadCount(holder, displayThreadCount) + } val statusHolder = buildStatusHolder(isForwarded, isAnswered) if (statusHolder != null) { @@ -194,6 +211,7 @@ class MessageListAdapter internal constructor( } else { holder.status.isVisible = false } + } } @@ -242,13 +260,10 @@ class MessageListAdapter internal constructor( return null } - private fun setBackgroundColor(view: View, selected: Boolean, read: Boolean, active: Boolean) { - val backGroundAsReadIndicator = appearance.backGroundAsReadIndicator + private fun setBackgroundColor(view: View, selected: Boolean, active: Boolean) { val backgroundColor = when { active -> activeItemBackgroundColor selected -> selectedItemBackgroundColor - backGroundAsReadIndicator && read -> readItemBackgroundColor - backGroundAsReadIndicator && !read -> unreadItemBackgroundColor else -> ContextCompat.getColor(view.context, R.color.color_default_background) } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index 246f6d9ef0286808eb25f3b95e5e99ebdf1bc616..4a7898fdcaf4147be31e84a983bcd0842bdbd9d8 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -44,16 +44,17 @@ import com.fsck.k9.ui.R import com.fsck.k9.ui.choosefolder.ChooseFolderActivity import com.fsck.k9.ui.folders.FolderNameFormatter import com.fsck.k9.ui.folders.FolderNameFormatterFactory +import com.fsck.k9.ui.folders.FoldersViewModel import com.fsck.k9.ui.helper.RelativeDateTimeFormatter import com.fsck.k9.ui.messagelist.MessageListAppearance import com.fsck.k9.ui.messagelist.MessageListConfig import com.fsck.k9.ui.messagelist.MessageListInfo import com.fsck.k9.ui.messagelist.MessageListItem import com.fsck.k9.ui.messagelist.MessageListViewModel -import java.util.HashSet import java.util.concurrent.Future import net.jcip.annotations.GuardedBy import org.koin.android.ext.android.inject +import org.koin.androidx.viewmodel.ext.android.sharedViewModel import org.koin.androidx.viewmodel.ext.android.viewModel import timber.log.Timber @@ -64,6 +65,7 @@ class MessageListFragment : ConfirmationDialogFragmentListener, MessageListItemActionListener { + private val foldersViewModel: FoldersViewModel by sharedViewModel() private val viewModel: MessageListViewModel by viewModel() private val sortTypeToastProvider: SortTypeToastProvider by inject() private val folderNameFormatterFactory: FolderNameFormatterFactory by inject() @@ -100,6 +102,8 @@ class MessageListFragment : private var actionMode: ActionMode? = null private var hasConnectivity: Boolean? = null + private var unreadMessageCount : Int = 0 + /** * Relevant messages for the current context when we have to remember the chosen messages * between user interactions (e.g. selecting a folder for move operation). @@ -153,6 +157,18 @@ class MessageListFragment : setMessageList(messageListInfo) } + if (!isUnifiedInbox && currentFolder != null) { + foldersViewModel.getFolderListLiveData().observe(this) { folderList -> + folderList.folders.forEach { + if (it.folder.id == currentFolder?.databaseId) { + unreadMessageCount = it.unreadMessageCount + setWindowTitle() + return@forEach + } + } + } + } + isInitialized = true } @@ -315,15 +331,16 @@ class MessageListFragment : } private fun setWindowProgress() { - var level = 0 if (currentFolder?.loading == true) { + var level = 0 val folderTotal = activityListener.getFolderTotal() if (folderTotal > 0) { level = (MAX_PROGRESS * activityListener.getFolderCompleted() / folderTotal).coerceAtMost(MAX_PROGRESS) } + fragmentListener.setMessageListProgress(level) + } else { + fragmentListener.setMessageListProgressEnabled(false) } - - fragmentListener.setMessageListProgress(level) } private fun setWindowTitle() { @@ -337,10 +354,17 @@ class MessageListFragment : } val subtitle = account.let { account -> - if (account == null || isUnifiedInbox || preferences.accounts.size == 1) { + if (account == null || isUnifiedInbox) { null } else { - account.displayName + var name = account.displayName + if (unreadMessageCount > 0) { + if (name.length > 10) { + name = name.substring(0, 10) + "..." + } + name += "[$unreadMessageCount]" + } + name } } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageViewHolder.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageViewHolder.kt index 0c5b296b18fff104931ce0703105f7e70e2e99e4..a80f654b3a7a0d9d0fbc3248d145d8960af86d18 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageViewHolder.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageViewHolder.kt @@ -3,6 +3,7 @@ package com.fsck.k9.fragment import android.view.View import android.widget.CheckBox import android.widget.ImageView +import android.widget.LinearLayout import android.widget.TextView import com.fsck.k9.ui.R @@ -10,7 +11,6 @@ class MessageViewHolder(view: View) { var position = -1 val selected: ImageView = view.findViewById(R.id.selected) - val contactPicture: ImageView = view.findViewById(R.id.contact_picture) val subject: TextView = view.findViewById(R.id.subject) val displayName: TextView = view.findViewById(R.id.displayName) val preview: TextView = view.findViewById(R.id.preview) @@ -20,4 +20,7 @@ class MessageViewHolder(view: View) { val flagged: CheckBox = view.findViewById(R.id.star) val attachment: ImageView = view.findViewById(R.id.attachment) val status: ImageView = view.findViewById(R.id.status) + val unreadMessageIndicator : View = view.findViewById(R.id.unread_message_indicator) + val rightCheveron : View = view.findViewById(R.id.right_chevron) + val endDivider : View = view.findViewById(R.id.end_divider) } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/CustomPreferenceCategory.java b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/CustomPreferenceCategory.java index 4a901616b5ccce31d9c29a1d6daf26af2bdf47af..fd0c2b96c99e7e8b07fa6752e050dcf8f47ec86d 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/CustomPreferenceCategory.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/CustomPreferenceCategory.java @@ -1,5 +1,21 @@ -package com.fsck.k9.ui.settings; +/* + * Copyright (C) 2022 E FOUNDATION + * + * 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 com.fsck.k9.ui.settings; import android.content.Context; import android.graphics.Typeface; diff --git a/app/ui/legacy/src/main/res/drawable/bg_recipient_token.xml b/app/ui/legacy/src/main/res/drawable/bg_recipient_token.xml index ec48cf744f7f004569f48f4bfef8592e06232fb7..2f64563e0959f60da706351ac2bc43f6e43f97e4 100644 --- a/app/ui/legacy/src/main/res/drawable/bg_recipient_token.xml +++ b/app/ui/legacy/src/main/res/drawable/bg_recipient_token.xml @@ -1,4 +1,19 @@ + + + + diff --git a/app/ui/legacy/src/main/res/drawable/ic_add_attachment.xml b/app/ui/legacy/src/main/res/drawable/ic_add_attachment.xml new file mode 100644 index 0000000000000000000000000000000000000000..ae3c64a745da23fcaf6dde35eb366d09c5d59c8a --- /dev/null +++ b/app/ui/legacy/src/main/res/drawable/ic_add_attachment.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/app/ui/legacy/src/main/res/drawable/ic_alert_octagon.xml b/app/ui/legacy/src/main/res/drawable/ic_alert_octagon.xml index ddab9f180b0cef3115c9e0517246ce9934533a2e..6c1cae0e24982e8e94888e2e63288c953ec15001 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_alert_octagon.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_alert_octagon.xml @@ -1,17 +1,17 @@ - diff --git a/app/ui/legacy/src/main/res/drawable/ic_alert_octagon_default.xml b/app/ui/legacy/src/main/res/drawable/ic_alert_octagon_default.xml index 5f7932dc83417cca518b3d9625765f94b3dbea94..3f7a60cd4c4b63d0314c628a417dad92bf6e1b27 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_alert_octagon_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_alert_octagon_default.xml @@ -1,4 +1,19 @@ + + + + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_archive_default.xml b/app/ui/legacy/src/main/res/drawable/ic_archive_default.xml index 2084e35242d6eef30b221d3750e10ca3ce4400b8..61c5b30dacb1a0232e1996b17c0cf53c3274110c 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_archive_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_archive_default.xml @@ -1,4 +1,19 @@ + + + + . +--> + . +--> + . +--> + . +--> + . +--> + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_avatar_default.xml b/app/ui/legacy/src/main/res/drawable/ic_avatar_default.xml index 00b7012ec79a5a7e288cca79ef7b19086b66331e..1b65a688ad2d458781fc1221c272e7b2cc62a8f2 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_avatar_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_avatar_default.xml @@ -1,3 +1,18 @@ + + . +--> + + android:width="32dp" + android:height="32dp" + android:viewportWidth="32" + android:viewportHeight="32"> + android:pathData="M16,16m-16,0a16,16 0,1 1,32 0a16,16 0,1 1,-32 0" + android:fillColor="@color/color_default_accent"/> + android:pathData="M13.3292,19.2293L9.8542,15.7543L8.6709,16.9293L13.3292,21.5876L23.3292,11.5876L22.1542,10.4126L13.3292,19.2293Z" + android:fillColor="@color/color_default_background"/> diff --git a/app/ui/legacy/src/main/res/drawable/ic_chevron_right_small.xml b/app/ui/legacy/src/main/res/drawable/ic_chevron_right_small.xml new file mode 100644 index 0000000000000000000000000000000000000000..de57f39a586bdfc3338a95c6e5990306552b6dff --- /dev/null +++ b/app/ui/legacy/src/main/res/drawable/ic_chevron_right_small.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/app/ui/legacy/src/main/res/drawable/ic_close.xml b/app/ui/legacy/src/main/res/drawable/ic_close.xml index b7b59abdda103ade848c147f4595c75528b21b46..9b5c5e25b12cfcdabaff3cc75bc88a963421a1a9 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_close.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_close.xml @@ -1,9 +1,10 @@ + + android:viewportWidth="24" + android:viewportHeight="24"> + android:fillColor="@color/color_default_primary_text" + android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/> diff --git a/app/ui/legacy/src/main/res/drawable/ic_create_new_folder.xml b/app/ui/legacy/src/main/res/drawable/ic_create_new_folder.xml index 4131990bac30d782fb0bbc903068168e7a07411c..8ba1cb16c65995a58f90f4309d1b912bdaa58e8c 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_create_new_folder.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_create_new_folder.xml @@ -1,3 +1,18 @@ + + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_drafts_folder_default.xml b/app/ui/legacy/src/main/res/drawable/ic_drafts_folder_default.xml index 6c1178307a6130f50ff3fedf654094bc83b5cb98..97837bcd7fd00b3eb1aa64d7b8be21f908c1dacc 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_drafts_folder_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_drafts_folder_default.xml @@ -1,4 +1,19 @@ + + + + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_folder_default.xml b/app/ui/legacy/src/main/res/drawable/ic_folder_default.xml index cb5006c23fd96baa4b47522ed01b9a47a3ad24e6..a6f229864d0e805fa82f181e76d59278c840cb60 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_folder_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_folder_default.xml @@ -1,4 +1,19 @@ + + + + + + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_inbox_default.xml b/app/ui/legacy/src/main/res/drawable/ic_inbox_default.xml index 680c06eaaa42428d9dbf526e7cf64afad7625edb..21063291bc74f780a8e56aa59d43bd453266a381 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_inbox_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_inbox_default.xml @@ -1,4 +1,19 @@ + + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_inbox_multiple_default.xml b/app/ui/legacy/src/main/res/drawable/ic_inbox_multiple_default.xml index b66dd11feb81b150dc02c40537a2d7eecc2e0120..c6269ee5ed87a92824577fc02a35ec820940b28a 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_inbox_multiple_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_inbox_multiple_default.xml @@ -1,4 +1,19 @@ + + + + + + + android:width="16dp" + android:height="16dp" + android:viewportWidth="16" + android:viewportHeight="16"> + android:fillColor="@color/default_icon_color" + android:pathData="M11.9997,10.6666L4.333,10.6666C2.8597,10.6666 1.6663,9.4733 1.6663,7.9999C1.6663,6.5266 2.8597,5.3333 4.333,5.3333L12.6663,5.3333C13.5863,5.3333 14.333,6.0799 14.333,6.9999C14.333,7.9199 13.5863,8.6666 12.6663,8.6666L5.6663,8.6666C5.2997,8.6666 4.9997,8.3666 4.9997,7.9999C4.9997,7.6333 5.2997,7.3333 5.6663,7.3333L11.9997,7.3333L11.9997,6.3333L5.6663,6.3333C4.7463,6.3333 3.9997,7.0799 3.9997,7.9999C3.9997,8.9199 4.7463,9.6666 5.6663,9.6666L12.6663,9.6666C14.1397,9.6666 15.333,8.4733 15.333,6.9999C15.333,5.5266 14.1397,4.3333 12.6663,4.3333L4.333,4.3333C2.3063,4.3333 0.6663,5.9732 0.6663,7.9999C0.6663,10.0266 2.3063,11.6666 4.333,11.6666L11.9997,11.6666L11.9997,10.6666Z" /> diff --git a/app/ui/legacy/src/main/res/drawable/ic_non_check_circle_large.xml b/app/ui/legacy/src/main/res/drawable/ic_non_check_circle_large.xml index 7bbffe9f6f74534b8c22bacdaa158fb0f59ef74d..e615ee007136f1f5d97ac9811fb21378e6c9344e 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_non_check_circle_large.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_non_check_circle_large.xml @@ -6,9 +6,9 @@ + android:color="@color/color_default_ternary_text" /> + android:width="32dp" + android:height="32dp"/> diff --git a/app/ui/legacy/src/main/res/drawable/ic_outbox.xml b/app/ui/legacy/src/main/res/drawable/ic_outbox.xml index 8c4fbb606992a4bb831cd5bab9f4f6962407c1cf..5e71270bad22ea2525385c0c41cf285345715ea4 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_outbox.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_outbox.xml @@ -1,17 +1,17 @@ - diff --git a/app/ui/legacy/src/main/res/drawable/ic_outbox_default.xml b/app/ui/legacy/src/main/res/drawable/ic_outbox_default.xml index d618ab2d6429c669103458ffbd190931332af325..6a44f076b988f083c9ea1ea4d95d1ae1715fb071 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_outbox_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_outbox_default.xml @@ -1,4 +1,19 @@ + + + + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_send_default.xml b/app/ui/legacy/src/main/res/drawable/ic_send_default.xml index 1b6a78dc86f7fa694c5c48aa759e16ee83dc516c..3ae236a14515358c543ce53ed66fb4c628a248c7 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_send_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_send_default.xml @@ -1,4 +1,19 @@ + + + + . +--> + . +--> + . +--> + . +--> + - diff --git a/app/ui/legacy/src/main/res/drawable/ic_trash_can_default.xml b/app/ui/legacy/src/main/res/drawable/ic_trash_can_default.xml index 53866c3e29ecd35a185f60935b949d7c257e684c..7679c9b2242e204bdfc62bca63356b5b9661068c 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_trash_can_default.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_trash_can_default.xml @@ -1,4 +1,19 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/ui/legacy/src/main/res/drawable/thread_count_box_dark.xml b/app/ui/legacy/src/main/res/drawable/thread_count_box_dark.xml index c9e4db53a876e5996f0daa74af3720ba327243f8..5609a3dc8891ffafe88d27e8dfce17cb77859e03 100644 --- a/app/ui/legacy/src/main/res/drawable/thread_count_box_dark.xml +++ b/app/ui/legacy/src/main/res/drawable/thread_count_box_dark.xml @@ -1,10 +1,24 @@ - + - + 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 . +--> + + + + diff --git a/app/ui/legacy/src/main/res/drawable/thread_count_box_light.xml b/app/ui/legacy/src/main/res/drawable/thread_count_box_light.xml index 4eda0ac2e9d7e7067fe7decad259fbbbcd567010..5609a3dc8891ffafe88d27e8dfce17cb77859e03 100644 --- a/app/ui/legacy/src/main/res/drawable/thread_count_box_light.xml +++ b/app/ui/legacy/src/main/res/drawable/thread_count_box_light.xml @@ -1,10 +1,24 @@ - + - + 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 . +--> + + + + diff --git a/app/ui/legacy/src/main/res/layout/account_spinner_item.xml b/app/ui/legacy/src/main/res/layout/account_spinner_item.xml index 0f40688bf071ca720ac1f6966926c82d3eede005..d6708460e44a9bf195fe0c621ca2a0eed6d5c746 100644 --- a/app/ui/legacy/src/main/res/layout/account_spinner_item.xml +++ b/app/ui/legacy/src/main/res/layout/account_spinner_item.xml @@ -15,6 +15,8 @@ android:ellipsize="end" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceListItem" + android:textColor="@color/color_default_primary_text" + android:textSize="16sp" tools:text="Personal" /> diff --git a/app/ui/legacy/src/main/res/layout/custom_preference.xml b/app/ui/legacy/src/main/res/layout/custom_preference.xml index a049a9b64b0aa244d972a563dcbf925b28da2ab1..096701e5deb7da262ffacccf4c6936edaa1acb3a 100644 --- a/app/ui/legacy/src/main/res/layout/custom_preference.xml +++ b/app/ui/legacy/src/main/res/layout/custom_preference.xml @@ -1,19 +1,18 @@ - + - + + + diff --git a/app/ui/legacy/src/main/res/layout/message_list_item.xml b/app/ui/legacy/src/main/res/layout/message_list_item.xml index b303cdc4c091f6ecebab9449f051f8b5263ed051..464615f9d2a5635e0cc38686142e30879d0c0aa4 100644 --- a/app/ui/legacy/src/main/res/layout/message_list_item.xml +++ b/app/ui/legacy/src/main/res/layout/message_list_item.xml @@ -1,216 +1,221 @@ - - + + + android:orientation="horizontal"> - - - + - - - - - - - - - - - - + android:focusableInTouchMode="false"> - - - - - - - - - + + + + - + tools:text="Subject" /> + + + + + + + + - + + + + + + + + + + + + + - - - + android:textColor="@color/color_default_ternary_text" + android:textSize="12sp" + tools:text="Oct 27" /> + + + + + + diff --git a/app/ui/legacy/src/main/res/layout/recipient_alternate_item.xml b/app/ui/legacy/src/main/res/layout/recipient_alternate_item.xml index 0daf7d03ed517a597204160a253af0f64d528dcb..9051668d320999793029796d4c88254621cf19de 100644 --- a/app/ui/legacy/src/main/res/layout/recipient_alternate_item.xml +++ b/app/ui/legacy/src/main/res/layout/recipient_alternate_item.xml @@ -2,6 +2,7 @@ diff --git a/app/ui/legacy/src/main/res/layout/recipient_token_item.xml b/app/ui/legacy/src/main/res/layout/recipient_token_item.xml index b7367c271f8b09d99a315076a03112944da5d1a5..1262310d25b6f150fa5f6b5ff450fdbdd893bb28 100644 --- a/app/ui/legacy/src/main/res/layout/recipient_token_item.xml +++ b/app/ui/legacy/src/main/res/layout/recipient_token_item.xml @@ -41,6 +41,7 @@ android:id="@android:id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:maxWidth="235dp" android:layout_marginStart="8dp" android:ellipsize="end" android:maxLines="1" diff --git a/app/ui/legacy/src/main/res/values-night/colors.xml b/app/ui/legacy/src/main/res/values-night/colors.xml index f154cb310ee1001ac1eae2dfd406090f73f05a20..fc0dc3cdba3b4a137fd7982db7cc4e8676948040 100644 --- a/app/ui/legacy/src/main/res/values-night/colors.xml +++ b/app/ui/legacy/src/main/res/values-night/colors.xml @@ -1,4 +1,19 @@ + + #121212 #DEFFFFFF @@ -6,9 +21,12 @@ #61FFFFFF #6BFFFFFF + #470086FF #14FFFFFF #2e2e2e #363636 #2e2e2e + + #1FFFFFFF \ No newline at end of file diff --git a/app/ui/legacy/src/main/res/values/colors.xml b/app/ui/legacy/src/main/res/values/colors.xml index 23c9fd51fef92f51cab08602967d4b4aabb656ec..27a0f0bdc01248c62d216a976c0d97cbcf63fe5b 100644 --- a/app/ui/legacy/src/main/res/values/colors.xml +++ b/app/ui/legacy/src/main/res/values/colors.xml @@ -1,4 +1,19 @@ + + #FFDAE1 @@ -27,6 +42,7 @@ #99000000 #61000000 #14212121 + #470086FF @lineageos.platform:color/color_default_gray2 #6B212121 @@ -36,4 +52,6 @@ #fafafa #145DB2FF @android:color/white + + #14212121 diff --git a/app/ui/legacy/src/main/res/values/strings.xml b/app/ui/legacy/src/main/res/values/strings.xml index 79238b28266369a10b4af21392bb89dac2601108..e6833a6059cf95c6d107102d68cf5b8e991ad2c1 100644 --- a/app/ui/legacy/src/main/res/values/strings.xml +++ b/app/ui/legacy/src/main/res/values/strings.xml @@ -89,7 +89,7 @@ Send… Refile… Done - Discard + DELETE Save as draft Check mail Send messages @@ -845,12 +845,12 @@ No suitable application for this action found. Send failed: %s - Save draft message? - Save or Discard this message? - Save or Discard changes? + Confirm deletion + Do you want to delete this message? + Do you want to delete this changes? - Discard message? - Are you sure you want to discard this message? + Confirm deletion + Do you want to delete this message? Select text to copy. diff --git a/app/ui/legacy/src/main/res/xml/general_settings.xml b/app/ui/legacy/src/main/res/xml/general_settings.xml index 920f3f1d3b9d8ed65b98c9d08fcf1332db2bf7ce..864418d9e9aaa5d3f03a739677cad1e0af4d5554 100644 --- a/app/ui/legacy/src/main/res/xml/general_settings.xml +++ b/app/ui/legacy/src/main/res/xml/general_settings.xml @@ -330,7 +330,8 @@ android:key="messagelist_show_contact_picture" android:layout="@layout/custom_preference" android:summary="@string/global_settings_show_contact_picture_summary" - android:title="@string/global_settings_show_contact_picture_label" /> + android:title="@string/global_settings_show_contact_picture_label" + app:isPreferenceVisible="false" /> diff --git a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpProviderUtil.java b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpProviderUtil.java index b5e9b1e802d4fd6df64e8730c1e84b596f402114..e2b3fd729c2f2bab198957f4d5f68d12b8fb2a36 100644 --- a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpProviderUtil.java +++ b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpProviderUtil.java @@ -9,6 +9,8 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import androidx.annotation.Nullable; + public class OpenPgpProviderUtil { private static final String PACKAGE_NAME_APG = "org.thialfihar.android.apg"; @@ -17,6 +19,15 @@ public class OpenPgpProviderUtil { DISALLOWED_PROVIDERS.add(PACKAGE_NAME_APG); } + @Nullable + public static String getOpenPgpProviderPackage(Context context) { + List openPgpProviderPackages = getOpenPgpProviderPackages(context); + if (openPgpProviderPackages.size() > 0) { + return openPgpProviderPackages.get(0); + } + return null; + } + public static List getOpenPgpProviderPackages(Context context) { ArrayList result = new ArrayList<>();