Material red for warnings and errors in SC themes

Change-Id: Ic7f8550f4a15b8128b4c6c83fb9f8aa3498c915e
This commit is contained in:
SpiritCroc 2022-06-07 18:21:14 +02:00
parent f79edd64a6
commit 89f129c657
21 changed files with 137 additions and 11 deletions

View File

@ -48,6 +48,9 @@
<attr name="unread_line_unimportant" format="color" />
<attr name="color_warning" format="color" />
<attr name="shield_color_warning" format="color" />
</declare-styleable>
</resources>

View File

@ -101,4 +101,10 @@
<color name="user_color_element_pl_1">@color/palette_kiwi</color>
<color name="user_color_element_pl_0">@color/palette_element_green</color>
<color name="sc_alert">#E53935</color>
<color name="sc_alert_light">@color/sc_alert</color>
<color name="sc_alert_dark">@color/sc_alert</color>
<color name="color_warning_sc">@color/sc_alert</color>
<color name="shield_color_warning_sc">@color/color_warning_sc</color>
</resources>

View File

@ -157,6 +157,8 @@
<item name="room_color_hash_02">@color/element_room_02</item>
<item name="room_color_hash_03">@color/element_room_03</item>
<item name="unread_line_unimportant">?vctr_content_tertiary</item>
<item name="color_warning">#FF4B55</item>
<item name="shield_color_warning">@color/shield_color_warning</item>
<item name="android:statusBarColor">@color/android_status_bar_background_dark</item>
<item name="android:navigationBarColor">@color/android_navigation_bar_background_dark</item>

View File

@ -157,6 +157,8 @@
<item name="room_color_hash_02">@color/element_room_02</item>
<item name="room_color_hash_03">@color/element_room_03</item>
<item name="unread_line_unimportant">?vctr_content_secondary</item>
<item name="color_warning">#FF4B55</item>
<item name="shield_color_warning">@color/shield_color_warning</item>
<!-- Use dark color, to have enough contrast with icons color. windowLightStatusBar is only available in API 23+ -->
<item name="android:statusBarColor">@color/android_status_bar_background_dark</item>

View File

@ -56,7 +56,7 @@
<item name="colorSecondary">?colorAccent</item>
<item name="colorSecondaryVariant">?colorAccent</item>
<item name="colorOnSecondary">?vctr_content_primary</item>
<item name="colorError">@color/element_alert_dark</item>
<item name="colorError">@color/sc_alert_dark</item>
<item name="colorOnError">?vctr_content_primary</item>
<item name="colorSurface">@color/background_black_sc</item> <!-- same as android:colorBackground, but using attr crashes actionMode? -->
<item name="colorOnSurface">?vctr_content_primary</item>
@ -112,6 +112,8 @@
<item name="user_color_hash_06">@color/user_color_sc_mxid_6</item>
<item name="user_color_hash_07">@color/user_color_sc_mxid_7</item>
<item name="user_color_hash_08">@color/user_color_sc_mxid_8</item>
<item name="color_warning">@color/color_warning_sc</item>
<item name="shield_color_warning">@color/shield_color_warning_sc</item>
<item name="android:statusBarColor">@color/background_black_sc</item>
<item name="android:navigationBarColor">@color/background_black_sc</item>

View File

@ -56,7 +56,7 @@
<item name="colorSecondary">?colorAccent</item>
<item name="colorSecondaryVariant">?colorAccent</item>
<item name="colorOnSecondary">?colorOnPrimary</item><!-- primary = accent -> better to use a light text color -->
<item name="colorError">@color/element_alert_light</item>
<item name="colorError">@color/sc_alert_light</item>
<item name="colorOnError">@color/text_color_primary_sc</item> <!-- needs light text, e.g. used for unread counter badges -->
<item name="colorSurface">@color/background_sc_light</item> <!-- same as android:colorBackground, but using attr crashes actionMode (but for dark themes only?)? -->
<item name="colorOnSurface">?vctr_content_primary</item>
@ -111,6 +111,8 @@
<item name="user_color_hash_06">@color/user_color_sc_mxid_6</item>
<item name="user_color_hash_07">@color/user_color_sc_mxid_7</item>
<item name="user_color_hash_08">@color/user_color_sc_mxid_8</item>
<item name="color_warning">@color/color_warning_sc</item>
<item name="shield_color_warning">@color/shield_color_warning_sc</item>
<item name="android:statusBarColor">@color/background_black_sc</item>
<item name="android:navigationBarColor">@color/background_black_sc</item>

