1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-11-26 23:33:31 -06:00

Fix button color in high priority admin message (#2202)

This commit is contained in:
Rafał Borcz 2023-05-12 22:45:24 +02:00 committed by GitHub
parent 030fe8c218
commit f2faa7e8b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 8 deletions

View File

@ -738,8 +738,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
val context = adminMessageViewHolder.binding.root.context val context = adminMessageViewHolder.binding.root.context
val (backgroundColor, textColor) = when (item.priority) { val (backgroundColor, textColor) = when (item.priority) {
"HIGH" -> { "HIGH" -> {
context.getThemeAttrColor(R.attr.colorPrimary) to context.getThemeAttrColor(R.attr.colorMessageHigh) to
context.getThemeAttrColor(R.attr.colorOnPrimary) context.getThemeAttrColor(R.attr.colorOnMessageHigh)
} }
"MEDIUM" -> { "MEDIUM" -> {
context.getThemeAttrColor(R.attr.colorMessageMedium) to Color.BLACK context.getThemeAttrColor(R.attr.colorMessageMedium) to Color.BLACK
@ -754,6 +754,7 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
dashboardAdminMessageItemDescription.setTextColor(textColor) dashboardAdminMessageItemDescription.setTextColor(textColor)
dashboardAdminMessageItemIcon.setColorFilter(textColor) dashboardAdminMessageItemIcon.setColorFilter(textColor)
dashboardAdminMessageItemDismiss.isVisible = item.isDismissible dashboardAdminMessageItemDismiss.isVisible = item.isDismissible
dashboardAdminMessageItemDismiss.setTextColor(textColor)
dashboardAdminMessageItemDismiss.setOnClickListener { dashboardAdminMessageItemDismiss.setOnClickListener {
onAdminMessageDismissClickListener(item) onAdminMessageDismissClickListener(item)
} }

View File

@ -35,7 +35,9 @@
<item name="colorError">@color/colorErrorLight</item> <item name="colorError">@color/colorErrorLight</item>
<item name="colorDivider">@color/colorDividerInverse</item> <item name="colorDivider">@color/colorDividerInverse</item>
<item name="colorSwipeRefresh">@color/material_dynamic_secondary20</item> <item name="colorSwipeRefresh">@color/material_dynamic_secondary20</item>
<item name="colorMessageMedium">@color/dashboard_message_medium_light</item> <item name="colorMessageMedium">@color/dashboard_message_medium_dark</item>
<item name="colorMessageHigh">@color/dashboard_message_high_dark</item>
<item name="colorOnMessageHigh">@android:color/black</item>
<item name="android:windowBackground">?colorSurface</item> <item name="android:windowBackground">?colorSurface</item>
<item name="android:textColor">@color/material_dynamic_neutral90</item> <item name="android:textColor">@color/material_dynamic_neutral90</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>

View File

@ -24,7 +24,9 @@
<item name="colorError">@color/colorErrorLight</item> <item name="colorError">@color/colorErrorLight</item>
<item name="colorDivider">@color/colorDividerInverse</item> <item name="colorDivider">@color/colorDividerInverse</item>
<item name="colorSwipeRefresh">@color/colorSwipeRefreshDark</item> <item name="colorSwipeRefresh">@color/colorSwipeRefreshDark</item>
<item name="colorMessageMedium">@color/dashboard_message_medium_light</item> <item name="colorMessageMedium">@color/dashboard_message_medium_dark</item>
<item name="colorMessageHigh">@color/dashboard_message_high_dark</item>
<item name="colorOnMessageHigh">@android:color/black</item>
<item name="android:windowBackground">?colorSurface</item> <item name="android:windowBackground">?colorSurface</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:navigationBarColor">@color/colorNavigationBarDark</item> <item name="android:navigationBarColor">@color/colorNavigationBarDark</item>

View File

@ -37,7 +37,9 @@
<item name="colorError">@color/colorError</item> <item name="colorError">@color/colorError</item>
<item name="colorDivider">@color/colorDivider</item> <item name="colorDivider">@color/colorDivider</item>
<item name="colorSwipeRefresh">@color/material_dynamic_secondary90</item> <item name="colorSwipeRefresh">@color/material_dynamic_secondary90</item>
<item name="colorMessageMedium">@color/dashboard_message_medium_dark</item> <item name="colorMessageMedium">@color/dashboard_message_medium_light</item>
<item name="colorMessageHigh">@color/dashboard_message_high_light</item>
<item name="colorOnMessageHigh">@android:color/white</item>
<item name="android:textColor">@color/material_dynamic_neutral10</item> <item name="android:textColor">@color/material_dynamic_neutral10</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>

View File

@ -5,4 +5,6 @@
<attr name="colorTimetableCanceled" format="color" /> <attr name="colorTimetableCanceled" format="color" />
<attr name="colorTimetableChange" format="color" /> <attr name="colorTimetableChange" format="color" />
<attr name="colorMessageMedium" format="color" /> <attr name="colorMessageMedium" format="color" />
<attr name="colorMessageHigh" format="color" />
<attr name="colorOnMessageHigh" format="color" />
</resources> </resources>

View File

@ -39,8 +39,10 @@
<color name="colorStatusBarDark">#342826</color> <color name="colorStatusBarDark">#342826</color>
<color name="colorStatusBarBlack">#181010</color> <color name="colorStatusBarBlack">#181010</color>
<color name="dashboard_message_medium_light">#FFD980</color> <color name="dashboard_message_medium_light">#ffd54f</color>
<color name="dashboard_message_medium_dark">#ffd54f</color> <color name="dashboard_message_medium_dark">#FFD980</color>
<color name="dashboard_message_high_light">#B91B21</color>
<color name="dashboard_message_high_dark">#e57373</color>
<color name="timetable_canceled_light">#d32f2f</color> <color name="timetable_canceled_light">#d32f2f</color>
<color name="timetable_canceled_dark">#e57373</color> <color name="timetable_canceled_dark">#e57373</color>

View File

@ -22,7 +22,9 @@
<item name="colorError">@color/colorError</item> <item name="colorError">@color/colorError</item>
<item name="colorDivider">@color/colorDivider</item> <item name="colorDivider">@color/colorDivider</item>
<item name="colorSwipeRefresh">@color/colorSwipeRefresh</item> <item name="colorSwipeRefresh">@color/colorSwipeRefresh</item>
<item name="colorMessageMedium">@color/dashboard_message_medium_dark</item> <item name="colorMessageMedium">@color/dashboard_message_medium_light</item>
<item name="colorMessageHigh">@color/dashboard_message_high_light</item>
<item name="colorOnMessageHigh">@android:color/white</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:statusBarColor">@android:color/black</item> <item name="android:statusBarColor">@android:color/black</item>
<item name="android:preferenceStyle">@style/PreferenceThemeOverlay</item> <item name="android:preferenceStyle">@style/PreferenceThemeOverlay</item>