Expose and theme some upstream colors concerning video conferences

Change-Id: I8ed960c119c2b87a9e8af0bce60bbf60034f5a61
This commit is contained in:
SpiritCroc 2021-09-10 11:55:24 +02:00
parent dc2f9f883e
commit 1b8874e8cb
10 changed files with 25 additions and 8 deletions

View File

@ -7,6 +7,7 @@
<attr name="sc_message_bg_outgoing" format="color" />
<attr name="colorAccentPale" format="color" />
<attr name="backgroundColorLight" format="color" />
<attr name="riotx_unread_unimportant_room_badge" format="color" />
@ -28,6 +29,8 @@
<attr name="user_color_pl_0" format="color" />
<attr name="verification_request_background" format="color" />
<attr name="conference_animation_from" format="color" />
<attr name="conference_animation_to" format="color" />
</declare-styleable>

View File

@ -135,6 +135,9 @@
<item name="user_color_pl_100">@color/user_color_element_pl_100</item>
<item name="voice_message_playback_background_color">?vctr_content_quinary</item>
<item name="verification_request_background">?vctr_notice_secondary</item>
<item name="backgroundColorLight">@color/element_background_light</item>
<item name="conference_animation_from">@color/palette_element_green</item>
<item name="conference_animation_to">@color/join_conference_animated_color</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

@ -135,6 +135,9 @@
<item name="user_color_pl_100">@color/user_color_element_pl_100</item>
<item name="voice_message_playback_background_color">?vctr_content_quinary</item>
<item name="verification_request_background">?vctr_notice_secondary</item>
<item name="backgroundColorLight">@color/element_background_light</item>
<item name="conference_animation_from">@color/palette_element_green</item>
<item name="conference_animation_to">@color/join_conference_animated_color</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

@ -97,6 +97,9 @@
<item name="user_color_pl_100">@color/user_color_sc_pl_100</item>
<item name="voice_message_playback_background_color">#1fffffff</item>
<item name="verification_request_background">?colorBackgroundFloating</item>
<item name="backgroundColorLight">@color/background_sc_light</item>
<item name="conference_animation_from">?colorAccent</item>
<item name="conference_animation_to">?colorAccentPale</item>
<item name="android:statusBarColor">@color/background_black_sc</item>
<item name="android:navigationBarColor">@color/background_black_sc</item>

View File

@ -96,6 +96,9 @@
<item name="user_color_pl_95">@color/user_color_sc_pl_95</item>
<item name="user_color_pl_100">@color/user_color_sc_pl_100</item>
<item name="voice_message_playback_background_color">#1f000000</item>
<item name="backgroundColorLight">@color/background_sc_light</item>
<item name="conference_animation_from">?colorAccent</item>
<item name="conference_animation_to">?colorAccentPale</item>
<item name="android:statusBarColor">@color/background_black_sc</item>
<item name="android:navigationBarColor">@color/background_black_sc</item>

View File

@ -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 :)"

View File

@ -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

View File

@ -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" />
<ImageView
android:id="@+id/otherMemberAvatar"

View File

@ -41,6 +41,7 @@
android:textColor="?vctr_content_secondary"
android:maxLines="3"
android:drawablePadding="8dp"
app:drawableTint="?vctr_content_secondary"
tools:drawableLeft="@drawable/ic_missed_video_call"
tools:text="@string/call_tile_video_incoming" />

View File

@ -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" />
</merge>