From 1b8874e8cb8757a8f6fccd4653c2c4294d883780 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Fri, 10 Sep 2021 11:55:24 +0200 Subject: [PATCH] Expose and theme some upstream colors concerning video conferences Change-Id: I8ed960c119c2b87a9e8af0bce60bbf60034f5a61 --- library/ui-styles/src/main/res/values/attrs_sc.xml | 3 +++ library/ui-styles/src/main/res/values/theme_dark.xml | 3 +++ library/ui-styles/src/main/res/values/theme_light.xml | 3 +++ library/ui-styles/src/main/res/values/theme_sc.xml | 3 +++ library/ui-styles/src/main/res/values/theme_sc_light.xml | 3 +++ post_merge.sh | 1 + .../im/vector/app/core/ui/views/JoinConferenceView.kt | 6 +++--- vector/src/main/res/layout/activity_call.xml | 8 ++++---- .../res/layout/item_timeline_event_call_tile_stub.xml | 1 + vector/src/main/res/layout/view_join_conference.xml | 2 +- 10 files changed, 25 insertions(+), 8 deletions(-) diff --git a/library/ui-styles/src/main/res/values/attrs_sc.xml b/library/ui-styles/src/main/res/values/attrs_sc.xml index 996eddae65..c758752713 100644 --- a/library/ui-styles/src/main/res/values/attrs_sc.xml +++ b/library/ui-styles/src/main/res/values/attrs_sc.xml @@ -7,6 +7,7 @@ + @@ -28,6 +29,8 @@ + + diff --git a/library/ui-styles/src/main/res/values/theme_dark.xml b/library/ui-styles/src/main/res/values/theme_dark.xml index 4068884235..da6b380673 100644 --- a/library/ui-styles/src/main/res/values/theme_dark.xml +++ b/library/ui-styles/src/main/res/values/theme_dark.xml @@ -135,6 +135,9 @@ @color/user_color_element_pl_100 ?vctr_content_quinary ?vctr_notice_secondary + @color/element_background_light + @color/palette_element_green + @color/join_conference_animated_color @color/android_status_bar_background_dark @color/android_navigation_bar_background_dark diff --git a/library/ui-styles/src/main/res/values/theme_light.xml b/library/ui-styles/src/main/res/values/theme_light.xml index f10a9b0909..0b7fa6b33b 100644 --- a/library/ui-styles/src/main/res/values/theme_light.xml +++ b/library/ui-styles/src/main/res/values/theme_light.xml @@ -135,6 +135,9 @@ @color/user_color_element_pl_100 ?vctr_content_quinary ?vctr_notice_secondary + @color/element_background_light + @color/palette_element_green + @color/join_conference_animated_color @color/android_status_bar_background_dark diff --git a/library/ui-styles/src/main/res/values/theme_sc.xml b/library/ui-styles/src/main/res/values/theme_sc.xml index 264e1d817d..5dfaa8b597 100644 --- a/library/ui-styles/src/main/res/values/theme_sc.xml +++ b/library/ui-styles/src/main/res/values/theme_sc.xml @@ -97,6 +97,9 @@ @color/user_color_sc_pl_100 #1fffffff ?colorBackgroundFloating + @color/background_sc_light + ?colorAccent + ?colorAccentPale @color/background_black_sc @color/background_black_sc diff --git a/library/ui-styles/src/main/res/values/theme_sc_light.xml b/library/ui-styles/src/main/res/values/theme_sc_light.xml index d28addcb40..a146e593cb 100644 --- a/library/ui-styles/src/main/res/values/theme_sc_light.xml +++ b/library/ui-styles/src/main/res/values/theme_sc_light.xml @@ -96,6 +96,9 @@ @color/user_color_sc_pl_95 @color/user_color_sc_pl_100 #1f000000 + @color/background_sc_light + ?colorAccent + ?colorAccentPale @color/background_black_sc @color/background_black_sc diff --git a/post_merge.sh b/post_merge.sh index bc711e8797..691905a1ee 100755 --- a/post_merge.sh +++ b/post_merge.sh @@ -11,6 +11,7 @@ require_clean_git # Color corrections | TODO more? 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/* uncommitted=`git status --porcelain` if [ -z "$uncommitted" ]; then echo "Seems like colors are still fine :)" diff --git a/vector/src/main/java/im/vector/app/core/ui/views/JoinConferenceView.kt b/vector/src/main/java/im/vector/app/core/ui/views/JoinConferenceView.kt index fa1e2c1403..ab05ee761a 100644 --- a/vector/src/main/java/im/vector/app/core/ui/views/JoinConferenceView.kt +++ b/vector/src/main/java/im/vector/app/core/ui/views/JoinConferenceView.kt @@ -23,9 +23,9 @@ import android.annotation.SuppressLint import android.content.Context import android.util.AttributeSet import android.widget.FrameLayout -import androidx.core.content.ContextCompat import im.vector.app.R import im.vector.app.databinding.ViewJoinConferenceBinding +import im.vector.app.features.themes.ThemeUtils class JoinConferenceView @JvmOverloads constructor( context: Context, @@ -46,8 +46,8 @@ class JoinConferenceView @JvmOverloads constructor( super.onAttachedToWindow() views = ViewJoinConferenceBinding.bind(this) views?.joinConferenceButton?.setOnClickListener { onJoinClicked?.invoke() } - val colorFrom = ContextCompat.getColor(context, R.color.palette_element_green) - val colorTo = ContextCompat.getColor(context, R.color.join_conference_animated_color) + val colorFrom = ThemeUtils.getColor(context, R.attr.conference_animation_from) + val colorTo = ThemeUtils.getColor(context, R.attr.conference_animation_to) // Animate button color to highlight backgroundAnimator = ValueAnimator.ofObject(ArgbEvaluator(), colorFrom, colorTo).apply { repeatMode = ValueAnimator.REVERSE diff --git a/vector/src/main/res/layout/activity_call.xml b/vector/src/main/res/layout/activity_call.xml index 342ae11562..0b27f22973 100644 --- a/vector/src/main/res/layout/activity_call.xml +++ b/vector/src/main/res/layout/activity_call.xml @@ -63,7 +63,7 @@ android:layout_height="@dimen/call_pip_height" android:layout_marginStart="16dp" android:layout_marginEnd="16dp" - android:background="@color/element_background_light" + android:background="?backgroundColorLight" android:foreground="?attr/selectableItemBackground" android:visibility="gone" app:cardBackgroundColor="@color/bg_call_screen" @@ -105,14 +105,14 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:navigationIcon="@drawable/ic_back_24dp" - app:navigationIconTint="@color/element_background_light" + app:navigationIconTint="?backgroundColorLight" app:subtitle="3:10" app:subtitleTextAppearance="@style/TextAppearance.Vector.Caption" - app:subtitleTextColor="@color/element_background_light" + app:subtitleTextColor="?backgroundColorLight" app:title="Video call" app:titleMarginTop="16dp" app:titleTextAppearance="@style/TextAppearance.Vector.Body.Medium" - app:titleTextColor="@color/element_background_light" /> + app:titleTextColor="?backgroundColorLight" /> diff --git a/vector/src/main/res/layout/view_join_conference.xml b/vector/src/main/res/layout/view_join_conference.xml index c47eddc18f..703dee26fe 100644 --- a/vector/src/main/res/layout/view_join_conference.xml +++ b/vector/src/main/res/layout/view_join_conference.xml @@ -16,6 +16,6 @@ app:icon="@drawable/ic_call_video_small" app:iconGravity="textStart" app:iconPadding="0dp" - app:iconTint="@color/element_background_light" /> + app:iconTint="?backgroundColorLight" /> \ No newline at end of file