From 58cd2aac139c4f496eee9178abad667e8fe568dc Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 16 Jun 2021 16:45:50 +0200 Subject: [PATCH] Fix crash (regression on develop) on the VerificationVectorAlert And format code --- .../vector/app/features/popup/IncomingCallAlert.kt | 3 +-- .../app/features/popup/VerificationVectorAlert.kt | 7 ++----- .../main/res/layout/alerter_verification_layout.xml | 12 +++++++----- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/popup/IncomingCallAlert.kt b/vector/src/main/java/im/vector/app/features/popup/IncomingCallAlert.kt index 8a4fc7a78d..fe9b0c86b9 100644 --- a/vector/src/main/java/im/vector/app/features/popup/IncomingCallAlert.kt +++ b/vector/src/main/java/im/vector/app/features/popup/IncomingCallAlert.kt @@ -40,8 +40,7 @@ class IncomingCallAlert(uid: String, private val avatarRenderer: AvatarRenderer, private val isVideoCall: Boolean, private val onAccept: () -> Unit, - private val onReject: () -> Unit) - : VectorAlert.ViewBinder { + private val onReject: () -> Unit) : VectorAlert.ViewBinder { override fun bind(view: View) { val (callKindText, callKindIcon) = if (isVideoCall) { diff --git a/vector/src/main/java/im/vector/app/features/popup/VerificationVectorAlert.kt b/vector/src/main/java/im/vector/app/features/popup/VerificationVectorAlert.kt index ee6728f969..70663ec58d 100644 --- a/vector/src/main/java/im/vector/app/features/popup/VerificationVectorAlert.kt +++ b/vector/src/main/java/im/vector/app/features/popup/VerificationVectorAlert.kt @@ -33,14 +33,11 @@ class VerificationVectorAlert(uid: String, * Alert are displayed by default, but let this lambda return false to prevent displaying */ override val shouldBeDisplayedIn: ((Activity) -> Boolean) = { true } -) : DefaultVectorAlert( - uid, title, description, iconId, shouldBeDisplayedIn -) { +) : DefaultVectorAlert(uid, title, description, iconId, shouldBeDisplayedIn) { override val layoutRes = R.layout.alerter_verification_layout class ViewBinder(private val matrixItem: MatrixItem?, - private val avatarRenderer: AvatarRenderer) - : VectorAlert.ViewBinder { + private val avatarRenderer: AvatarRenderer) : VectorAlert.ViewBinder { override fun bind(view: View) { view.findViewById(R.id.ivUserAvatar)?.let { imageView -> diff --git a/vector/src/main/res/layout/alerter_verification_layout.xml b/vector/src/main/res/layout/alerter_verification_layout.xml index 482dc738cb..5da9102e1e 100644 --- a/vector/src/main/res/layout/alerter_verification_layout.xml +++ b/vector/src/main/res/layout/alerter_verification_layout.xml @@ -5,8 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" - tools:background="@android:color/darker_gray" - tools:foreground="?android:attr/selectableItemBackground" + tools:background="?colorPrimary" tools:style="@style/AlertStyle"> - + - + - +