Fix color for phone calls

This commit is contained in:
Benoit Marty 2021-06-16 17:16:47 +02:00
parent 9b215d2df6
commit 7a40841cbb
3 changed files with 19 additions and 6 deletions

View file

@ -43,10 +43,10 @@ class IncomingCallAlert(uid: String,
private val onReject: () -> Unit) : VectorAlert.ViewBinder {
override fun bind(view: View) {
val (callKindText, callKindIcon) = if (isVideoCall) {
Pair(R.string.action_video_call, R.drawable.ic_call_video_small)
val (callKindText, callKindIcon, callKindActionIcon) = if (isVideoCall) {
Triple(R.string.action_video_call, R.drawable.ic_call_video_small, R.drawable.ic_call_answer_video)
} else {
Pair(R.string.action_voice_call, R.drawable.ic_call_audio_small)
Triple(R.string.action_voice_call, R.drawable.ic_call_audio_small, R.drawable.ic_call_answer)
}
view.findViewById<TextView>(R.id.incomingCallKindView).apply {
setText(callKindText)
@ -60,7 +60,7 @@ class IncomingCallAlert(uid: String,
setOnClickListener {
onAccept()
}
setImageResource(callKindIcon)
setImageResource(callKindActionIcon)
}
view.findViewById<ImageView>(R.id.incomingCallRejectView).setOnClickListener {
onReject()

View file

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="25dp"
android:height="25dp"
android:viewportWidth="25"
android:viewportHeight="25">
<path
android:pathData="M0.5,7.5C0.5,5.8432 1.8432,4.5 3.5,4.5H14.5C16.1569,4.5 17.5,5.8432 17.5,7.5V17.5C17.5,19.1569 16.1569,20.5 14.5,20.5H3.5C1.8432,20.5 0.5,19.1569 0.5,17.5V7.5Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M19.5,9.5L22.8753,6.7998C23.5301,6.2759 24.5,6.7421 24.5,7.5806V17.4194C24.5,18.2579 23.5301,18.7241 22.8753,18.2002L19.5,15.5V9.5Z"
android:fillColor="#FFFFFF"/>
</vector>

View file

@ -51,6 +51,7 @@
app:layout_constraintEnd_toStartOf="@+id/incomingCallRejectView"
app:layout_constraintStart_toStartOf="@id/incomingCallNameView"
app:layout_constraintTop_toBottomOf="@id/incomingCallNameView"
tools:drawableStart="@drawable/ic_call_audio_small"
tools:text="@string/action_voice_call" />
<ImageView
@ -64,12 +65,12 @@
android:contentDescription="@string/call_notification_answer"
android:focusable="true"
android:padding="8dp"
android:src="@drawable/ic_call_answer"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="?colorOnPrimary"
tools:ignore="MissingPrefix" />
tools:ignore="MissingPrefix"
tools:src="@drawable/ic_call_answer" />
<ImageView
android:id="@+id/incomingCallRejectView"