From 96a3bc3444f3286f38e87ae443a5ce9ceada9c6e Mon Sep 17 00:00:00 2001 From: Fahim Date: Wed, 9 Feb 2022 14:32:28 +0600 Subject: [PATCH 01/10] update searchView editText cursor color issue: https://gitlab.e.foundation/e/backlog/-/issues/4723 use accent color as the searchView's cursor, hightLightColor & selectHandle. --- app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml | 1 + app/ui/base/src/main/res/values/styles.xml | 2 ++ .../legacy/src/main/java/com/fsck/k9/activity/MessageList.kt | 2 -- app/ui/legacy/src/main/res/drawable/ic_opened_envelope.xml | 3 ++- app/ui/legacy/src/main/res/layout/fragment_settings_export.xml | 2 ++ app/ui/legacy/src/main/res/layout/fragment_settings_import.xml | 3 +++ app/ui/legacy/src/main/res/layout/message.xml | 2 ++ 7 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml b/app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml index fe5d170138..2a4a672b91 100644 --- a/app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml +++ b/app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml @@ -107,6 +107,7 @@ android:enabled="@{viewModel.isNextButtonEnabled()}" android:onClick="@{() -> viewModel.onNextButtonClicked()}" android:text="@string/next_action" + android:textColor="@android:color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/emailPasswordLayout" diff --git a/app/ui/base/src/main/res/values/styles.xml b/app/ui/base/src/main/res/values/styles.xml index f6c3327afa..808e7c55ee 100644 --- a/app/ui/base/src/main/res/values/styles.xml +++ b/app/ui/base/src/main/res/values/styles.xml @@ -2,5 +2,7 @@ \ No newline at end of file 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 c177feba43..ec96a46b60 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 @@ -45,7 +45,6 @@ import com.fsck.k9.fragment.MessageListFragment.MessageListFragmentListener import com.fsck.k9.helper.Contacts import com.fsck.k9.helper.ParcelableUtil import com.fsck.k9.mailstore.SearchStatusManager - import com.fsck.k9.notification.NotificationChannelManager import com.fsck.k9.preferences.GeneralSettingsManager import com.fsck.k9.search.LocalSearch @@ -103,7 +102,6 @@ open class MessageList : private val generalSettingsManager: GeneralSettingsManager by inject() private val messagingController: MessagingController by inject() - private val permissionUiHelper: PermissionUiHelper = K9PermissionUiHelper(this) private lateinit var actionBar: ActionBar diff --git a/app/ui/legacy/src/main/res/drawable/ic_opened_envelope.xml b/app/ui/legacy/src/main/res/drawable/ic_opened_envelope.xml index 6013d5ada9..2d2b1557d1 100644 --- a/app/ui/legacy/src/main/res/drawable/ic_opened_envelope.xml +++ b/app/ui/legacy/src/main/res/drawable/ic_opened_envelope.xml @@ -2,7 +2,8 @@ android:width="24dp" android:height="24dp" android:viewportWidth="24" - android:viewportHeight="24"> + android:viewportHeight="24" + android:tint="?android:attr/colorControlNormal"> diff --git a/app/ui/legacy/src/main/res/layout/fragment_settings_export.xml b/app/ui/legacy/src/main/res/layout/fragment_settings_export.xml index 378b77b41c..412f786d00 100644 --- a/app/ui/legacy/src/main/res/layout/fragment_settings_export.xml +++ b/app/ui/legacy/src/main/res/layout/fragment_settings_export.xml @@ -37,6 +37,7 @@ android:layout_marginBottom="4dp" android:enabled="false" android:text="@string/settings_export_button" + android:textColor="@android:color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -50,6 +51,7 @@ android:layout_marginEnd="8dp" android:layout_marginBottom="4dp" android:text="@string/settings_export_share_button" + android:textColor="@android:color/white" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/ui/legacy/src/main/res/layout/fragment_settings_import.xml b/app/ui/legacy/src/main/res/layout/fragment_settings_import.xml index 713895d70c..d0b61cbd6d 100644 --- a/app/ui/legacy/src/main/res/layout/fragment_settings_import.xml +++ b/app/ui/legacy/src/main/res/layout/fragment_settings_import.xml @@ -28,6 +28,7 @@ android:layout_marginEnd="16dp" android:layout_marginBottom="16dp" android:text="@string/settings_import_pick_document_button" + android:textColor="@android:color/white" app:layout_constraintBottom_toTopOf="@+id/bottomBar" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -65,6 +66,7 @@ android:layout_marginBottom="4dp" android:enabled="false" android:text="@string/settings_import_button" + android:textColor="@android:color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -79,6 +81,7 @@ android:layout_marginEnd="8dp" android:layout_marginBottom="4dp" android:text="@string/okay_action" + android:textColor="@android:color/white" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/ui/legacy/src/main/res/layout/message.xml b/app/ui/legacy/src/main/res/layout/message.xml index 66b1b24c21..8deb75ec06 100644 --- a/app/ui/legacy/src/main/res/layout/message.xml +++ b/app/ui/legacy/src/main/res/layout/message.xml @@ -35,6 +35,7 @@ android:layout_marginRight="6dip" android:layout_marginTop="4dip" android:text="@string/message_view_show_pictures_action" + android:textColor="@android:color/white" android:visibility="gone" tools:visibility="visible"/> @@ -94,6 +95,7 @@ android:id="@+id/download_remainder" style="@style/Widget.AppCompat.Button.Colored" android:text="@string/message_view_download_remainder" + android:textColor="@android:color/white" android:layout_height="wrap_content" android:visibility="gone" android:layout_width="fill_parent" -- GitLab From f0af835c47d0fc67847292eb8629e0a95c4068f4 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Fri, 11 Feb 2022 15:18:58 +0600 Subject: [PATCH 02/10] Update messageListItem onLongPress colors issue: https://gitlab.e.foundation/e/backlog/-/issues/4723 - remove checked icon showing on message selected state - update background color of message on-selected stage to color_default_gray1 for light-mode & color_default_gray2 for dark-mode for better visibility - update messageList preview text color to secondary text color for better visibility - update messageList item on-active background color to accent color - change message threadCount background box color to secondary text color for better visibility --- app/k9mail/src/main/res/values-night/colors.xml | 4 ++++ app/k9mail/src/main/res/values/colors.xml | 4 ++++ app/k9mail/src/main/res/values/themes.xml | 12 ++++++------ .../java/com/fsck/k9/fragment/MessageListAdapter.kt | 10 ---------- .../src/main/res/drawable/thread_count_box_light.xml | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) create mode 100644 app/k9mail/src/main/res/values-night/colors.xml diff --git a/app/k9mail/src/main/res/values-night/colors.xml b/app/k9mail/src/main/res/values-night/colors.xml new file mode 100644 index 0000000000..2adb34a844 --- /dev/null +++ b/app/k9mail/src/main/res/values-night/colors.xml @@ -0,0 +1,4 @@ + + + @color/color_default_gray2 + \ No newline at end of file diff --git a/app/k9mail/src/main/res/values/colors.xml b/app/k9mail/src/main/res/values/colors.xml index 0abca75b7f..fbdd8b067b 100644 --- a/app/k9mail/src/main/res/values/colors.xml +++ b/app/k9mail/src/main/res/values/colors.xml @@ -8,4 +8,8 @@ @lineageos.platform:color/color_default_primary_text @lineageos.platform:color/color_default_secondary_text @lineageos.platform:color/color_default_divider + @lineageos.platform:color/color_default_gray1 + @lineageos.platform:color/color_default_gray2 + + @color/color_default_gray1 \ No newline at end of file diff --git a/app/k9mail/src/main/res/values/themes.xml b/app/k9mail/src/main/res/values/themes.xml index 1fd70067e1..c37e37cb73 100644 --- a/app/k9mail/src/main/res/values/themes.xml +++ b/app/k9mail/src/main/res/values/themes.xml @@ -86,13 +86,13 @@ @drawable/ic_import_status @color/color_default_primary_text @color/color_default_secondary_text - #8038B8E2 + @color/color_message_list_selected_background #c0cdcdcd #00ffffff ?android:attr/colorBackground @drawable/thread_count_box_light - #ff2ea7d1 - #ff696969 + @color/color_default_accent + @color/color_default_secondary_text @color/color_default_divider #bbbbbb @lineageos.platform:drawable/ic_attachment @@ -212,13 +212,13 @@ @drawable/ic_import_status @color/color_default_primary_text @color/color_default_secondary_text - #8038B8E2 + @color/color_message_list_selected_background #c0cdcdcd #00ffffff ?android:attr/colorBackground @drawable/thread_count_box_light - #ff2ea7d1 - #ff696969 + @color/color_default_accent + @color/color_default_secondary_text @color/color_default_divider #bbbbbb @lineageos.platform:drawable/ic_attachment 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 d6e017e9ee..e72cdd05c4 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 @@ -138,16 +138,6 @@ class MessageListAdapter internal constructor( val holder = view.tag as MessageViewHolder - if (appearance.showContactPicture) { - if (isSelected) { - holder.contactPicture.isVisible = false - holder.selected.isVisible = true - } else { - holder.selected.isVisible = false - holder.contactPicture.isVisible = true - } - } - with(message) { val maybeBoldTypeface = if (isRead) Typeface.NORMAL else Typeface.BOLD val displayDate = relativeDateTimeFormatter.formatDate(messageDate) 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 3f5d4f3f2e..b2d8ddd456 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 @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> - + -- GitLab From 8b7e88c428769352fc80ce3761008c542e26215f Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Fri, 11 Feb 2022 17:39:16 +0600 Subject: [PATCH 03/10] Update drawer icon color on select stage issue: https://gitlab.e.foundation/e/backlog/-/issues/4723 retrieve drawable from resourceId, setTint=color_default_accent, set the icon as the `selectedIcon` of drawerItems --- .../src/main/java/com/fsck/k9/ui/K9Drawer.kt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt index 7c8262c284..556fa6d4a3 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt @@ -11,6 +11,10 @@ import android.view.View import android.widget.ImageView import android.widget.LinearLayout import android.widget.Toast +import androidx.appcompat.content.res.AppCompatResources +import androidx.core.content.ContextCompat +import androidx.core.content.res.ResourcesCompat +import androidx.core.graphics.drawable.DrawableCompat import androidx.core.view.GravityCompat import androidx.drawerlayout.widget.DrawerLayout import androidx.swiperefreshlayout.widget.SwipeRefreshLayout @@ -365,8 +369,13 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K } folderList.unifiedInbox?.let { unifiedInbox -> + val unwrappedDrawable = AppCompatResources.getDrawable(parent.applicationContext, R.drawable.ic_inbox_multiple) + val wrappedSelectedDrawable = DrawableCompat.wrap(unwrappedDrawable!!) + DrawableCompat.setTint(wrappedSelectedDrawable, ContextCompat.getColor(parent.applicationContext, R.color.color_default_accent)) + val unifiedInboxItem = PrimaryDrawerItem().apply { iconRes = R.drawable.ic_inbox_multiple //getResId(R.attr.iconUnifiedInbox) + selectedIcon = ImageHolder(wrappedSelectedDrawable) identifier = DRAWER_ID_UNIFIED_INBOX nameRes = R.string.integrated_inbox_title selectedColorInt = selectedBackgroundColor @@ -391,8 +400,14 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K val folder = displayFolder.folder val drawerId = accountOffset + folder.id + val iconId = folderIconProvider.getFolderIcon(folder.type) + val unwrappedDrawable = AppCompatResources.getDrawable(parent.applicationContext, iconId) + val wrappedSelectedDrawable = DrawableCompat.wrap(unwrappedDrawable!!) + DrawableCompat.setTint(wrappedSelectedDrawable, ContextCompat.getColor(parent.applicationContext, R.color.color_default_accent)) + val drawerItem = FolderDrawerItem().apply { - iconRes = folderIconProvider.getFolderIcon(folder.type) + iconRes = iconId + selectedIcon = ImageHolder(wrappedSelectedDrawable) identifier = drawerId tag = folder nameText = getFolderDisplayName(folder) -- GitLab From 507ffeb699d1527bb9cbffbc184447a7de0a21ba Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Fri, 11 Feb 2022 18:17:38 +0600 Subject: [PATCH 04/10] Change drawer-header background to primaryDark issue: https://gitlab.e.foundation/e/backlog/-/issues/4723 - Change drawer-header background to primaryDark for UI consistency - Update drawer-header textColors to primary & secondary text colors --- app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt | 3 +-- .../drawable/{blue_background.xml => header_background.xml} | 2 +- app/ui/legacy/src/main/res/values/styles.xml | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) rename app/ui/legacy/src/main/res/drawable/{blue_background.xml => header_background.xml} (64%) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt index 556fa6d4a3..840e8f0c28 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt @@ -13,7 +13,6 @@ import android.widget.LinearLayout import android.widget.Toast import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.ContextCompat -import androidx.core.content.res.ResourcesCompat import androidx.core.graphics.drawable.DrawableCompat import androidx.core.view.GravityCompat import androidx.drawerlayout.widget.DrawerLayout @@ -167,7 +166,7 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K } private fun configureAccountHeader() { - headerView.headerBackground = ImageHolder(R.drawable.blue_background) + headerView.headerBackground = ImageHolder(R.drawable.header_background) headerView.onAccountHeaderListener = { _, profile, _ -> val account = (profile as ProfileDrawerItem).tag as Account diff --git a/app/ui/legacy/src/main/res/drawable/blue_background.xml b/app/ui/legacy/src/main/res/drawable/header_background.xml similarity index 64% rename from app/ui/legacy/src/main/res/drawable/blue_background.xml rename to app/ui/legacy/src/main/res/drawable/header_background.xml index 73ab390fc5..401e975603 100644 --- a/app/ui/legacy/src/main/res/drawable/blue_background.xml +++ b/app/ui/legacy/src/main/res/drawable/header_background.xml @@ -1,6 +1,6 @@ - + diff --git a/app/ui/legacy/src/main/res/values/styles.xml b/app/ui/legacy/src/main/res/values/styles.xml index 3f6dc1702d..2ea6ee4e45 100644 --- a/app/ui/legacy/src/main/res/values/styles.xml +++ b/app/ui/legacy/src/main/res/values/styles.xml @@ -68,16 +68,14 @@