Factorized avatar + presence & trust badges

This commit is contained in:
Sylvain Berfini 2024-03-13 09:58:04 +01:00
parent d023519cd8
commit 8226f6e1b3
52 changed files with 580 additions and 865 deletions

View file

@ -1,6 +1,7 @@
package org.linphone.contacts
import androidx.lifecycle.MutableLiveData
import org.linphone.core.ConsolidatedPresence
import org.linphone.core.SecurityLevel
abstract class AbstractAvatarModel {
@ -21,4 +22,6 @@ abstract class AbstractAvatarModel {
val defaultToConferenceIcon = MutableLiveData<Boolean>()
val skipInitials = MutableLiveData<Boolean>()
val presenceStatus = MutableLiveData<ConsolidatedPresence>()
}

View file

@ -42,6 +42,7 @@ import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.linphone.LinphoneApplication.Companion.coreContext
import org.linphone.core.Account
import org.linphone.core.Address
import org.linphone.core.ConferenceInfo
import org.linphone.core.Core
@ -134,6 +135,21 @@ class ContactsManager @UiThread constructor() {
Log.i("$TAG Friend list [${friendList.displayName}] removed")
friendList.removeListener(friendListListener)
}
@WorkerThread
override fun onDefaultAccountChanged(core: Core, account: Account?) {
Log.i("$TAG Default account changed, update all contact models showTrust value")
val showTrust = account?.isInSecureMode()
knownContactsAvatarsMap.forEach { (_, contactAvatarModel) ->
contactAvatarModel.showTrust.postValue(showTrust)
}
unknownContactsAvatarsMap.forEach { (_, contactAvatarModel) ->
contactAvatarModel.showTrust.postValue(showTrust)
}
conferenceAvatarMap.forEach { (_, contactAvatarModel) ->
contactAvatarModel.showTrust.postValue(showTrust)
}
}
}
@MainThread

View file

