mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-18 21:10:02 +03:00
Fix crash (regression on develop) on the VerificationVectorAlert
And format code
This commit is contained in:
parent
f313fbe88c
commit
58cd2aac13
3 changed files with 10 additions and 12 deletions
|
@ -40,8 +40,7 @@ class IncomingCallAlert(uid: String,
|
||||||
private val avatarRenderer: AvatarRenderer,
|
private val avatarRenderer: AvatarRenderer,
|
||||||
private val isVideoCall: Boolean,
|
private val isVideoCall: Boolean,
|
||||||
private val onAccept: () -> Unit,
|
private val onAccept: () -> Unit,
|
||||||
private val onReject: () -> Unit)
|
private val onReject: () -> Unit) : VectorAlert.ViewBinder {
|
||||||
: VectorAlert.ViewBinder {
|
|
||||||
|
|
||||||
override fun bind(view: View) {
|
override fun bind(view: View) {
|
||||||
val (callKindText, callKindIcon) = if (isVideoCall) {
|
val (callKindText, callKindIcon) = if (isVideoCall) {
|
||||||
|
|
|
@ -33,14 +33,11 @@ class VerificationVectorAlert(uid: String,
|
||||||
* Alert are displayed by default, but let this lambda return false to prevent displaying
|
* Alert are displayed by default, but let this lambda return false to prevent displaying
|
||||||
*/
|
*/
|
||||||
override val shouldBeDisplayedIn: ((Activity) -> Boolean) = { true }
|
override val shouldBeDisplayedIn: ((Activity) -> Boolean) = { true }
|
||||||
) : DefaultVectorAlert(
|
) : DefaultVectorAlert(uid, title, description, iconId, shouldBeDisplayedIn) {
|
||||||
uid, title, description, iconId, shouldBeDisplayedIn
|
|
||||||
) {
|
|
||||||
override val layoutRes = R.layout.alerter_verification_layout
|
override val layoutRes = R.layout.alerter_verification_layout
|
||||||
|
|
||||||
class ViewBinder(private val matrixItem: MatrixItem?,
|
class ViewBinder(private val matrixItem: MatrixItem?,
|
||||||
private val avatarRenderer: AvatarRenderer)
|
private val avatarRenderer: AvatarRenderer) : VectorAlert.ViewBinder {
|
||||||
: VectorAlert.ViewBinder {
|
|
||||||
|
|
||||||
override fun bind(view: View) {
|
override fun bind(view: View) {
|
||||||
view.findViewById<ImageView>(R.id.ivUserAvatar)?.let { imageView ->
|
view.findViewById<ImageView>(R.id.ivUserAvatar)?.let { imageView ->
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
tools:background="@android:color/darker_gray"
|
tools:background="?colorPrimary"
|
||||||
tools:foreground="?android:attr/selectableItemBackground"
|
|
||||||
tools:style="@style/AlertStyle">
|
tools:style="@style/AlertStyle">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -20,7 +19,8 @@
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:src="@sample/user_round_avatars" />
|
tools:src="@sample/user_round_avatars" />
|
||||||
|
|
||||||
<ImageView
|
<!-- Note: this is handled by the Alerter library, it has to be a AppCompatImageView -->
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/ivIcon"
|
android:id="@+id/ivIcon"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
|
@ -42,7 +42,8 @@
|
||||||
app:layout_constraintStart_toEndOf="@id/ivUserAvatar"
|
app:layout_constraintStart_toEndOf="@id/ivUserAvatar"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<TextView
|
<!-- Note: this is handled by the Alerter library, it has to be a AppCompatTextView -->
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tvTitle"
|
android:id="@+id/tvTitle"
|
||||||
style="@style/Widget.Vector.TextView.Subtitle"
|
style="@style/Widget.Vector.TextView.Subtitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -56,7 +57,8 @@
|
||||||
tools:text="Title"
|
tools:text="Title"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<!-- Note: this is handled by the Alerter library, it has to be a AppCompatTextView -->
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tvText"
|
android:id="@+id/tvText"
|
||||||
style="@style/Widget.Vector.TextView.Body"
|
style="@style/Widget.Vector.TextView.Body"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
Loading…
Add table
Reference in a new issue