View File

@ -12,6 +12,8 @@ require_clean_git
sed -i 's|"@color/riotx_accent"|"?colorAccent"|g' vector/src/*/res/layout/*
sed -i 's|"@style/VectorButtonStyle"|"?materialButtonStyle"|g' vector/src/*/res/layout/*
sed -i 's|"@color/element_background_light"|"?backgroundColorLight"|g' vector/src/*/res/layout/*
sed -i 's|#FF4B55|#E53935|g' vector/src/*/res/drawable/*
sed -i 's|#ff4b55|#e53935|g' vector/src/*/res/drawable/*
uncommitted=`git status --porcelain`
if [ -z "$uncommitted" ]; then
echo "Seems like colors are still fine :)"

View File

@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="21dp"
android:viewportWidth="24"
android:viewportHeight="21">
<path
android:pathData="M10.29,2.86L1.82,17a2,2 0,0 0,1.71 3h16.94a2,2 0,0 0,1.71 -3L13.71,2.86a2,2 0,0 0,-3.42 0zM12,8v4M12,15.5v0.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:fillType="evenOdd"
android:strokeColor="?color_warning"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M18,6L6,18"
android:strokeWidth="2"
android:strokeColor="?color_warning"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="#00000000"
android:pathData="M6,6L18,18"
android:strokeWidth="2"
android:strokeColor="?color_warning"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M8,16C12.4183,16 16,12.4183 16,8C16,3.5817 12.4183,0 8,0C3.5817,0 0,3.5817 0,8C0,12.4183 3.5817,16 8,16ZM6.9806,4.5101C6.9306,3.9401 7.3506,3.4401 7.9206,3.4001C8.4806,3.3601 8.9806,3.7801 9.0406,4.3501V4.5101L8.7206,8.5101C8.6906,8.8801 8.3806,9.1601 8.0106,9.1601H7.9506C7.6006,9.1301 7.3306,8.8601 7.3006,8.5101L6.9806,4.5101ZM8.8801,11.1202C8.8801,11.6062 8.4861,12.0002 8.0001,12.0002C7.5141,12.0002 7.1201,11.6062 7.1201,11.1202C7.1201,10.6342 7.5141,10.2402 8.0001,10.2402C8.4861,10.2402 8.8801,10.6342 8.8801,11.1202Z"
android:fillColor="?color_warning"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:strokeWidth="1"
android:pathData="M12.0077,23.4869C12.0051,23.4875 12.0025,23.4881 12,23.4886C11.9975,23.4881 11.9949,23.4875 11.9923,23.4869C11.9204,23.4706 11.8129,23.4452 11.6749,23.4092C11.3989,23.3373 11.0015,23.2235 10.5233,23.0575C9.5654,22.725 8.2921,22.186 7.0225,21.3608C4.4897,19.7145 2,16.954 2,12.405V3.4496L12,0.521L22,3.4496V12.405C22,16.954 19.5103,19.7145 16.9775,21.3608C15.7079,22.186 14.4346,22.725 13.4767,23.0575C12.9985,23.2235 12.6011,23.3373 12.3251,23.4092C12.1871,23.4452 12.0796,23.4706 12.0077,23.4869Z"
android:fillColor="?shield_color_warning"
android:strokeColor="#ffffff"/>
<path
android:pathData="M10.8527,8.0725C10.7964,7.4313 11.2689,6.8688 11.9102,6.8238C12.5402,6.7788 13.1027,7.2513 13.1702,7.8925V8.0725L12.8102,12.5725C12.7764,12.9888 12.4277,13.3038 12.0114,13.3038H11.9439C11.5502,13.27 11.2464,12.9663 11.2127,12.5725L10.8527,8.0725ZM12.9888,15.5076C12.9888,16.0543 12.5456,16.4976 11.9988,16.4976C11.452,16.4976 11.0088,16.0543 11.0088,15.5076C11.0088,14.9608 11.452,14.5176 11.9988,14.5176C12.5456,14.5176 12.9888,14.9608 12.9888,15.5076Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:strokeWidth="1"
android:pathData="M12.0077,23.4869C12.0051,23.4875 12.0025,23.4881 12,23.4886C11.9975,23.4881 11.9949,23.4875 11.9923,23.4869C11.9204,23.4706 11.8129,23.4452 11.6749,23.4092C11.3989,23.3373 11.0015,23.2235 10.5233,23.0575C9.5654,22.725 8.2921,22.186 7.0225,21.3608C4.4897,19.7145 2,16.954 2,12.405V3.4496L12,0.521L22,3.4496V12.405C22,16.954 19.5103,19.7145 16.9775,21.3608C15.7079,22.186 14.4346,22.725 13.4767,23.0575C12.9985,23.2235 12.6011,23.3373 12.3251,23.4092C12.1871,23.4452 12.0796,23.4706 12.0077,23.4869Z"
android:fillColor="?shield_color_warning"
android:strokeColor="#ffffff"/>
<path
android:pathData="M1.5,12.405V3.075L12,0L22.5,3.075V12.405C22.5,21.945 12,24 12,24C12,24 1.5,21.945 1.5,12.405Z"
android:fillColor="?shield_color_warning"/>
<path
android:pathData="M10.8527,8.0725C10.7964,7.4313 11.2689,6.8688 11.9102,6.8238C12.5402,6.7788 13.1027,7.2513 13.1702,7.8925V8.0725L12.8102,12.5725C12.7764,12.9888 12.4277,13.3038 12.0114,13.3038H11.9439C11.5502,13.27 11.2464,12.9663 11.2127,12.5725L10.8527,8.0725ZM12.9888,15.5076C12.9888,16.0543 12.5456,16.4976 11.9988,16.4976C11.452,16.4976 11.0088,16.0543 11.0088,15.5076C11.0088,14.9608 11.452,14.5176 11.9988,14.5176C12.5456,14.5176 12.9888,14.9608 12.9888,15.5076Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:strokeWidth="1"
android:pathData="M6.0995,11.4627C6.0611,11.4727 6.0278,11.481 6,11.4876C5.9722,11.481 5.9389,11.4727 5.9005,11.4627C5.768,11.4282 5.5757,11.3731 5.3437,11.2926C4.8779,11.1309 4.2608,10.8694 3.6475,10.4708C2.4272,9.6776 1.25,8.3665 1.25,6.2025V1.9121L6,0.521L10.75,1.9121V6.2025C10.75,8.3665 9.5728,9.6776 8.3525,10.4708C7.7392,10.8694 7.1221,11.1309 6.6563,11.2926C6.4243,11.3731 6.232,11.4282 6.0995,11.4627Z"
android:fillColor="?shield_color_warning"
android:strokeColor="#ffffff"/>
<path
android:pathData="M5.4263,4.0363C5.3982,3.7156 5.6345,3.4344 5.9551,3.4119C6.2701,3.3894 6.5513,3.6256 6.5851,3.9463V4.0363L6.4051,6.2863C6.3882,6.4944 6.2138,6.6519 6.0057,6.6519H5.972C5.7751,6.635 5.6232,6.4831 5.6063,6.2863L5.4263,4.0363ZM6.4944,7.7538C6.4944,8.0272 6.2728,8.2488 5.9994,8.2488C5.726,8.2488 5.5044,8.0272 5.5044,7.7538C5.5044,7.4804 5.726,7.2588 5.9994,7.2588C6.2728,7.2588 6.4944,7.4804 6.4944,7.7538Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M8,8m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"
android:fillColor="?color_warning"/>
<path
android:pathData="M8,3L8,3A1,1 0,0 1,9 4L9,8A1,1 0,0 1,8 9L8,9A1,1 0,0 1,7 8L7,4A1,1 0,0 1,8 3z"
android:fillColor="#ffffff"/>
<path
android:pathData="M8,11L8,11A1,1 0,0 1,9 12L9,12A1,1 0,0 1,8 13L8,13A1,1 0,0 1,7 12L7,12A1,1 0,0 1,8 11z"
android:fillColor="#ffffff"/>
</vector>

View File

@ -9,6 +9,6 @@
android:strokeWidth="2"
android:fillColor="#00000000"
android:fillType="evenOdd"
android:strokeColor="#FF4B55"
android:strokeColor="#E53935"
android:strokeLineCap="round"/>
</vector>

View File

@ -7,14 +7,14 @@
android:fillColor="#00000000"
android:pathData="M18,6L6,18"
android:strokeWidth="2"
android:strokeColor="#ff4b55"
android:strokeColor="#e53935"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="#00000000"
android:pathData="M6,6L18,18"
android:strokeWidth="2"
android:strokeColor="#ff4b55"
android:strokeColor="#e53935"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@ -5,6 +5,6 @@
android:viewportHeight="16">
<path
android:pathData="M8,16C12.4183,16 16,12.4183 16,8C16,3.5817 12.4183,0 8,0C3.5817,0 0,3.5817 0,8C0,12.4183 3.5817,16 8,16ZM6.9806,4.5101C6.9306,3.9401 7.3506,3.4401 7.9206,3.4001C8.4806,3.3601 8.9806,3.7801 9.0406,4.3501V4.5101L8.7206,8.5101C8.6906,8.8801 8.3806,9.1601 8.0106,9.1601H7.9506C7.6006,9.1301 7.3306,8.8601 7.3006,8.5101L6.9806,4.5101ZM8.8801,11.1202C8.8801,11.6062 8.4861,12.0002 8.0001,12.0002C7.5141,12.0002 7.1201,11.6062 7.1201,11.1202C7.1201,10.6342 7.5141,10.2402 8.0001,10.2402C8.4861,10.2402 8.8801,10.6342 8.8801,11.1202Z"
android:fillColor="#FF4B55"
android:fillColor="#E53935"
android:fillType="evenOdd"/>
</vector>

View File

@ -6,7 +6,7 @@
<path
android:strokeWidth="1"
android:pathData="M12.0077,23.4869C12.0051,23.4875 12.0025,23.4881 12,23.4886C11.9975,23.4881 11.9949,23.4875 11.9923,23.4869C11.9204,23.4706 11.8129,23.4452 11.6749,23.4092C11.3989,23.3373 11.0015,23.2235 10.5233,23.0575C9.5654,22.725 8.2921,22.186 7.0225,21.3608C4.4897,19.7145 2,16.954 2,12.405V3.4496L12,0.521L22,3.4496V12.405C22,16.954 19.5103,19.7145 16.9775,21.3608C15.7079,22.186 14.4346,22.725 13.4767,23.0575C12.9985,23.2235 12.6011,23.3373 12.3251,23.4092C12.1871,23.4452 12.0796,23.4706 12.0077,23.4869Z"
android:fillColor="@color/shield_color_warning"
android:fillColor="@color/shield_color_warning_sc"
android:strokeColor="#ffffff"/>
<path
android:pathData="M10.8527,8.0725C10.7964,7.4313 11.2689,6.8688 11.9102,6.8238C12.5402,6.7788 13.1027,7.2513 13.1702,7.8925V8.0725L12.8102,12.5725C12.7764,12.9888 12.4277,13.3038 12.0114,13.3038H11.9439C11.5502,13.27 11.2464,12.9663 11.2127,12.5725L10.8527,8.0725ZM12.9888,15.5076C12.9888,16.0543 12.5456,16.4976 11.9988,16.4976C11.452,16.4976 11.0088,16.0543 11.0088,15.5076C11.0088,14.9608 11.452,14.5176 11.9988,14.5176C12.5456,14.5176 12.9888,14.9608 12.9888,15.5076Z"

View File

@ -6,11 +6,11 @@
<path
android:strokeWidth="1"
android:pathData="M12.0077,23.4869C12.0051,23.4875 12.0025,23.4881 12,23.4886C11.9975,23.4881 11.9949,23.4875 11.9923,23.4869C11.9204,23.4706 11.8129,23.4452 11.6749,23.4092C11.3989,23.3373 11.0015,23.2235 10.5233,23.0575C9.5654,22.725 8.2921,22.186 7.0225,21.3608C4.4897,19.7145 2,16.954 2,12.405V3.4496L12,0.521L22,3.4496V12.405C22,16.954 19.5103,19.7145 16.9775,21.3608C15.7079,22.186 14.4346,22.725 13.4767,23.0575C12.9985,23.2235 12.6011,23.3373 12.3251,23.4092C12.1871,23.4452 12.0796,23.4706 12.0077,23.4869Z"
android:fillColor="@color/shield_color_warning"
android:fillColor="@color/shield_color_warning_sc"
android:strokeColor="#ffffff"/>
<path
android:pathData="M1.5,12.405V3.075L12,0L22.5,3.075V12.405C22.5,21.945 12,24 12,24C12,24 1.5,21.945 1.5,12.405Z"
android:fillColor="@color/shield_color_warning"/>
android:fillColor="@color/shield_color_warning_sc"/>
<path
android:pathData="M10.8527,8.0725C10.7964,7.4313 11.2689,6.8688 11.9102,6.8238C12.5402,6.7788 13.1027,7.2513 13.1702,7.8925V8.0725L12.8102,12.5725C12.7764,12.9888 12.4277,13.3038 12.0114,13.3038H11.9439C11.5502,13.27 11.2464,12.9663 11.2127,12.5725L10.8527,8.0725ZM12.9888,15.5076C12.9888,16.0543 12.5456,16.4976 11.9988,16.4976C11.452,16.4976 11.0088,16.0543 11.0088,15.5076C11.0088,14.9608 11.452,14.5176 11.9988,14.5176C12.5456,14.5176 12.9888,14.9608 12.9888,15.5076Z"
android:fillColor="#ffffff"

View File

@ -6,7 +6,7 @@
<path
android:strokeWidth="1"
android:pathData="M6.0995,11.4627C6.0611,11.4727 6.0278,11.481 6,11.4876C5.9722,11.481 5.9389,11.4727 5.9005,11.4627C5.768,11.4282 5.5757,11.3731 5.3437,11.2926C4.8779,11.1309 4.2608,10.8694 3.6475,10.4708C2.4272,9.6776 1.25,8.3665 1.25,6.2025V1.9121L6,0.521L10.75,1.9121V6.2025C10.75,8.3665 9.5728,9.6776 8.3525,10.4708C7.7392,10.8694 7.1221,11.1309 6.6563,11.2926C6.4243,11.3731 6.232,11.4282 6.0995,11.4627Z"
android:fillColor="@color/shield_color_warning"
android:fillColor="@color/shield_color_warning_sc"
android:strokeColor="#ffffff"/>
<path
android:pathData="M5.4263,4.0363C5.3982,3.7156 5.6345,3.4344 5.9551,3.4119C6.2701,3.3894 6.5513,3.6256 6.5851,3.9463V4.0363L6.4051,6.2863C6.3882,6.4944 6.2138,6.6519 6.0057,6.6519H5.972C5.7751,6.635 5.6232,6.4831 5.6063,6.2863L5.4263,4.0363ZM6.4944,7.7538C6.4944,8.0272 6.2728,8.2488 5.9994,8.2488C5.726,8.2488 5.5044,8.0272 5.5044,7.7538C5.5044,7.4804 5.726,7.2588 5.9994,7.2588C6.2728,7.2588 6.4944,7.4804 6.4944,7.7538Z"

View File

@ -5,7 +5,7 @@
android:viewportHeight="16">
<path
android:pathData="M8,8m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"
android:fillColor="#FF4B55"/>
android:fillColor="#E53935"/>
<path
android:pathData="M8,3L8,3A1,1 0,0 1,9 4L9,8A1,1 0,0 1,8 9L8,9A1,1 0,0 1,7 8L7,4A1,1 0,0 1,8 3z"
android:fillColor="#ffffff"/>