From 1811b02fc8209418078f603f341c4557c3c64ad1 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Sun, 23 Jul 2023 22:54:09 +0200 Subject: [PATCH] fix: colors Kitkat selection and progressCircular --- .../adapters/EntryAttachmentsItemsAdapter.kt | 8 ++- .../AttachmentFileNotificationService.kt | 8 ++- app/src/main/res/color-v23/progress_color.xml | 4 -- .../main/res/color/color_button_primary.xml | 6 -- .../main/res/color/color_button_secondary.xml | 5 -- app/src/main/res/color/color_on_primary.xml | 6 -- app/src/main/res/color/color_primary.xml | 6 -- app/src/main/res/color/color_secondary.xml | 6 -- .../main/res/color/edit_text_stroke_color.xml | 25 ------- ...light.xml => entry_text_primary_color.xml} | 2 +- ...color.xml => group_text_primary_color.xml} | 0 app/src/main/res/color/list_color.xml | 5 -- .../main/res/color/list_secondary_color.xml | 5 -- app/src/main/res/color/progress_color.xml | 4 -- app/src/main/res/color/text_color_button.xml | 5 -- app/src/main/res/color/text_color_night.xml | 5 -- .../res/color/text_color_secondary_light.xml | 5 -- .../res/color/text_color_secondary_night.xml | 5 -- .../text_secondary_color.xml} | 0 .../drawable/background_item_selection.xml | 4 +- .../drawable/background_progress_circle.xml | 12 ---- .../drawable/foreground_progress_circle.xml | 12 ---- .../foreground_progress_circle_secondary.xml | 12 ---- .../res/drawable/ic_info_hint_color_24dp.xml | 2 +- app/src/main/res/layout/item_attachment.xml | 13 ++-- .../main/res/layout/item_list_nodes_entry.xml | 2 +- app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 70 +++++++------------ 28 files changed, 50 insertions(+), 188 deletions(-) delete mode 100644 app/src/main/res/color-v23/progress_color.xml delete mode 100644 app/src/main/res/color/color_button_primary.xml delete mode 100644 app/src/main/res/color/color_button_secondary.xml delete mode 100644 app/src/main/res/color/color_on_primary.xml delete mode 100644 app/src/main/res/color/color_primary.xml delete mode 100644 app/src/main/res/color/color_secondary.xml delete mode 100644 app/src/main/res/color/edit_text_stroke_color.xml rename app/src/main/res/color/{text_color_light.xml => entry_text_primary_color.xml} (67%) rename app/src/main/res/color/{list_primary_color.xml => group_text_primary_color.xml} (100%) delete mode 100644 app/src/main/res/color/list_color.xml delete mode 100644 app/src/main/res/color/list_secondary_color.xml delete mode 100644 app/src/main/res/color/progress_color.xml delete mode 100644 app/src/main/res/color/text_color_button.xml delete mode 100644 app/src/main/res/color/text_color_night.xml delete mode 100644 app/src/main/res/color/text_color_secondary_light.xml delete mode 100644 app/src/main/res/color/text_color_secondary_night.xml rename app/src/main/res/{color-v23/list_secondary_color.xml => color/text_secondary_color.xml} (100%) delete mode 100644 app/src/main/res/drawable/background_progress_circle.xml delete mode 100644 app/src/main/res/drawable/foreground_progress_circle.xml delete mode 100644 app/src/main/res/drawable/foreground_progress_circle_secondary.xml diff --git a/app/src/main/java/com/kunzisoft/keepass/adapters/EntryAttachmentsItemsAdapter.kt b/app/src/main/java/com/kunzisoft/keepass/adapters/EntryAttachmentsItemsAdapter.kt index 6d9f9dab7..deb11bb98 100644 --- a/app/src/main/java/com/kunzisoft/keepass/adapters/EntryAttachmentsItemsAdapter.kt +++ b/app/src/main/java/com/kunzisoft/keepass/adapters/EntryAttachmentsItemsAdapter.kt @@ -27,9 +27,9 @@ import android.util.TypedValue import android.view.View import android.view.ViewGroup import android.widget.ImageView -import android.widget.ProgressBar import android.widget.TextView import androidx.recyclerview.widget.RecyclerView +import com.google.android.material.progressindicator.CircularProgressIndicator import com.kunzisoft.keepass.R import com.kunzisoft.keepass.activities.ImageViewerActivity import com.kunzisoft.keepass.database.ContextualDatabase @@ -38,6 +38,7 @@ import com.kunzisoft.keepass.database.helper.getLocalizedName import com.kunzisoft.keepass.model.AttachmentState import com.kunzisoft.keepass.model.EntryAttachmentState import com.kunzisoft.keepass.model.StreamDirection +import com.kunzisoft.keepass.services.AttachmentFileNotificationService.Companion.FILE_PROGRESSION_MAX import com.kunzisoft.keepass.tasks.BinaryDatabaseManager import com.kunzisoft.keepass.view.expand import kotlin.math.max @@ -138,6 +139,7 @@ class EntryAttachmentsItemsAdapter(context: Context) visibility = View.GONE } } + holder.binaryFileProgress.max = FILE_PROGRESSION_MAX when (entryAttachmentState.streamDirection) { StreamDirection.UPLOAD -> { holder.binaryFileProgressIcon.isActivated = true @@ -182,7 +184,7 @@ class EntryAttachmentsItemsAdapter(context: Context) AttachmentState.START, AttachmentState.IN_PROGRESS -> View.VISIBLE } - progress = entryAttachmentState.downloadProgression + setProgressCompat(entryAttachmentState.downloadProgression, true) } holder.binaryFileInfo.setOnClickListener { onItemClickListener?.invoke(entryAttachmentState) @@ -201,7 +203,7 @@ class EntryAttachmentsItemsAdapter(context: Context) var binaryFileCompression: TextView = itemView.findViewById(R.id.item_attachment_compression) var binaryFileProgressContainer: View = itemView.findViewById(R.id.item_attachment_progress_container) var binaryFileProgressIcon: ImageView = itemView.findViewById(R.id.item_attachment_icon) - var binaryFileProgress: ProgressBar = itemView.findViewById(R.id.item_attachment_progress) + var binaryFileProgress: CircularProgressIndicator = itemView.findViewById(R.id.item_attachment_progress) var binaryFileDeleteButton: View = itemView.findViewById(R.id.item_attachment_delete_button) } } diff --git a/app/src/main/java/com/kunzisoft/keepass/services/AttachmentFileNotificationService.kt b/app/src/main/java/com/kunzisoft/keepass/services/AttachmentFileNotificationService.kt index b79c65ab5..c15e7988c 100644 --- a/app/src/main/java/com/kunzisoft/keepass/services/AttachmentFileNotificationService.kt +++ b/app/src/main/java/com/kunzisoft/keepass/services/AttachmentFileNotificationService.kt @@ -240,10 +240,10 @@ class AttachmentFileNotificationService: LockNotificationService() { setOngoing(true) } AttachmentState.IN_PROGRESS -> { - if (attachmentNotification.entryAttachmentState.downloadProgression > 100) { + if (attachmentNotification.entryAttachmentState.downloadProgression > FILE_PROGRESSION_MAX) { setContentText(getString(R.string.download_finalization)) } else { - setProgress(100, + setProgress(FILE_PROGRESSION_MAX, attachmentNotification.entryAttachmentState.downloadProgression, false) setContentText(getString(R.string.download_progression, @@ -446,7 +446,7 @@ class AttachmentFileNotificationService: LockNotificationService() { if (downloadState != AttachmentState.CANCELED && downloadState != AttachmentState.ERROR) { downloadState = AttachmentState.COMPLETE - downloadProgression = 100 + downloadProgression = FILE_PROGRESSION_MAX } } attachmentNotification.attachmentFileAction = null @@ -495,6 +495,8 @@ class AttachmentFileNotificationService: LockNotificationService() { const val FILE_URI_KEY = "FILE_URI_KEY" const val ATTACHMENT_KEY = "ATTACHMENT_KEY" + + const val FILE_PROGRESSION_MAX = 100 } } \ No newline at end of file diff --git a/app/src/main/res/color-v23/progress_color.xml b/app/src/main/res/color-v23/progress_color.xml deleted file mode 100644 index 4106a655a..000000000 --- a/app/src/main/res/color-v23/progress_color.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/color/color_button_primary.xml b/app/src/main/res/color/color_button_primary.xml deleted file mode 100644 index 404c70c74..000000000 --- a/app/src/main/res/color/color_button_primary.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/color_button_secondary.xml b/app/src/main/res/color/color_button_secondary.xml deleted file mode 100644 index a7d084f41..000000000 --- a/app/src/main/res/color/color_button_secondary.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/color_on_primary.xml b/app/src/main/res/color/color_on_primary.xml deleted file mode 100644 index 2b7f79d15..000000000 --- a/app/src/main/res/color/color_on_primary.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/color_primary.xml b/app/src/main/res/color/color_primary.xml deleted file mode 100644 index 10fa45733..000000000 --- a/app/src/main/res/color/color_primary.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/color_secondary.xml b/app/src/main/res/color/color_secondary.xml deleted file mode 100644 index 678a86c7e..000000000 --- a/app/src/main/res/color/color_secondary.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/edit_text_stroke_color.xml b/app/src/main/res/color/edit_text_stroke_color.xml deleted file mode 100644 index 10e2723ac..000000000 --- a/app/src/main/res/color/edit_text_stroke_color.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/text_color_light.xml b/app/src/main/res/color/entry_text_primary_color.xml similarity index 67% rename from app/src/main/res/color/text_color_light.xml rename to app/src/main/res/color/entry_text_primary_color.xml index e8c759b37..c996c36e2 100644 --- a/app/src/main/res/color/text_color_light.xml +++ b/app/src/main/res/color/entry_text_primary_color.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/color/list_primary_color.xml b/app/src/main/res/color/group_text_primary_color.xml similarity index 100% rename from app/src/main/res/color/list_primary_color.xml rename to app/src/main/res/color/group_text_primary_color.xml diff --git a/app/src/main/res/color/list_color.xml b/app/src/main/res/color/list_color.xml deleted file mode 100644 index cc8ab381d..000000000 --- a/app/src/main/res/color/list_color.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/list_secondary_color.xml b/app/src/main/res/color/list_secondary_color.xml deleted file mode 100644 index 369b45e68..000000000 --- a/app/src/main/res/color/list_secondary_color.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/src/main/res/color/progress_color.xml b/app/src/main/res/color/progress_color.xml deleted file mode 100644 index 71df5c427..000000000 --- a/app/src/main/res/color/progress_color.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/color/text_color_button.xml b/app/src/main/res/color/text_color_button.xml deleted file mode 100644 index 41fb69212..000000000 --- a/app/src/main/res/color/text_color_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/text_color_night.xml b/app/src/main/res/color/text_color_night.xml deleted file mode 100644 index fff825c9e..000000000 --- a/app/src/main/res/color/text_color_night.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/text_color_secondary_light.xml b/app/src/main/res/color/text_color_secondary_light.xml deleted file mode 100644 index 7005319e0..000000000 --- a/app/src/main/res/color/text_color_secondary_light.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/text_color_secondary_night.xml b/app/src/main/res/color/text_color_secondary_night.xml deleted file mode 100644 index ea11472bf..000000000 --- a/app/src/main/res/color/text_color_secondary_night.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color-v23/list_secondary_color.xml b/app/src/main/res/color/text_secondary_color.xml similarity index 100% rename from app/src/main/res/color-v23/list_secondary_color.xml rename to app/src/main/res/color/text_secondary_color.xml diff --git a/app/src/main/res/drawable/background_item_selection.xml b/app/src/main/res/drawable/background_item_selection.xml index 787e7c42e..d013c67bc 100644 --- a/app/src/main/res/drawable/background_item_selection.xml +++ b/app/src/main/res/drawable/background_item_selection.xml @@ -3,13 +3,13 @@ - + - + \ No newline at end of file diff --git a/app/src/main/res/drawable/background_progress_circle.xml b/app/src/main/res/drawable/background_progress_circle.xml deleted file mode 100644 index 649f42f5b..000000000 --- a/app/src/main/res/drawable/background_progress_circle.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/foreground_progress_circle.xml b/app/src/main/res/drawable/foreground_progress_circle.xml deleted file mode 100644 index a0d24b9fe..000000000 --- a/app/src/main/res/drawable/foreground_progress_circle.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/foreground_progress_circle_secondary.xml b/app/src/main/res/drawable/foreground_progress_circle_secondary.xml deleted file mode 100644 index 446ebc816..000000000 --- a/app/src/main/res/drawable/foreground_progress_circle_secondary.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_info_hint_color_24dp.xml b/app/src/main/res/drawable/ic_info_hint_color_24dp.xml index 2cc867c6d..98027c3e7 100644 --- a/app/src/main/res/drawable/ic_info_hint_color_24dp.xml +++ b/app/src/main/res/drawable/ic_info_hint_color_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/layout/item_attachment.xml b/app/src/main/res/layout/item_attachment.xml index 53f65a9da..161c36af3 100644 --- a/app/src/main/res/layout/item_attachment.xml +++ b/app/src/main/res/layout/item_attachment.xml @@ -137,14 +137,15 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> - diff --git a/app/src/main/res/layout/item_list_nodes_entry.xml b/app/src/main/res/layout/item_list_nodes_entry.xml index 17ed739ed..219c9dad1 100644 --- a/app/src/main/res/layout/item_list_nodes_entry.xml +++ b/app/src/main/res/layout/item_list_nodes_entry.xml @@ -131,7 +131,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginRight="8dp" - android:background="@drawable/background_item_selection" + style="@style/KeepassDXStyle.Selectable.Item" android:orientation="horizontal" android:paddingStart="8dp" android:paddingLeft="8dp" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ebeac11c3..d3ecd9be5 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -39,6 +39,7 @@ #0e0e0e #E00E0E0E #000001 + #0D000000 #E0000000 #F1F8FF diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 6b8c9c012..341702c82 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -81,15 +81,10 @@ @style/KeepassDXStyle.TextAppearance @style/KeepassDXStyle.TextAppearance - @color/text_color_light - @color/text_color_light - @color/grey_light + ?attr/colorOnSurface @color/green_light - @color/white_darkest - @color/text_color_secondary_light - @color/grey_lighter - @color/text_color_secondary_light + ?attr/colorOnSurface @style/KeepassDXStyle.Light.Dialog @@ -175,15 +170,10 @@ @style/KeepassDXStyle.TextAppearance @style/KeepassDXStyle.TextAppearance - @color/text_color_night - @color/text_color_night - @color/white + ?attr/colorOnSurface @color/green_light - @color/white_darkest - @color/text_color_secondary_night - @color/grey_lighter - @color/text_color_secondary_night + ?attr/colorOnSurface @style/KeepassDXStyle.Night.Dialog @@ -282,10 +272,10 @@ @style/KeepassDXStyle.Light.Dialog.PositiveButtonStyle @@ -450,41 +440,41 @@ @@ -502,11 +492,11 @@ @@ -584,12 +574,6 @@ 16sp - - -