From ed891a44457544c84f4b4e513a081d9805e12b6d Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Tue, 19 Apr 2022 10:26:10 +0200 Subject: [PATCH] Use accent color setting for attachments previewer Closes https://github.com/SchildiChat/SchildiChat-android/issues/120 Change-Id: Iedcc1808b8408fd82ce8a6ce92c1f0c560b66cc2 --- generate_themes.sh | 4 +++ .../vector/app/features/themes/ThemeUtils.kt | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/generate_themes.sh b/generate_themes.sh index 9314a58abf..b5e11fc67a 100755 --- a/generate_themes.sh +++ b/generate_themes.sh @@ -150,6 +150,10 @@ function generate_accent_dark() { "Do not change this comment for automatic dark colored theme insertion" \ "\"$name_lc\" -> R.style.AppTheme_SC_Dark_Colored_$name" \ " " + insert_above_java_comment "vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt" \ + "Do not change this comment for automatic attachment theme insertion" \ + "\"$name_lc\" -> R.style.AppTheme_AttachmentsPreview_SC_$name" \ + " " } function generate_accent() { diff --git a/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt b/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt index 2a6a0018b1..70cb608cac 100644 --- a/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt +++ b/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt @@ -506,6 +506,31 @@ object ThemeUtils { else -> resId } } + R.style.AppTheme_AttachmentsPreview_SC -> { + when (themeAccent) { + "green" -> resId + "amber" -> R.style.AppTheme_AttachmentsPreview_SC_Amber + "bluelight" -> R.style.AppTheme_AttachmentsPreview_SC_BlueLight + "blue" -> R.style.AppTheme_AttachmentsPreview_SC_Blue + "carnation" -> R.style.AppTheme_AttachmentsPreview_SC_Carnation + "cyan" -> R.style.AppTheme_AttachmentsPreview_SC_Cyan + "denim" -> R.style.AppTheme_AttachmentsPreview_SC_Denim + "gold" -> R.style.AppTheme_AttachmentsPreview_SC_Gold + "greendark" -> R.style.AppTheme_AttachmentsPreview_SC_GreenDark + "indigo" -> R.style.AppTheme_AttachmentsPreview_SC_Indigo + "lava" -> R.style.AppTheme_AttachmentsPreview_SC_Lava + "lime" -> R.style.AppTheme_AttachmentsPreview_SC_Lime + "orange" -> R.style.AppTheme_AttachmentsPreview_SC_Orange + "pink" -> R.style.AppTheme_AttachmentsPreview_SC_Pink + "purple" -> R.style.AppTheme_AttachmentsPreview_SC_Purple + "red" -> R.style.AppTheme_AttachmentsPreview_SC_Red + "teal" -> R.style.AppTheme_AttachmentsPreview_SC_Teal + "turquoise" -> R.style.AppTheme_AttachmentsPreview_SC_Turquoise + "yellow" -> R.style.AppTheme_AttachmentsPreview_SC_Yellow + // Do not change this comment for automatic attachment theme insertion + else -> resId + } + } else -> resId } }