@ -48,8 +48,6 @@ class ContactAvatarModel @WorkerThread constructor(val friend: Friend, val addre
val lastPresenceInfo = MutableLiveData<String>()
val presenceStatus = MutableLiveData<ConsolidatedPresence>()
val name = MutableLiveData<String>()
val firstLetter: String = AppUtils.getFirstLetter(friend.name.orEmpty())

View file

@ -30,6 +30,7 @@ import org.linphone.core.Account
import org.linphone.core.AccountListenerStub
import org.linphone.core.ChatMessage
import org.linphone.core.ChatRoom
import org.linphone.core.ConsolidatedPresence
import org.linphone.core.Core
import org.linphone.core.CoreListenerStub
import org.linphone.core.RegistrationState
@ -96,6 +97,7 @@ class AccountModel @WorkerThread constructor(
trust.postValue(SecurityLevel.EndToEndEncryptedAndVerified)
showTrust.postValue(account.isInSecureMode())
presenceStatus.postValue(ConsolidatedPresence.Offline)
update()
}

View file

@ -54,14 +54,13 @@ import coil.dispose
import coil.load
import coil.request.videoFrameMillis
import coil.size.Dimension
import coil.transform.CircleCropTransformation
import coil.transform.RoundedCornersTransformation
import com.google.android.material.imageview.ShapeableImageView
import org.linphone.BR
import org.linphone.R
import org.linphone.contacts.AbstractAvatarModel
import org.linphone.contacts.AvatarGenerator
import org.linphone.core.ConsolidatedPresence
import org.linphone.core.SecurityLevel
import org.linphone.core.tools.Log
import org.linphone.ui.call.model.ConferenceParticipantDeviceModel
@ -310,7 +309,7 @@ fun ImageView.startAnimatedDrawable(start: Boolean = true) {
@UiThread
@BindingAdapter("coil")
fun ShapeableImageView.loadCircleFileWithCoil(file: String?) {
fun ImageView.loadCircleFileWithCoil(file: String?) {
if (file != null) {
load(file)
}
@ -318,19 +317,13 @@ fun ShapeableImageView.loadCircleFileWithCoil(file: String?) {
@UiThread
@BindingAdapter("coilAvatar")
fun ShapeableImageView.loadAvatarWithCoil(model: AbstractAvatarModel?) {
fun ImageView.loadAvatarWithCoil(model: AbstractAvatarModel?) {
loadContactPictureWithCoil(this, model)
}
@UiThread
@BindingAdapter("coilAvatarNoTrust")
fun ShapeableImageView.loadAvatarWithCoilWithoutTrust(model: AbstractAvatarModel?) {
loadContactPictureWithCoil(this, model, skipTrust = true)
}
@UiThread
@BindingAdapter("coilBubbleAvatar")
fun ShapeableImageView.loadBubbleAvatarWithCoil(model: AbstractAvatarModel?) {
fun ImageView.loadBubbleAvatarWithCoil(model: AbstractAvatarModel?) {
val size = R.dimen.avatar_bubble_size
val initialsSize = R.dimen.avatar_initials_bubble_text_size
loadContactPictureWithCoil(this, model, size = size, textSize = initialsSize)
@ -338,15 +331,15 @@ fun ShapeableImageView.loadBubbleAvatarWithCoil(model: AbstractAvatarModel?) {
@UiThread
@BindingAdapter("coilBigAvatar")
fun ShapeableImageView.loadBigAvatarWithCoil(model: AbstractAvatarModel?) {
fun ImageView.loadBigAvatarWithCoil(model: AbstractAvatarModel?) {
val size = R.dimen.avatar_big_size
val initialsSize = R.dimen.avatar_initials_big_text_size
loadContactPictureWithCoil(this, model, size = size, textSize = initialsSize)
}
@UiThread
@BindingAdapter("coilCallAvatar")
fun ShapeableImageView.loadCallAvatarWithCoil(model: AbstractAvatarModel?) {
@BindingAdapter("coilHugeAvatar")
fun ImageView.loadCallAvatarWithCoil(model: AbstractAvatarModel?) {
val size = R.dimen.avatar_in_call_size
val initialsSize = R.dimen.avatar_initials_call_text_size
loadContactPictureWithCoil(this, model, size = size, textSize = initialsSize)
@ -354,7 +347,7 @@ fun ShapeableImageView.loadCallAvatarWithCoil(model: AbstractAvatarModel?) {
@UiThread
@BindingAdapter("coilInitials")
fun ShapeableImageView.loadInitialsAvatarWithCoil(initials: String?) {
fun ImageView.loadInitialsAvatarWithCoil(initials: String?) {
val builder = AvatarGenerator(context)
builder.setInitials(initials.orEmpty())
load(builder.build())
@ -362,11 +355,10 @@ fun ShapeableImageView.loadInitialsAvatarWithCoil(initials: String?) {
@SuppressLint("ResourceType")
private fun loadContactPictureWithCoil(
imageView: ShapeableImageView,
imageView: ImageView,
model: AbstractAvatarModel?,
@DimenRes size: Int = 0,
@DimenRes textSize: Int = 0,
skipTrust: Boolean = false
@DimenRes textSize: Int = 0
) {
imageView.dispose()
@ -380,36 +372,13 @@ private fun loadContactPictureWithCoil(
return
}
if (!skipTrust) {
if (model.showTrust.value == true) {
when (model.trust.value) {
SecurityLevel.EndToEndEncryptedAndVerified -> {
imageView.setStrokeColorResource(R.color.info_500)
imageView.setStrokeWidthResource(R.dimen.avatar_trust_border_width)
}
SecurityLevel.Unsafe -> {
imageView.setStrokeColorResource(R.color.danger_500)
imageView.setStrokeWidthResource(R.dimen.avatar_trust_border_width)
}
else -> {
imageView.setStrokeColorResource(R.color.transparent_color)
imageView.setStrokeWidthResource(R.dimen.zero)
}
}
} else {
imageView.setStrokeColorResource(R.color.transparent_color)
imageView.setStrokeWidthResource(R.dimen.zero)
}
}
val images = model.images.value.orEmpty()
val count = images.size
if (count == 1) {
val image = images.firstOrNull()
if (image != null) {
imageView.load(image) {
transformations(CircleCropTransformation())
listener(
onError = { _, _ ->
imageView.load(getErrorImageLoader(context, model, size, textSize))
@ -426,7 +395,9 @@ private fun loadContactPictureWithCoil(
AppUtils.getDimension(R.dimen.avatar_list_cell_size).toInt()
}
val bitmap = ImageUtils.getBitmapFromMultipleAvatars(imageView.context, w, images)
imageView.load(bitmap)
imageView.load(bitmap) {
transformations(CircleCropTransformation())
}
}
} else {
imageView.load(R.drawable.smiley)

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<size android:width="120dp" android:height="120dp" />
<stroke android:color="?attr/color_info_500" android:width="@dimen/avatar_trust_border_width" />
</shape>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<size android:width="120dp" android:height="120dp" />
<stroke android:color="?attr/color_danger_500" android:width="@dimen/avatar_trust_border_width" />
</shape>

View file

@ -66,7 +66,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.imageview.ShapeableImageView
<ImageView
style="@style/avatar_imageview"
android:onClick="@{pickImageClickListener}"
android:id="@+id/avatar"

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
@ -76,16 +77,16 @@
app:layout_constraintEnd_toEndOf="@id/video_preview"
app:layout_constraintBottom_toBottomOf="@id/video_preview" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_in_call_size"
android:layout_height="@dimen/avatar_in_call_size"
coilCallAvatar="@{viewModel.selfAvatar}"
layout="@layout/contact_avatar_huge"
bind:model="@{viewModel.selfAvatar}"
app:layout_constraintEnd_toEndOf="@id/no_video_background"
app:layout_constraintStart_toStartOf="@id/no_video_background"
app:layout_constraintTop_toTopOf="@id/no_video_background"
app:layout_constraintBottom_toBottomOf="@id/no_video_background"/>
app:layout_constraintBottom_toBottomOf="@id/no_video_background" />
<org.linphone.ui.call.view.RoundCornersTextureView
android:id="@+id/video_preview"

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
@ -25,29 +25,19 @@
app:barrierDirection="right"
app:constraint_referenced_ids="name, register_status" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model}"
layout="@layout/contact_avatar"
bind:model="@{model}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@drawable/trusted"
android:visibility="@{model.showTrust ? View.VISIBLE : View.GONE}"
android:contentDescription="@null"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="backClickListener"
type="View.OnClickListener" />
@ -93,28 +92,18 @@
app:constraint_referenced_ids="mode_background, current_mode, change_mode"
android:visibility="@{viewModel.showModeSelection ? View.VISIBLE : View.GONE}" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
android:onClick="@{pickImageClickListener}"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_big_size"
android:layout_height="@dimen/avatar_big_size"
android:onClick="@{pickImageClickListener}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
coilAvatar="@{viewModel.accountModel}"
layout="@layout/contact_avatar_big"
bind:model="@{viewModel.accountModel}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/avatar_trust_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginStart="@dimen/avatar_presence_badge_big_end_margin"
android:src="@{viewModel.accountModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.accountModel.showTrust ? View.VISIBLE : View.GONE}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{pickImageClickListener}"
style="@style/default_text_style"

View file

@ -128,86 +128,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
android:id="@+id/image1"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp"
android:visibility="gone"
coilAvatarNoTrust="@{viewModel.accountModel}"
app:strokeWidth="0dp"
app:strokeColor="@color/transparent_color"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/arrow"
app:layout_constraintTop_toBottomOf="@id/default_mode_summary"/>
<ImageView
android:id="@+id/image1_presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
android:src="@drawable/led_online"
android:visibility="gone"
android:contentDescription="@null"
app:layout_constraintEnd_toEndOf="@id/image1"
app:layout_constraintBottom_toBottomOf="@id/image1"/>
<ImageView
android:id="@+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/arrow_right_fill"
app:tint="@color/black"
android:visibility="gone"
android:contentDescription="@null"
app:layout_constraintStart_toEndOf="@id/image1"
app:layout_constraintEnd_toStartOf="@id/image2"
app:layout_constraintTop_toTopOf="@id/image1"
app:layout_constraintBottom_toBottomOf="@id/image1"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
android:id="@+id/image2"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:visibility="gone"
coilAvatarNoTrust="@{viewModel.accountModel}"
app:strokeWidth="@dimen/avatar_trust_border_width"
app:strokeColor="?attr/color_info_500"
app:layout_constraintStart_toEndOf="@id/arrow"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/image1"
app:layout_constraintBottom_toBottomOf="@id/image1"/>
<ImageView
android:id="@+id/image2_trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@drawable/trusted"
android:visibility="gone"
android:contentDescription="@null"
app:layout_constraintStart_toStartOf="@id/image2"
app:layout_constraintBottom_toBottomOf="@id/image2"/>
<ImageView
android:id="@+id/image2_presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
android:src="@drawable/led_online"
android:visibility="gone"
android:contentDescription="@null"
app:layout_constraintEnd_toEndOf="@id/image2"
app:layout_constraintBottom_toBottomOf="@id/image2"/>
<View
android:id="@+id/interop_mode_background"
android:layout_width="0dp"
@ -233,7 +153,7 @@
android:enabled="@{viewModel.isCurrentlySelectedModeSecure}"
app:useMaterialThemeColors="false"
app:buttonTint="?attr/color_main1_500"
app:layout_constraintTop_toBottomOf="@id/image1"
app:layout_constraintTop_toBottomOf="@id/default_mode_summary"
app:layout_constraintStart_toStartOf="parent" />
<ImageView

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.model.SelectedAddressModel" />
@ -18,39 +16,17 @@
android:padding="5dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:onClick="@{() -> model.removeFromSelection()}"
android:layout_width="@dimen/avatar_favorite_list_cell_size"
android:layout_height="@dimen/avatar_favorite_list_cell_size"
coilAvatar="@{model.avatarModel}"
app:layout_constraintStart_toStartOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/contact_avatar_medium"
bind:model="@{model.avatarModel}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
android:visibility="@{model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/remove_from_selection"
android:onClick="@{() -> model.removeFromSelection()}"

View file

@ -135,82 +135,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image1"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:adjustViewBounds="true"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp"
android:background="@drawable/shape_circle_light_blue_background"
android:src="@drawable/user_circle"
coilInitials="@{`JD`}"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/arrow"
app:layout_constraintTop_toBottomOf="@id/default_mode_summary"/>
<ImageView
android:id="@+id/image1_presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
android:src="@drawable/led_online"
android:contentDescription="@null"
app:layout_constraintEnd_toEndOf="@id/image1"
app:layout_constraintBottom_toBottomOf="@id/image1"/>
<ImageView
android:id="@+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/arrow_right_fill"
android:contentDescription="@null"
app:tint="@color/black"
app:layout_constraintStart_toEndOf="@id/image1"
app:layout_constraintEnd_toStartOf="@id/image2"
app:layout_constraintTop_toTopOf="@id/image1"
app:layout_constraintBottom_toBottomOf="@id/image1"/>
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image2"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:adjustViewBounds="true"
android:background="@drawable/shape_circle_light_blue_background"
android:src="@drawable/user_circle"
coilInitials="@{`JD`}"
app:strokeWidth="@dimen/avatar_trust_border_width"
app:strokeColor="?attr/color_info_500"
app:layout_constraintStart_toEndOf="@id/arrow"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/image1"
app:layout_constraintBottom_toBottomOf="@id/image1"/>
<ImageView
android:id="@+id/image2_trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@drawable/trusted"
android:contentDescription="@null"
app:layout_constraintStart_toStartOf="@id/image2"
app:layout_constraintBottom_toBottomOf="@id/image2"/>
<ImageView
android:id="@+id/image2_presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
android:src="@drawable/led_online"
android:contentDescription="@null"
app:layout_constraintEnd_toEndOf="@id/image2"
app:layout_constraintBottom_toBottomOf="@id/image2"/>
<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/interop_mode"
style="@style/default_text_style_800"
@ -226,7 +150,7 @@
android:enabled="@{viewModel.isCurrentlySelectedModeSecure}"
app:useMaterialThemeColors="false"
app:buttonTint="?attr/color_main1_500"
app:layout_constraintTop_toBottomOf="@id/image1"
app:layout_constraintTop_toBottomOf="@id/default_mode_summary"
app:layout_constraintStart_toStartOf="parent" />
<ImageView

View file

@ -5,7 +5,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<import type="org.linphone.ui.call.model.ConferenceModel" />
<variable
name="backClickListener"

View file

@ -5,7 +5,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="backClickListener"
type="View.OnClickListener" />
@ -56,12 +55,12 @@
android:orientation="horizontal"
app:layout_constraintGuide_percent="1" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="0dp"
android:layout_height="0dp"
coilCallAvatar="@{viewModel.contact}"
layout="@layout/contact_avatar_huge"
bind:model="@{viewModel.contact}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintWidth_max="@dimen/avatar_in_call_size"
app:layout_constraintHeight_max="@dimen/avatar_in_call_size"
@ -69,17 +68,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/media_encryption_icon"
app:layout_constraintBottom_toTopOf="@id/display_name"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_in_call_size"
android:layout_height="@dimen/avatar_presence_badge_in_call_size"
android:src="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.contact.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintBottom_toTopOf="@id/display_name" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_300"

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.call.model.ConferenceParticipantDeviceModel" />
@ -23,31 +23,18 @@
android:contentDescription="@null"
android:background="@drawable/shape_round_in_call_cell_gray_background" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:visibility="@{model.isSendingVideo || model.isJoining || !model.isInConference ? View.GONE : View.VISIBLE}"
coilCallAvatar="@{model.avatarModel}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintWidth_max="@dimen/avatar_in_active_speaker_miniature_conference_call_size"
app:layout_constraintHeight_max="@dimen/avatar_in_active_speaker_miniature_conference_call_size"
layout="@layout/contact_avatar_medium"
bind:model="@{model.avatarModel}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_in_active_speaker_miniature_conference_call_size"
android:layout_height="@dimen/avatar_presence_badge_in_active_speaker_miniature_conference_call_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintBottom_toBottomOf="parent" />
<org.linphone.ui.call.view.RoundCornersTextureView
android:id="@+id/participant_video_surface"

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<import type="org.linphone.ui.call.model.ConferenceModel" />
<variable
name="viewModel"
@ -20,13 +20,13 @@
android:layout_height="match_parent"
android:background="@color/gray_900">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="0dp"
android:layout_height="0dp"
layout="@layout/contact_avatar_huge"
android:layout_marginTop="5dp"
coilCallAvatar="@{conferenceViewModel.activeSpeaker.avatarModel}"
bind:model="@{conferenceViewModel.activeSpeaker.avatarModel}"
android:visibility="@{conferenceViewModel.activeSpeaker.isSendingVideo || conferenceViewModel.activeSpeaker.isJoining || !conferenceViewModel.activeSpeaker.isInConference ? View.GONE : View.VISIBLE}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintWidth_max="@dimen/avatar_in_call_size"
@ -35,7 +35,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
app:layout_constraintBottom_toBottomOf="parent" />
<org.linphone.ui.call.view.RoundCornersTextureView
android:id="@+id/active_speaker_surface"

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.call.model.ConferenceParticipantDeviceModel" />
@ -26,29 +26,16 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
coilCallAvatar="@{model.avatarModel}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintWidth_max="@dimen/avatar_list_cell_size"
app:layout_constraintHeight_max="@dimen/avatar_list_cell_size"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintBottom_toBottomOf="parent" />
<ImageView
android:id="@+id/muted"

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.call.model.ConferenceParticipantDeviceModel" />
@ -23,31 +23,18 @@
android:contentDescription="@null"
android:background="@drawable/shape_round_in_call_cell_gray_background" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:visibility="@{model.isSendingVideo || model.isJoining || !model.isInConference ? View.GONE : View.VISIBLE}"
coilCallAvatar="@{model.avatarModel}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintWidth_max="@dimen/avatar_in_call_size"
app:layout_constraintHeight_max="@dimen/avatar_in_call_size"
layout="@layout/contact_avatar_big"
bind:model="@{model.avatarModel}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_in_call_size"
android:layout_height="@dimen/avatar_presence_badge_in_call_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintBottom_toBottomOf="parent" />
<org.linphone.ui.call.view.RoundCornersTextureView
android:id="@+id/participant_video_surface"

View file

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="onClickListener"
type="View.OnClickListener" />
@ -26,29 +25,19 @@
android:layout_marginEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -5,7 +5,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="viewModel"
type="org.linphone.ui.call.viewmodel.CurrentCallViewModel" />
@ -90,12 +89,12 @@
app:layout_constraintStart_toEndOf="@id/media_encryption_icon"
app:layout_constraintTop_toBottomOf="@id/call_direction_label"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="0dp"
android:layout_height="0dp"
coilCallAvatar="@{viewModel.contact}"
layout="@layout/contact_avatar_huge"
bind:model="@{viewModel.contact}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintWidth_max="@dimen/avatar_in_call_size"
app:layout_constraintHeight_max="@dimen/avatar_in_call_size"
@ -103,17 +102,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/media_encryption_icon"
app:layout_constraintBottom_toTopOf="@id/name"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_in_call_size"
android:layout_height="@dimen/avatar_presence_badge_in_call_size"
android:src="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.contact.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintBottom_toTopOf="@id/name" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_300"

View file

@ -5,7 +5,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="viewModel"
type="org.linphone.ui.call.viewmodel.CurrentCallViewModel" />
@ -39,27 +38,17 @@
app:layout_constraintStart_toEndOf="@id/call_direction_icon"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_in_call_size"
android:layout_height="@dimen/avatar_in_call_size"
coilCallAvatar="@{viewModel.contact}"
layout="@layout/contact_avatar_huge"
bind:model="@{viewModel.contact}"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/call_direction_label"
app:layout_constraintBottom_toTopOf="@id/name"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_in_call_size"
android:layout_height="@dimen/avatar_presence_badge_in_call_size"
android:src="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.contact.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintBottom_toTopOf="@id/name" />
<com.google.android.material.progressindicator.CircularProgressIndicator
android:layout_width="wrap_content"

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
@ -25,15 +25,15 @@
android:layout_marginEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model.contact}"
layout="@layout/contact_avatar"
bind:model="@{model.contact}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View file

@ -5,7 +5,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="viewModel"
type="org.linphone.ui.call.viewmodel.CurrentCallViewModel" />
@ -39,27 +38,17 @@
app:layout_constraintStart_toEndOf="@id/call_direction_icon"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_in_call_size"
android:layout_height="@dimen/avatar_in_call_size"
coilCallAvatar="@{viewModel.contact}"
layout="@layout/contact_avatar_huge"
bind:model="@{viewModel.contact}"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/call_direction_label"
app:layout_constraintBottom_toTopOf="@id/name"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_in_call_size"
android:layout_height="@dimen/avatar_presence_badge_in_call_size"
android:src="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.contact.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintBottom_toTopOf="@id/name" />
<com.google.android.material.progressindicator.CircularProgressIndicator
android:layout_width="wrap_content"

View file

@ -6,8 +6,6 @@
<data>
<import type="android.view.View" />
<import type="com.google.android.flexbox.JustifyContent" />
<import type="org.linphone.core.SecurityLevel" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.ChatMessage.State" />
<variable
name="onLongClickListener"
@ -35,38 +33,16 @@
android:layout_marginBottom="@{model.groupedWithNextMessage ? @dimen/chat_bubble_grouped_bottom_margin : @dimen/chat_bubble_bottom_margin, default=@dimen/chat_bubble_bottom_margin}"
android:layout_marginTop="@{model.groupedWithPreviousMessage ? @dimen/chat_bubble_grouped_top_margin : @dimen/chat_bubble_top_margin, default=@dimen/chat_bubble_top_margin}">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_bubble_size"
android:layout_height="@dimen/avatar_bubble_size"
android:visibility="@{!model.isFromGroup ? View.GONE: model.groupedWithPreviousMessage ? View.INVISIBLE : View.VISIBLE}"
coilBubbleAvatar="@{model.avatarModel}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="@{!model.isFromGroup ? View.GONE : model.groupedWithPreviousMessage ? View.INVISIBLE : View.VISIBLE}"
layout="@layout/contact_avatar_small"
bind:model="@{model.avatarModel}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/name" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_bubble_presence_badge_size"
android:layout_height="@dimen/avatar_bubble_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.isFromGroup &amp;&amp; (model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_bubble_presence_badge_size"
android:layout_height="@dimen/avatar_bubble_presence_badge_size"
android:layout_marginEnd="1dp"
android:background="@drawable/led_background"
android:padding="1dp"
android:visibility="@{model.groupedWithPreviousMessage || !model.isFromGroup || model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_300"
android:id="@+id/name"

View file

@ -6,7 +6,6 @@
<data>
<import type="android.view.View" />
<import type="com.google.android.flexbox.JustifyContent" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.ChatMessage.State" />
<variable
name="onLongClickListener"

View file

@ -5,8 +5,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="backClickListener"
type="View.OnClickListener" />
@ -78,40 +76,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:onClick="@{goToInfoClickListener}"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginStart="5dp"
coilAvatar="@{viewModel.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{viewModel.avatarModel}"
app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{viewModel.avatarModel.presenceStatus}"
android:visibility="@{viewModel.isGroup || viewModel.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{viewModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{!viewModel.searchBarVisible &amp;&amp; (viewModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.avatarModel.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="backClickListener"
type="View.OnClickListener" />
@ -77,41 +77,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.imageview.ShapeableImageView
<include
android:id="@+id/avatar"
style="@style/avatar_imageview"
coilBigAvatar="@{viewModel.avatarModel}"
android:layout_width="@dimen/avatar_big_size"
android:layout_height="@dimen/avatar_big_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:src="@drawable/inset_meeting"
layout="@layout/contact_avatar_big"
bind:model="@{viewModel.avatarModel}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_big_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_big_padding"
android:visibility="@{viewModel.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE, default=gone}"
app:layout_constraintBottom_toBottomOf="@id/avatar"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:presenceIcon="@{viewModel.avatarModel.presenceStatus}" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginStart="@dimen/avatar_presence_badge_big_end_margin"
android:src="@{viewModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
style="@style/default_text_style"

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="android.graphics.Typeface" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.chat.model.ConversationModel" />
@ -30,39 +28,17 @@
android:paddingEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
coilAvatar="@{model.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
android:visibility="@{model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/removal_in_progress"
android:layout_width="wrap_content"

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.chat.model.MessageBottomSheetParticipantModel" />
@ -20,40 +18,18 @@
android:layout_marginEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
android:visibility="@{model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.chat.model.ParticipantModel" />
@ -20,40 +18,18 @@
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
android:visibility="@{model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.contacts.AbstractAvatarModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
style="@style/avatar_imageview"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:contentDescription="@null"
coilAvatar="@{model}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/trust_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
android:src="@{model.trust == SecurityLevel.Unsafe ? @drawable/shape_circle_unsafe_contact_overlay : @drawable/shape_circle_trusted_contact_overlay, default=@drawable/shape_circle_trusted_contact_overlay}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintTop_toTopOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
android:visibility="@{model.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
android:contentDescription="@{model.presenceStatus == ConsolidatedPresence.Online ? @string/content_description_contact_online : @string/content_description_contact_away}"
app:presenceIcon="@{model.presenceStatus}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginStart="@dimen/avatar_presence_badge_end_margin"
android:src="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.contacts.AbstractAvatarModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
style="@style/avatar_imageview"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_big_size"
android:layout_height="@dimen/avatar_big_size"
android:contentDescription="@null"
coilBigAvatar="@{model}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/trust_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
android:src="@{model.trust == SecurityLevel.Unsafe ? @drawable/shape_circle_unsafe_contact_overlay : @drawable/shape_circle_trusted_contact_overlay, default=@drawable/shape_circle_trusted_contact_overlay}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintTop_toTopOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_big_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_big_padding"
android:visibility="@{model.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
android:contentDescription="@{model.presenceStatus == ConsolidatedPresence.Online ? @string/content_description_contact_online : @string/content_description_contact_away}"
app:presenceIcon="@{model.presenceStatus}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginStart="@dimen/avatar_presence_badge_big_end_margin"
android:src="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.contacts.AbstractAvatarModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
style="@style/avatar_imageview"
android:id="@+id/avatar"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
coilHugeAvatar="@{model}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="@+id/trust_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
android:src="@{model.trust == SecurityLevel.Unsafe ? @drawable/shape_circle_unsafe_contact_overlay : @drawable/shape_circle_trusted_contact_overlay, default=@drawable/shape_circle_trusted_contact_overlay}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintTop_toTopOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_in_call_size"
android:layout_height="@dimen/avatar_presence_badge_in_call_size"
android:layout_marginStart="@dimen/avatar_presence_badge_in_call_end_margin"
android:src="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.contacts.AbstractAvatarModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
style="@style/avatar_imageview"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_favorite_list_cell_size"
android:layout_height="@dimen/avatar_favorite_list_cell_size"
android:contentDescription="@null"
coilAvatar="@{model}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/trust_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
android:src="@{model.trust == SecurityLevel.Unsafe ? @drawable/shape_circle_unsafe_contact_overlay : @drawable/shape_circle_trusted_contact_overlay, default=@drawable/shape_circle_trusted_contact_overlay}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintTop_toTopOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
android:visibility="@{model.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
android:contentDescription="@{model.presenceStatus == ConsolidatedPresence.Online ? @string/content_description_contact_online : @string/content_description_contact_away}"
app:presenceIcon="@{model.presenceStatus}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginStart="@dimen/avatar_presence_badge_end_margin"
android:src="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.contacts.AbstractAvatarModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
style="@style/avatar_imageview"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_bubble_size"
android:layout_height="@dimen/avatar_bubble_size"
android:contentDescription="@null"
coilBubbleAvatar="@{model}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/trust_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
android:src="@{model.trust == SecurityLevel.Unsafe ? @drawable/shape_circle_unsafe_contact_overlay : @drawable/shape_circle_trusted_contact_overlay, default=@drawable/shape_circle_trusted_contact_overlay}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintTop_toTopOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_bubble_presence_badge_size"
android:layout_height="@dimen/avatar_bubble_presence_badge_size"
android:layout_marginEnd="1dp"
android:background="@drawable/led_background"
android:padding="1dp"
android:visibility="@{model.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
android:contentDescription="@{model.presenceStatus == ConsolidatedPresence.Online ? @string/content_description_contact_online : @string/content_description_contact_away}"
app:presenceIcon="@{model.presenceStatus}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_bubble_presence_badge_size"
android:layout_height="@dimen/avatar_bubble_presence_badge_size"
android:layout_marginStart="1dp"
android:src="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.showTrust &amp;&amp; (model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe) ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.contacts.model.ContactAvatarModel" />
@ -27,38 +25,16 @@
android:padding="5dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_favorite_list_cell_size"
android:layout_height="@dimen/avatar_favorite_list_cell_size"
coilAvatar="@{model}"
app:layout_constraintStart_toStartOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/contact_avatar_medium"
bind:model="@{model}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.presenceStatus}"
android:visibility="@{model.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -6,7 +6,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="backClickListener"
type="View.OnClickListener" />
@ -103,40 +102,17 @@
app:constraint_referenced_ids="trusted_devices_count, trusted_devices_progress, devices, trusted_devices_progress_label"
android:visibility="@{viewModel.expandDevicesTrust &amp;&amp; viewModel.devices.size() > 0 ? View.VISIBLE : View.GONE}" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_big_size"
android:layout_height="@dimen/avatar_big_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
coilBigAvatar="@{viewModel.contact}"
layout="@layout/contact_avatar_big"
bind:model="@{viewModel.contact}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_big_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_big_padding"
app:presenceIcon="@{viewModel.contact.presenceStatus}"
android:visibility="@{viewModel.contact.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginStart="@dimen/avatar_presence_badge_big_end_margin"
android:src="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.contact.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.contact.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="android.graphics.Typeface" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.contacts.model.ContactAvatarModel" />
@ -56,41 +54,19 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model}"
layout="@layout/contact_avatar"
bind:model="@{model}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/header"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.presenceStatus}"
android:visibility="@{model.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -66,7 +66,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.imageview.ShapeableImageView
<ImageView
style="@style/avatar_imageview"
android:onClick="@{pickImageClickListener}"
android:id="@+id/avatar"

View file

@ -6,7 +6,6 @@
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="backClickListener"
type="View.OnClickListener" />
@ -89,40 +88,17 @@
app:constraint_referenced_ids="call, call_label, chat, chat_label, video_call, video_call_label, meeting, meeting_label"
app:barrierDirection="bottom" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_big_size"
android:layout_height="@dimen/avatar_big_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
coilBigAvatar="@{viewModel.callLogModel.avatarModel}"
layout="@layout/contact_avatar_big"
bind:model="@{viewModel.callLogModel.avatarModel}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_big_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_big_padding"
app:presenceIcon="@{viewModel.callLogModel.avatarModel.presenceStatus}"
android:visibility="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_big_size"
android:layout_height="@dimen/avatar_presence_badge_big_size"
android:layout_marginStart="@dimen/avatar_presence_badge_big_end_margin"
android:src="@{viewModel.callLogModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{viewModel.callLogModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || viewModel.callLogModel.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{viewModel.callLogModel.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="android.graphics.Typeface" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.history.model.CallLogModel" />
@ -31,41 +29,19 @@
android:paddingEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginStart="5dp"
coilAvatar="@{model.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
android:visibility="@{model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<import type="org.linphone.core.SecurityLevel" />
<variable
name="model"
type="org.linphone.ui.main.meetings.model.ParticipantModel" />
@ -16,41 +14,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
android:visibility="@{model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @drawable/trusted : @drawable/not_trusted, default=@drawable/trusted}"
android:visibility="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified || model.avatarModel.trust == SecurityLevel.Unsafe ? View.VISIBLE : View.GONE}"
android:contentDescription="@{model.avatarModel.trust == SecurityLevel.EndToEndEncryptedAndVerified ? @string/content_description_trusted_contact_icon : @string/content_description_not_trusted_contact_icon}"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.ConsolidatedPresence" />
<variable
name="model"
type="org.linphone.ui.main.model.SelectedAddressModel" />
@ -15,31 +14,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
coilAvatar="@{model.avatarModel}"
layout="@layout/contact_avatar"
bind:model="@{model.avatarModel}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/presence_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:layout_marginEnd="@dimen/avatar_presence_badge_end_margin"
android:background="@drawable/led_background"
android:padding="@dimen/avatar_presence_badge_padding"
app:presenceIcon="@{model.avatarModel.presenceStatus}"
android:visibility="@{model.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/name"

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
@ -69,16 +70,16 @@
app:layout_constraintEnd_toEndOf="@id/video_preview"
app:layout_constraintBottom_toBottomOf="@id/video_preview" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_in_call_size"
android:layout_height="@dimen/avatar_in_call_size"
coilCallAvatar="@{viewModel.selfAvatar}"
layout="@layout/contact_avatar_huge"
bind:model="@{viewModel.selfAvatar}"
app:layout_constraintEnd_toEndOf="@id/no_video_background"
app:layout_constraintStart_toStartOf="@id/no_video_background"
app:layout_constraintTop_toTopOf="@id/no_video_background"
app:layout_constraintBottom_toBottomOf="@id/no_video_background"/>
app:layout_constraintBottom_toBottomOf="@id/no_video_background" />
<org.linphone.ui.call.view.RoundCornersTextureView
android:id="@+id/video_preview"

View file

@ -21,7 +21,7 @@
android:layout_marginEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView
<ImageView
style="@style/avatar_imageview"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
@ -34,28 +34,18 @@
app:constraint_referenced_ids="title, search"
app:barrierDirection="bottom" />
<com.google.android.material.imageview.ShapeableImageView
style="@style/avatar_imageview"
android:onClick="@{() -> viewModel.openDrawerMenu()}"
<include
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_list_cell_size"
android:layout_height="@dimen/avatar_list_cell_size"
android:onClick="@{() -> viewModel.openDrawerMenu()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
coilAvatar="@{viewModel.account}"
layout="@layout/contact_avatar"
bind:model="@{viewModel.account}"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/title" />
<ImageView
android:id="@+id/trust_badge"
android:layout_width="@dimen/avatar_presence_badge_size"
android:layout_height="@dimen/avatar_presence_badge_size"
android:src="@drawable/trusted"
android:visibility="@{viewModel.account.showTrust ? View.VISIBLE : View.GONE}"
android:contentDescription="@null"
app:layout_constraintStart_toStartOf="@id/avatar"
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_800"
android:id="@+id/title"

View file

@ -578,6 +578,8 @@
<string name="content_description_trusted_contact_icon">Contact is trusted</string>
<string name="content_description_not_trusted_contact_icon">Contact is not trusted!</string>
<string name="content_description_contact_online">Contact is online</string>
<string name="content_description_contact_away">Contact is not online</string>
<string name="content_description_open_drawer_menu_icon">Open drawer menu</string>
<string name="content_description_go_back_icon">Go back</string>
</resources>

View file

@ -28,9 +28,10 @@
<dimen name="avatar_presence_badge_big_size">22dp</dimen>
<dimen name="avatar_presence_badge_big_padding">3dp</dimen>
<dimen name="avatar_presence_badge_big_end_margin">5dp</dimen>
<dimen name="avatar_presence_badge_in_call_end_margin">6dp</dimen>
<dimen name="avatar_presence_badge_in_active_speaker_miniature_conference_call_size">14dp</dimen>
<dimen name="avatar_trust_border_width">2dp</dimen>
<dimen name="avatar_trust_border_width">3dp</dimen>
<dimen name="avatar_initials_text_size">16sp</dimen>
<dimen name="avatar_initials_bubble_text_size">14sp</dimen>

View file

@ -633,6 +633,8 @@
<!-- Content description for accessibility -->
<string name="content_description_trusted_contact_icon">Contact is trusted</string>
<string name="content_description_not_trusted_contact_icon">Contact is not trusted!</string>
<string name="content_description_contact_online">Contact is online</string>
<string name="content_description_contact_away">Contact is not online</string>
<string name="content_description_open_drawer_menu_icon">Open drawer menu</string>
<string name="content_description_go_back_icon">Go back</string>
</resources>

View file

@ -166,12 +166,8 @@
<item name="cornerSize">50%</item>
</style>
<style name="avatar_imageview">
<item name="android:padding">1dp</item> <!-- half the size of the border @dimen/avatar_trust_border_width -->
<item name="android:background">@drawable/shape_circle_contact_avatar_background</item>
<item name="android:adjustViewBounds">true</item>
<item name="android:scaleType">centerCrop</item>
<item name="shapeAppearanceOverlay">@style/rounded</item>
<item name="strokeColor">@color/transparent_color</item>
<item name="strokeWidth">0dp</item>
</style>
</resources>