From ffa0049c096fc063574e621bab6531cf25e0d349 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Fri, 5 Apr 2024 13:38:39 +0200 Subject: [PATCH] Remove colors from theme We had a mix of specific colors and theme-based Material You colors. This aims to remove any hardcoded color so the app only uses the colors from the current theme. --- .../state_list_drawer_background.xml | 5 --- res/drawable-v24/ic_launcher_background.xml | 2 +- res/drawable/button_round.xml | 4 +-- res/drawable/disableable_button.xml | 5 --- res/drawable/ic_kde_24dp.xml | 9 +++-- res/drawable/state_list_drawer_background.xml | 5 --- .../state_list_drawer_background_dark.xml | 5 --- res/layout/about_person_list_item_entry.xml | 1 - res/layout/activity_about_kde.xml | 3 +- res/layout/list_item_entry.xml | 1 - res/layout/list_item_systemvolume.xml | 4 +-- res/layout/mpris_control.xml | 3 +- res/layout/preference_with_button.xml | 3 +- res/layout/view_pair_error.xml | 4 +-- res/layout/widget_remotecommandplugin.xml | 5 +-- res/values-night-v31/colors.xml | 27 --------------- res/values-night/colors-night.xml | 26 --------------- res/values-notnight-v31/colors.xml | 22 ------------- res/values/attrs.xml | 3 -- res/values/colors.xml | 21 ------------ res/values/styles.xml | 33 ------------------- .../Plugins/MprisPlugin/MprisMediaSession.kt | 1 - .../MprisPlugin/MprisNowPlayingFragment.kt | 1 - .../UserInterface/About/EasterEggActivity.kt | 4 --- 24 files changed, 16 insertions(+), 181 deletions(-) delete mode 100644 res/drawable-night/state_list_drawer_background.xml delete mode 100644 res/drawable/disableable_button.xml delete mode 100644 res/drawable/state_list_drawer_background.xml delete mode 100644 res/drawable/state_list_drawer_background_dark.xml delete mode 100644 res/values-night-v31/colors.xml delete mode 100644 res/values-night/colors-night.xml delete mode 100644 res/values-notnight-v31/colors.xml delete mode 100644 res/values/colors.xml diff --git a/res/drawable-night/state_list_drawer_background.xml b/res/drawable-night/state_list_drawer_background.xml deleted file mode 100644 index cbfe301e..00000000 --- a/res/drawable-night/state_list_drawer_background.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/res/drawable-v24/ic_launcher_background.xml b/res/drawable-v24/ic_launcher_background.xml index cccda63e..46fa7f3f 100644 --- a/res/drawable-v24/ic_launcher_background.xml +++ b/res/drawable-v24/ic_launcher_background.xml @@ -6,7 +6,7 @@ android:viewportHeight="108"> + android:fillColor="?colorAccent"/> - + - \ No newline at end of file + diff --git a/res/drawable/disableable_button.xml b/res/drawable/disableable_button.xml deleted file mode 100644 index 6f901927..00000000 --- a/res/drawable/disableable_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/res/drawable/ic_kde_24dp.xml b/res/drawable/ic_kde_24dp.xml index 674b8c34..65cc8ee0 100644 --- a/res/drawable/ic_kde_24dp.xml +++ b/res/drawable/ic_kde_24dp.xml @@ -1,4 +1,9 @@ - + android:viewportWidth="48" android:width="24dp" + xmlns:android="http://schemas.android.com/apk/res/android" + android:tint="?attr/colorControlNormal"> + > + diff --git a/res/drawable/state_list_drawer_background.xml b/res/drawable/state_list_drawer_background.xml deleted file mode 100644 index 6f4b8f91..00000000 --- a/res/drawable/state_list_drawer_background.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/res/drawable/state_list_drawer_background_dark.xml b/res/drawable/state_list_drawer_background_dark.xml deleted file mode 100644 index 10a24fb6..00000000 --- a/res/drawable/state_list_drawer_background_dark.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/res/layout/about_person_list_item_entry.xml b/res/layout/about_person_list_item_entry.xml index 06c17d8d..dd244eca 100644 --- a/res/layout/about_person_list_item_entry.xml +++ b/res/layout/about_person_list_item_entry.xml @@ -56,7 +56,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted android:contentDescription="@string/visit_contributors_homepage" android:src="@drawable/ic_baseline_web_24" android:visibility="gone" - app:tint="@color/text_color" tools:visibility="visible" /> diff --git a/res/layout/activity_about_kde.xml b/res/layout/activity_about_kde.xml index 1e5d1764..2426d32b 100644 --- a/res/layout/activity_about_kde.xml +++ b/res/layout/activity_about_kde.xml @@ -38,8 +38,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted android:text="@string/kde_be_free" android:textAppearance="?attr/textAppearanceHeadline6" app:drawableLeftCompat="@drawable/ic_kde_48dp" - app:drawableStartCompat="@drawable/ic_kde_48dp" - app:drawableTint="@color/text_color" /> + app:drawableStartCompat="@drawable/ic_kde_48dp"/> diff --git a/res/layout/list_item_systemvolume.xml b/res/layout/list_item_systemvolume.xml index 62c4a1ce..013d5495 100644 --- a/res/layout/list_item_systemvolume.xml +++ b/res/layout/list_item_systemvolume.xml @@ -15,7 +15,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted app:cardCornerRadius="8dp" app:cardElevation="0dp" app:contentPadding="8dp" - app:strokeColor="@color/card_stroke_color" app:strokeWidth="1dp"> + android:src="@drawable/ic_volume_black"/> + android:src="@drawable/ic_volume_black"/> diff --git a/res/layout/view_pair_error.xml b/res/layout/view_pair_error.xml index 08c7de77..cae52a0e 100644 --- a/res/layout/view_pair_error.xml +++ b/res/layout/view_pair_error.xml @@ -30,9 +30,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted android:importantForAccessibility="no" android:paddingEnd="8dip" android:paddingStart="0dip" - android:src="@drawable/ic_error_outline_48dp" - app:tint="?attr/colorHighContrast" - tools:ignore="UnusedAttribute" /> + android:src="@drawable/ic_error_outline_48dp" /> @@ -28,7 +27,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted android:paddingEnd="6dip" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:tint="@color/text_color" android:src="@drawable/ic_kde_24dp" android:importantForAccessibility="no" tools:ignore="UseAppTint"/> @@ -38,7 +36,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="marquee" - android:textColor="@color/text_color" android:text="@string/kde_connect" android:fadingEdge="horizontal" android:singleLine="true" diff --git a/res/values-night-v31/colors.xml b/res/values-night-v31/colors.xml deleted file mode 100644 index e5fc0e67..00000000 --- a/res/values-night-v31/colors.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - @android:color/system_accent2_300 - @android:color/system_neutral1_900 - @android:color/system_accent2_300 - #EEEEEE - @android:color/system_accent1_700 - @android:color/system_neutral1_50 - @android:color/system_neutral2_0 - @android:color/system_neutral2_50 - @android:color/system_neutral1_900 - @android:color/system_neutral2_800 - @android:color/system_neutral1_900 - - - @android:color/white - - diff --git a/res/values-night/colors-night.xml b/res/values-night/colors-night.xml deleted file mode 100644 index 36f98bc3..00000000 --- a/res/values-night/colors-night.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - @android:color/black - #555555 - #222222 - #333333 - @android:color/black - @android:color/white - @android:color/white - @android:color/white - @android:color/black - #8C8C8C - @android:color/black - - - @android:color/white - diff --git a/res/values-notnight-v31/colors.xml b/res/values-notnight-v31/colors.xml deleted file mode 100644 index d1da00b4..00000000 --- a/res/values-notnight-v31/colors.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - @android:color/system_accent2_500 - @android:color/system_neutral1_50 - @android:color/system_accent2_500 - #EEEEEE - @android:color/system_accent1_200 - @android:color/system_accent1_700 - @android:color/system_accent2_700 - @android:color/system_neutral2_700 - @android:color/system_neutral1_50 - @android:color/system_neutral2_100 - @android:color/system_neutral1_50 - - diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 1fbad569..43e84083 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -6,12 +6,9 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted - - - diff --git a/res/values/colors.xml b/res/values/colors.xml deleted file mode 100644 index 6f73c8f1..00000000 --- a/res/values/colors.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - #F67400 - @android:color/white - #F67400 - #EEEEEE - #C8C8C8 - @android:color/black - @android:color/black - @android:color/black - @android:color/white - #C8C8C8 - @android:color/white - diff --git a/res/values/styles.xml b/res/values/styles.xml index 532ce8f2..5a212f03 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -8,28 +8,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted - - diff --git a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisMediaSession.kt b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisMediaSession.kt index d8765f43..fad67030 100644 --- a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisMediaSession.kt +++ b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisMediaSession.kt @@ -369,7 +369,6 @@ class MprisMediaSession : OnSharedPreferenceChangeListener, NotificationReceiver .setContentIntent(piOpenActivity) .setSmallIcon(R.drawable.ic_play_white) .setShowWhen(false) - .setColor(ContextCompat.getColor(context!!, R.color.primary)) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setSubText(device.name) diff --git a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisNowPlayingFragment.kt b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisNowPlayingFragment.kt index 6cd3573d..e1af4a98 100644 --- a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisNowPlayingFragment.kt +++ b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisNowPlayingFragment.kt @@ -276,7 +276,6 @@ class MprisNowPlayingFragment : Fragment(), VolumeKeyListener { if (albumArt == null) { val drawable = ContextCompat.getDrawable(requireContext(), R.drawable.ic_album_art_placeholder)!! val placeholder_art = DrawableCompat.wrap(drawable) - DrawableCompat.setTint(placeholder_art, ContextCompat.getColor(requireContext(), R.color.primary)) activityMprisBinding.albumArt.setImageDrawable(placeholder_art) } else { activityMprisBinding.albumArt.setImageBitmap(albumArt) diff --git a/src/org/kde/kdeconnect/UserInterface/About/EasterEggActivity.kt b/src/org/kde/kdeconnect/UserInterface/About/EasterEggActivity.kt index 4b3102d2..5a62a8e2 100644 --- a/src/org/kde/kdeconnect/UserInterface/About/EasterEggActivity.kt +++ b/src/org/kde/kdeconnect/UserInterface/About/EasterEggActivity.kt @@ -59,10 +59,6 @@ class EasterEggActivity : AppCompatActivity(), SensorEventListener { if (!isAlreadyLongClicked) { isAlreadyLongClicked = true - binding!!.easterEggLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.activity_background)) - binding!!.logo.setColorFilter(ContextCompat.getColor(this, R.color.text_color)) - binding!!.angle.setTextColor(ContextCompat.getColor(this, R.color.text_color)) - var typedArray = this.theme.obtainStyledAttributes(intArrayOf(android.R.attr.statusBarColor)) window.statusBarColor = typedArray.getColor(0, Color.WHITE) window.navigationBarColor = typedArray.getColor(0, Color.WHITE)