Improved way of displaying contact's avatar or initials
This commit is contained in:
parent
d51affda59
commit
f2b85f6473
39 changed files with 504 additions and 736 deletions
|
@ -20,8 +20,10 @@
|
|||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.main.chat.GroupChatRoomMember
|
||||
import org.linphone.contact.GenericContactData
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericContactData(participant.address) {
|
||||
|
@ -34,6 +36,22 @@ class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericCo
|
|||
// A participant not yet added to a group can't be set admin at the same time it's added
|
||||
val canBeSetAdmin = MutableLiveData<Boolean>()
|
||||
|
||||
val securityLevelIcon: Int by lazy {
|
||||
when (participant.securityLevel) {
|
||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||
ChatRoomSecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
||||
else -> R.drawable.security_alert_indicator
|
||||
}
|
||||
}
|
||||
|
||||
val securityLevelContentDescription: Int by lazy {
|
||||
when (participant.securityLevel) {
|
||||
ChatRoomSecurityLevel.Safe -> R.string.content_description_security_level_safe
|
||||
ChatRoomSecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
||||
else -> R.string.content_description_security_level_unsafe
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
securityLevel.value = participant.securityLevel
|
||||
isAdmin.value = participant.isAdmin
|
||||
|
@ -41,10 +59,6 @@ class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericCo
|
|||
canBeSetAdmin.value = participant.canBeSetAdmin
|
||||
}
|
||||
|
||||
override fun destroy() {
|
||||
super.destroy()
|
||||
}
|
||||
|
||||
fun setAdmin() {
|
||||
isAdmin.value = true
|
||||
participant.isAdmin = true
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2020 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-android
|
||||
* (see https://www.linphone.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.linphone.contact
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.databinding.ContactAvatarBigBinding
|
||||
import org.linphone.utils.AppUtils
|
||||
|
||||
class BigContactAvatarView : LinearLayout {
|
||||
lateinit var binding: ContactAvatarBigBinding
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
fun init(context: Context) {
|
||||
binding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(context), R.layout.contact_avatar_big, this, true
|
||||
)
|
||||
}
|
||||
|
||||
fun setViewModel(viewModel: ContactDataInterface?) {
|
||||
if (viewModel == null) {
|
||||
binding.root.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
binding.root.visibility = View.VISIBLE
|
||||
|
||||
val contact = viewModel.contact.value
|
||||
val initials = if (contact != null) {
|
||||
AppUtils.getInitials(contact.name ?: "")
|
||||
} else {
|
||||
AppUtils.getInitials(viewModel.displayName.value ?: "")
|
||||
}
|
||||
|
||||
binding.initials = initials
|
||||
binding.generatedAvatarVisibility = initials.isNotEmpty() && initials != "+"
|
||||
binding.imagePath = contact?.getPictureUri()
|
||||
binding.thumbnailPath = contact?.getThumbnailUri()
|
||||
binding.borderVisibility = corePreferences.showBorderOnBigContactAvatar
|
||||
}
|
||||
}
|
113
app/src/main/java/org/linphone/contact/ContactAvatarGenerator.kt
Normal file
113
app/src/main/java/org/linphone/contact/ContactAvatarGenerator.kt
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2022 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-android
|
||||
* (see https://www.linphone.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.linphone.contact
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.*
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.text.TextPaint
|
||||
import android.util.TypedValue
|
||||
import androidx.core.content.ContextCompat
|
||||
import org.linphone.R
|
||||
import org.linphone.utils.AppUtils
|
||||
|
||||
class ContactAvatarGenerator(private val context: Context) {
|
||||
private var textSize: Float
|
||||
private var textColor: Int
|
||||
private var avatarSize: Int
|
||||
private var name = " "
|
||||
private var backgroundColor: Int
|
||||
|
||||
init {
|
||||
val theme = context.theme
|
||||
|
||||
val backgroundColorTypedValue = TypedValue()
|
||||
theme.resolveAttribute(R.attr.primaryTextColor, backgroundColorTypedValue, true)
|
||||
backgroundColor = ContextCompat.getColor(context, backgroundColorTypedValue.resourceId)
|
||||
|
||||
val textColorTypedValue = TypedValue()
|
||||
theme.resolveAttribute(R.attr.secondaryTextColor, textColorTypedValue, true)
|
||||
textColor = ContextCompat.getColor(context, textColorTypedValue.resourceId)
|
||||
|
||||
textSize = AppUtils.getDimension(R.dimen.contact_avatar_text_size)
|
||||
|
||||
avatarSize = AppUtils.getDimension(R.dimen.contact_avatar_size).toInt()
|
||||
}
|
||||
|
||||
fun setTextSize(size: Float) = apply {
|
||||
textSize = size
|
||||
}
|
||||
|
||||
fun setTextColorResource(resource: Int) = apply {
|
||||
textColor = ContextCompat.getColor(context, resource)
|
||||
}
|
||||
|
||||
fun setAvatarSize(size: Int) = apply {
|
||||
avatarSize = size
|
||||
}
|
||||
|
||||
fun setLabel(label: String) = apply {
|
||||
name = label
|
||||
}
|
||||
|
||||
fun setBackgroundColorAttribute(attribute: Int) = apply {
|
||||
val theme = context.theme
|
||||
val backgroundColorTypedValue = TypedValue()
|
||||
theme.resolveAttribute(attribute, backgroundColorTypedValue, true)
|
||||
backgroundColor = ContextCompat.getColor(context, backgroundColorTypedValue.resourceId)
|
||||
}
|
||||
|
||||
fun build(): BitmapDrawable {
|
||||
val label = AppUtils.getInitials(name)
|
||||
val textPainter = getTextPainter()
|
||||
val painter = getPainter()
|
||||
|
||||
val bitmap = Bitmap.createBitmap(avatarSize, avatarSize, Bitmap.Config.ARGB_8888)
|
||||
val canvas = Canvas(bitmap)
|
||||
val areaRect = Rect(0, 0, avatarSize, avatarSize)
|
||||
val bounds = RectF(areaRect)
|
||||
bounds.right = textPainter.measureText(label, 0, label.length)
|
||||
bounds.bottom = textPainter.descent() - textPainter.ascent()
|
||||
bounds.left += (areaRect.width() - bounds.right) / 2.0f
|
||||
bounds.top += (areaRect.height() - bounds.bottom) / 2.0f
|
||||
|
||||
val halfSize = (avatarSize / 2).toFloat()
|
||||
canvas.drawCircle(halfSize, halfSize, halfSize, painter)
|
||||
canvas.drawText(label, bounds.left, bounds.top - textPainter.ascent(), textPainter)
|
||||
|
||||
return BitmapDrawable(context.resources, bitmap)
|
||||
}
|
||||
|
||||
private fun getTextPainter(): TextPaint {
|
||||
val textPainter = TextPaint()
|
||||
textPainter.isAntiAlias = true
|
||||
textPainter.textSize = textSize
|
||||
textPainter.color = textColor
|
||||
textPainter.typeface = Typeface.create(Typeface.DEFAULT, Typeface.BOLD)
|
||||
return textPainter
|
||||
}
|
||||
|
||||
private fun getPainter(): Paint {
|
||||
val painter = Paint()
|
||||
painter.isAntiAlias = true
|
||||
painter.color = backgroundColor
|
||||
return painter
|
||||
}
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2020 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-android
|
||||
* (see https://www.linphone.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.linphone.contact
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.databinding.ContactAvatarBinding
|
||||
import org.linphone.utils.AppUtils
|
||||
|
||||
class ContactAvatarView : LinearLayout {
|
||||
lateinit var binding: ContactAvatarBinding
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context)
|
||||
}
|
||||
|
||||
fun init(context: Context) {
|
||||
binding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(context), R.layout.contact_avatar, this, true
|
||||
)
|
||||
}
|
||||
|
||||
fun setData(data: ContactDataInterface?) {
|
||||
// From Crashlytics it seems this function can be called with null parameter...
|
||||
data ?: return
|
||||
|
||||
val contact = data.contact.value
|
||||
val initials = if (contact != null) {
|
||||
AppUtils.getInitials(contact.name ?: "")
|
||||
} else {
|
||||
AppUtils.getInitials(data.displayName.value ?: "")
|
||||
}
|
||||
|
||||
binding.initials = initials
|
||||
binding.generatedAvatarVisibility = initials.isNotEmpty() && initials != "+"
|
||||
binding.groupChatAvatarVisibility = data.showGroupChatAvatar
|
||||
|
||||
binding.imagePath = contact?.getThumbnailUri()
|
||||
binding.borderVisibility = corePreferences.showBorderOnContactAvatar
|
||||
|
||||
binding.securityIcon = when (data.securityLevel.value) {
|
||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||
ChatRoomSecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
||||
else -> R.drawable.security_alert_indicator
|
||||
}
|
||||
binding.securityContentDescription = when (data.securityLevel.value) {
|
||||
ChatRoomSecurityLevel.Safe -> R.string.content_description_security_level_safe
|
||||
ChatRoomSecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
||||
else -> R.string.content_description_security_level_unsafe
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,6 +38,12 @@ interface ContactDataInterface {
|
|||
|
||||
val showGroupChatAvatar: Boolean
|
||||
get() = false
|
||||
|
||||
val thumbnailUri: Uri?
|
||||
get() = contact.value?.getThumbnailUri()
|
||||
|
||||
val pictureUri: Uri?
|
||||
get() = contact.value?.getPictureUri()
|
||||
}
|
||||
|
||||
open class GenericContactData(private val sipAddress: Address) : ContactDataInterface {
|
||||
|
@ -48,12 +54,6 @@ open class GenericContactData(private val sipAddress: Address) : ContactDataInte
|
|||
val initials = MutableLiveData<String>()
|
||||
val displayInitials = MutableLiveData<Boolean>()
|
||||
|
||||
val thumbnailUri: Uri?
|
||||
get() = contact.value?.getThumbnailUri()
|
||||
|
||||
val pictureUri: Uri?
|
||||
get() = contact.value?.getPictureUri()
|
||||
|
||||
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
||||
override fun onContactUpdated(friend: Friend) {
|
||||
contactLookup()
|
||||
|
@ -90,12 +90,6 @@ abstract class GenericContactViewModel(private val sipAddress: Address) : Messag
|
|||
final override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||
final override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
||||
|
||||
val thumbnailUri: Uri?
|
||||
get() = contact.value?.getThumbnailUri()
|
||||
|
||||
val pictureUri: Uri?
|
||||
get() = contact.value?.getPictureUri()
|
||||
|
||||
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
||||
override fun onContactUpdated(friend: Friend) {
|
||||
contactLookup()
|
||||
|
|
|
@ -402,18 +402,9 @@ class CorePreferences constructor(private val context: Context) {
|
|||
|
||||
/* UI related */
|
||||
|
||||
val hideContactsWithoutPresence: Boolean
|
||||
get() = config.getBool("app", "hide_contacts_without_presence", false)
|
||||
|
||||
val contactOrganizationVisible: Boolean
|
||||
get() = config.getBool("app", "display_contact_organization", true)
|
||||
|
||||
val showBorderOnContactAvatar: Boolean
|
||||
get() = config.getBool("app", "show_border_on_contact_avatar", false)
|
||||
|
||||
val showBorderOnBigContactAvatar: Boolean
|
||||
get() = config.getBool("app", "show_border_on_big_contact_avatar", true)
|
||||
|
||||
private val darkModeAllowed: Boolean
|
||||
get() = config.getBool("app", "dark_mode_allowed", true)
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import android.annotation.SuppressLint
|
|||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.net.Uri
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.Patterns
|
||||
|
@ -44,13 +43,15 @@ import coil.request.videoFrameMillis
|
|||
import coil.transform.CircleCropTransformation
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial
|
||||
import org.linphone.BR
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.GenericActivity
|
||||
import org.linphone.activities.main.settings.SettingListener
|
||||
import org.linphone.activities.voip.data.ConferenceParticipantDeviceData
|
||||
import org.linphone.activities.voip.views.HorizontalScrollDotsView
|
||||
import org.linphone.contact.ContactAvatarView
|
||||
import org.linphone.contact.ContactAvatarGenerator
|
||||
import org.linphone.contact.ContactDataInterface
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.views.VoiceRecordProgressBar
|
||||
|
||||
|
@ -305,19 +306,19 @@ fun setImageViewScaleType(imageView: ImageView, scaleType: ImageView.ScaleType)
|
|||
imageView.scaleType = scaleType
|
||||
}
|
||||
|
||||
@BindingAdapter("glideRoundPath")
|
||||
fun loadRoundImageWithGlide(imageView: ImageView, path: String?) {
|
||||
@BindingAdapter("coilRounded")
|
||||
fun loadRoundImageWithCoil(imageView: ImageView, path: String?) {
|
||||
if (path != null && path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
||||
imageView.load(path) {
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
} else {
|
||||
Log.w("[Data Binding] [Glide] Can't load $path")
|
||||
Log.w("[Data Binding] [Coil] Can't load $path")
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("glidePath")
|
||||
fun loadImageWithGlide(imageView: ImageView, path: String?) {
|
||||
@BindingAdapter("coil")
|
||||
fun loadImageWithCoil(imageView: ImageView, path: String?) {
|
||||
if (path != null && path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
||||
if (corePreferences.vfsEnabled && path.endsWith(FileUtils.VFS_PLAIN_FILE_EXTENSION)) {
|
||||
imageView.load(path) {
|
||||
|
@ -327,17 +328,86 @@ fun loadImageWithGlide(imageView: ImageView, path: String?) {
|
|||
imageView.load(path)
|
||||
}
|
||||
} else {
|
||||
Log.w("[Data Binding] [Glide] Can't load $path")
|
||||
Log.w("[Data Binding] [Coil] Can't load $path")
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("glideAvatar")
|
||||
fun loadAvatarWithGlide(imageView: ImageView, path: Uri?) {
|
||||
loadAvatarWithGlide(imageView, path?.toString())
|
||||
private fun loadContactPictureWithCoil(
|
||||
imageView: ImageView,
|
||||
contact: ContactDataInterface?,
|
||||
useThumbnail: Boolean,
|
||||
size: Int = 0,
|
||||
textSize: Int = 0,
|
||||
color: Int = 0,
|
||||
textColor: Int = 0
|
||||
) {
|
||||
if (contact != null) {
|
||||
val displayName = contact.displayName.value.orEmpty()
|
||||
val source = if (useThumbnail) contact.thumbnailUri else contact.pictureUri
|
||||
imageView.load(source) {
|
||||
transformations(CircleCropTransformation())
|
||||
error(
|
||||
if (contact.showGroupChatAvatar) {
|
||||
coreContext.contactsManager.groupAvatar.loadDrawable(imageView.context)
|
||||
} else if (displayName.isEmpty() || displayName == "+") {
|
||||
coreContext.contactsManager.contactAvatar.loadDrawable(imageView.context)
|
||||
} else {
|
||||
val builder = ContactAvatarGenerator(imageView.context)
|
||||
builder.setLabel(displayName)
|
||||
if (size > 0) {
|
||||
builder.setAvatarSize(AppUtils.getDimension(size).toInt())
|
||||
}
|
||||
if (textSize > 0) {
|
||||
builder.setTextSize(AppUtils.getDimension(textSize))
|
||||
}
|
||||
if (color > 0) {
|
||||
builder.setBackgroundColorAttribute(color)
|
||||
}
|
||||
if (textColor > 0) {
|
||||
builder.setTextColorResource(textColor)
|
||||
}
|
||||
builder.build()
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
imageView.load(R.drawable.icon_single_contact_avatar)
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("glideAvatar")
|
||||
fun loadAvatarWithGlide(imageView: ImageView, path: String?) {
|
||||
@BindingAdapter("coilContact")
|
||||
fun loadContactPictureWithCoil(imageView: ImageView, contact: ContactDataInterface?) {
|
||||
loadContactPictureWithCoil(imageView, contact, true)
|
||||
}
|
||||
|
||||
@BindingAdapter("coilContactBig")
|
||||
fun loadBigContactPictureWithCoil(imageView: ImageView, contact: ContactDataInterface?) {
|
||||
loadContactPictureWithCoil(
|
||||
imageView, contact, true,
|
||||
R.dimen.contact_avatar_big_size, R.dimen.contact_avatar_text_big_size
|
||||
)
|
||||
}
|
||||
|
||||
@BindingAdapter("coilVoipContactAlt")
|
||||
fun loadVoipContactPictureWithCoilAlt(imageView: ImageView, contact: ContactDataInterface?) {
|
||||
loadContactPictureWithCoil(
|
||||
imageView, contact, false,
|
||||
R.dimen.voip_contact_avatar_max_size, R.dimen.voip_contact_avatar_text_size,
|
||||
R.attr.voipParticipantBackgroundColor, R.color.white_color
|
||||
)
|
||||
}
|
||||
|
||||
@BindingAdapter("coilVoipContact")
|
||||
fun loadVoipContactPictureWithCoil(imageView: ImageView, contact: ContactDataInterface?) {
|
||||
loadContactPictureWithCoil(
|
||||
imageView, contact, false,
|
||||
R.dimen.voip_contact_avatar_max_size, R.dimen.voip_contact_avatar_text_size,
|
||||
R.attr.voipBackgroundColor, R.color.white_color
|
||||
)
|
||||
}
|
||||
|
||||
@BindingAdapter("coilGoneIfError")
|
||||
fun loadAvatarWithCoil(imageView: ImageView, path: String?) {
|
||||
if (path != null) {
|
||||
imageView.visibility = View.VISIBLE
|
||||
imageView.load(path) {
|
||||
|
@ -366,16 +436,6 @@ fun loadVideoPreview(imageView: ImageView, path: String?) {
|
|||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("showSecurityLevel")
|
||||
fun ContactAvatarView.setShowAvatarSecurityLevel(visible: Boolean) {
|
||||
this.binding.securityBadgeVisibility = visible
|
||||
}
|
||||
|
||||
@BindingAdapter("showLimeCapability")
|
||||
fun ContactAvatarView.setShowLimeCapability(limeCapability: Boolean) {
|
||||
this.binding.showLimeCapability = limeCapability
|
||||
}
|
||||
|
||||
@BindingAdapter("assistantPhoneNumberValidation")
|
||||
fun addPhoneNumberEditTextValidation(editText: EditText, enabled: Boolean) {
|
||||
if (!enabled) return
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:glidePath="@{data.path}"/>
|
||||
coil="@{data.path}"/>
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
||||
|
@ -35,7 +35,7 @@
|
|||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:coilVideoPreview="@{data.path}"/>
|
||||
coilVideoPreview="@{data.path}"/>
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{data.video ? View.VISIBLE : View.GONE, default=gone}"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:maxHeight="@dimen/chat_message_bubble_image_height_big"
|
||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_bubble_file_size}"
|
||||
app:glidePath="@{data.filePath}"
|
||||
coil="@{data.filePath}"
|
||||
android:visibility="@{!data.downloadable && data.image ? View.VISIBLE : View.GONE}"
|
||||
android:scaleType="@{data.alone ? ScaleType.FIT_CENTER : ScaleType.CENTER_CROP}"
|
||||
android:adjustViewBounds="true" />
|
||||
|
@ -39,7 +39,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:maxHeight="@dimen/chat_message_bubble_image_height_big"
|
||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_bubble_file_size}"
|
||||
app:coilVideoPreview="@{data.filePath}"
|
||||
coilVideoPreview="@{data.filePath}"
|
||||
android:visibility="@{!data.downloadable && data.video ? View.VISIBLE : View.GONE}"
|
||||
android:scaleType="@{data.alone ? ScaleType.FIT_CENTER : ScaleType.CENTER_CROP}"
|
||||
android:adjustViewBounds="true" />
|
||||
|
|
|
@ -60,17 +60,18 @@
|
|||
android:src="@{data.imdnIcon, default=@drawable/chat_delivered}"
|
||||
android:visibility="@{data.chatMessage.outgoing ? (data.showImdn ? View.VISIBLE : View.INVISIBLE) : View.INVISIBLE}" />
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:contentDescription="@null"
|
||||
coilContact="@{data}"
|
||||
android:layout_below="@id/time"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:gravity="center"
|
||||
android:visibility="@{data.chatMessage.outgoing || selectionListViewModel.isEditionEnabled ? View.GONE : (data.hideAvatar ? View.INVISIBLE : View.VISIBLE)}"
|
||||
app:data="@{data}"
|
||||
tools:layout="@layout/contact_avatar" />
|
||||
android:visibility="@{data.chatMessage.outgoing || selectionListViewModel.isEditionEnabled ? View.GONE : (data.hideAvatar ? View.INVISIBLE : View.VISIBLE)}" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/background"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:maxHeight="@dimen/chat_message_bubble_image_height_small"
|
||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_small_bubble_file_size}"
|
||||
app:glidePath="@{data.filePath}"
|
||||
coil="@{data.filePath}"
|
||||
android:visibility="@{data.image ? View.VISIBLE : View.GONE}"
|
||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||
android:adjustViewBounds="true" />
|
||||
|
@ -32,7 +32,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:maxHeight="@dimen/chat_message_bubble_image_height_small"
|
||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_small_bubble_file_size}"
|
||||
app:coilVideoPreview="@{data.filePath}"
|
||||
coilVideoPreview="@{data.filePath}"
|
||||
android:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||
android:adjustViewBounds="true" />
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
android:layout_width="@dimen/chat_message_small_bubble_file_size"
|
||||
android:layout_height="@dimen/chat_message_small_bubble_file_size"
|
||||
android:layout_margin="5dp"
|
||||
app:glidePath="@{data.filePath}"
|
||||
coil="@{data.filePath}"
|
||||
android:visibility="@{data.image ? View.VISIBLE : View.GONE}"
|
||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||
android:adjustViewBounds="true" />
|
||||
|
@ -29,7 +29,7 @@
|
|||
android:layout_width="@dimen/chat_message_small_bubble_file_size"
|
||||
android:layout_height="@dimen/chat_message_small_bubble_file_size"
|
||||
android:layout_margin="5dp"
|
||||
app:coilVideoPreview="@{data.filePath}"
|
||||
coilVideoPreview="@{data.filePath}"
|
||||
android:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||
android:adjustViewBounds="true" />
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -23,16 +22,29 @@
|
|||
android:layout_marginRight="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center"
|
||||
app:showSecurityLevel="@{true}"
|
||||
app:data="@{data}"
|
||||
tools:layout="@layout/contact_avatar" />
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<ImageView
|
||||
coilContact="@{data}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:contentDescription="@{data.securityLevelContentDescription}"
|
||||
android:src="@{data.securityLevelIcon, default=@drawable/security_alert_indicator}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -20,18 +18,41 @@
|
|||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_margin="5dp">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
app:showSecurityLevel="@{isEncrypted && data.securityLevel != ChatRoomSecurityLevel.ClearText}"
|
||||
app:showLimeCapability="@{isEncrypted && data.securityLevel == ChatRoomSecurityLevel.ClearText}"
|
||||
app:data="@{data}"
|
||||
tools:layout="@layout/contact_avatar"/>
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<ImageView
|
||||
coilContact="@{data}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{isEncrypted && data.securityLevel == ChatRoomSecurityLevel.ClearText ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:contentDescription="@string/content_description_contact_can_do_encryption"
|
||||
android:src="@drawable/security_toggle_icon_green" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{isEncrypted && data.securityLevel != ChatRoomSecurityLevel.ClearText ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:contentDescription="@{data.securityLevelContentDescription}"
|
||||
android:src="@{data.securityLevelIcon, default=@drawable/security_alert_indicator}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{removeClickListener}"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -16,13 +14,14 @@
|
|||
android:layout_margin="5dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
tools:layout="@layout/contact_avatar"
|
||||
app:data="@{data}"/>
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_marginRight="10dp"
|
||||
coilContact="@{data}"
|
||||
android:contentDescription="@null"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
|
@ -44,18 +43,18 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<org.linphone.views.MarqueeTextView
|
||||
android:text="@{data.contact.name ?? data.displayName}"
|
||||
style="@style/contact_name_list_cell_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true" />
|
||||
android:singleLine="true"
|
||||
android:text="@{data.contact.name ?? data.displayName}" />
|
||||
|
||||
<org.linphone.views.MarqueeTextView
|
||||
android:text="@{data.sipUri}"
|
||||
style="@style/sip_uri_small_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true" />
|
||||
android:singleLine="true"
|
||||
android:text="@{data.sipUri}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -41,27 +39,42 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout="@layout/contact_avatar"
|
||||
android:layout_centerHorizontal="true"
|
||||
app:showSecurityLevel="@{viewModel.encryptedChatRoom}"
|
||||
app:data="@{viewModel}"/>
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
coilContact="@{viewModel}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:contentDescription="@{viewModel.securityLevelContentDescription}"
|
||||
android:src="@{viewModel.securityLevelIcon, default=@drawable/security_alert_indicator}"
|
||||
android:visibility="@{viewModel.encryptedChatRoom ? View.VISIBLE : View.GONE, default=gone}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:text="@{viewModel.lastUpdate}"
|
||||
android:textColor="?attr/accentColor"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/avatar"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:singleLine="true" />
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"
|
||||
android:text="@{viewModel.lastUpdate, default=`12:03`}"
|
||||
android:textColor="?attr/accentColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -69,7 +82,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="10dp">
|
||||
android:paddingLeft="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
|
|
|
@ -1,16 +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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.activities.main.conference.data.ConferenceSchedulingParticipantData" />
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -25,13 +20,30 @@
|
|||
android:layout_marginRight="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
app:data="@{data}"
|
||||
app:showLimeCapability="@{data.showLimeBadge}"
|
||||
tools:layout="@layout/contact_avatar" />
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
coilContact="@{data}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{data.showLimeBadge ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:contentDescription="@string/content_description_contact_can_do_encryption"
|
||||
android:src="@drawable/security_toggle_icon_green" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
|
|
|
@ -1,111 +0,0 @@
|
|||
<?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" />
|
||||
<variable
|
||||
name="generatedAvatarVisibility"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="groupChatAvatarVisibility"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="securityBadgeVisibility"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="showLimeCapability"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="securityIcon"
|
||||
type="Integer" />
|
||||
<variable
|
||||
name="securityContentDescription"
|
||||
type="Integer" />
|
||||
<variable
|
||||
name="initials"
|
||||
type="String" />
|
||||
<variable
|
||||
name="imagePath"
|
||||
type="android.net.Uri" />
|
||||
<variable
|
||||
name="borderVisibility"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="backgroundColor"
|
||||
type="Integer" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="@dimen/contact_avatar_size">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/generated_avatar_bg" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{groupChatAvatarVisibility || !generatedAvatarVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@{groupChatAvatarVisibility ? @drawable/icon_multiple_contacts_avatar : @drawable/icon_single_contact_avatar}"/>
|
||||
|
||||
<TextView
|
||||
android:text="@{initials}"
|
||||
android:visibility="@{generatedAvatarVisibility && !groupChatAvatarVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:textColor="?attr/secondaryTextColor"
|
||||
android:textSize="21sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="none" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/contact_avatar_bg"
|
||||
android:contentDescription="@null"
|
||||
app:glideAvatar="@{imagePath}" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{borderVisibility ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/avatar_border" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{securityBadgeVisibility ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:contentDescription="@{securityContentDescription}"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@{securityIcon, default=@drawable/security_alert_indicator}" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{showLimeCapability ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:contentDescription="@string/content_description_contact_can_do_encryption"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/security_toggle_icon_green" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
|
@ -1,87 +0,0 @@
|
|||
<?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" />
|
||||
<variable
|
||||
name="generatedAvatarVisibility"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="initials"
|
||||
type="String" />
|
||||
<variable
|
||||
name="thumbnailPath"
|
||||
type="android.net.Uri" />
|
||||
<variable
|
||||
name="imagePath"
|
||||
type="android.net.Uri" />
|
||||
<variable
|
||||
name="borderVisibility"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/voip_single_contact_avatar_alt"/>
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{generatedAvatarVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/generated_avatar_bg" />
|
||||
|
||||
<TextView
|
||||
android:text="@{initials}"
|
||||
android:visibility="@{generatedAvatarVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:textColor="?attr/secondaryTextColor"
|
||||
android:textSize="60sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="none" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:background="?attr/backgroundColor"
|
||||
app:glideAvatar="@{thumbnailPath}" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:background="?attr/backgroundColor"
|
||||
app:glideAvatar="@{imagePath}" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{borderVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/avatar_border" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
|
@ -86,13 +86,12 @@
|
|||
android:orientation="vertical"
|
||||
android:paddingTop="20dp">
|
||||
|
||||
<org.linphone.contact.BigContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center"
|
||||
tools:layout="@layout/contact_avatar_big"
|
||||
app:viewModel="@{viewModel}"/>
|
||||
android:layout_width="@dimen/contact_avatar_big_size"
|
||||
android:layout_height="@dimen/contact_avatar_big_size"
|
||||
coilContactBig="@{viewModel}"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<TextView
|
||||
android:text="@{viewModel.contact.name ?? viewModel.displayName}"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -75,25 +74,22 @@
|
|||
android:layout_marginRight="10dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp">
|
||||
android:layout_width="@dimen/contact_avatar_big_size"
|
||||
android:layout_height="@dimen/contact_avatar_big_size">
|
||||
|
||||
<org.linphone.contact.BigContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:onClick="@{avatarClickListener}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center"
|
||||
tools:layout="@layout/contact_avatar_big"
|
||||
app:viewModel="@{viewModel}"/>
|
||||
android:layout_height="match_parent"
|
||||
coilContactBig="@{viewModel}"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/content_description_change_contact_picture"
|
||||
glideAvatar="@{viewModel.tempPicturePath}"/>
|
||||
coilGoneIfError="@{viewModel.tempPicturePath}"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -34,13 +32,14 @@
|
|||
android:background="?attr/backgroundColor"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
tools:layout="@layout/contact_avatar"
|
||||
app:data="@{viewModel}"/>
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
coilContact="@{viewModel}"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/right"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -26,14 +24,30 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
tools:layout="@layout/contact_avatar"
|
||||
app:showLimeCapability="@{data.hasLimeX3DHCapability}"
|
||||
app:data="@{data}"/>
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<ImageView
|
||||
coilContact="@{data}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{data.hasLimeX3DHCapability ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:contentDescription="@string/content_description_contact_can_do_encryption"
|
||||
android:src="@drawable/security_toggle_icon_green" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -41,27 +55,27 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toRightOf="@id/avatar"
|
||||
android:layout_toLeftOf="@id/linphone_user"
|
||||
android:layout_toRightOf="@id/avatar"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:text="@{data.contact.name ?? data.displayName}"
|
||||
style="@style/contact_name_list_cell_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|left"
|
||||
android:lines="1" />
|
||||
android:lines="1"
|
||||
android:text="@{data.contact.name ?? data.displayName}" />
|
||||
|
||||
<TextView
|
||||
android:text="@{data.sipUri}"
|
||||
style="@style/sip_uri_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="bottom|left"
|
||||
android:lines="1" />
|
||||
android:lines="1"
|
||||
android:text="@{data.sipUri}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
glidePath="@{viewModel.filePath}"/>
|
||||
coil="@{viewModel.filePath}"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -87,14 +87,13 @@
|
|||
android:paddingTop="10dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<org.linphone.contact.BigContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
bind:layout="@layout/contact_avatar_big"
|
||||
app:viewModel="@{viewModel}"/>
|
||||
android:layout_width="@dimen/contact_avatar_big_size"
|
||||
android:layout_height="@dimen/contact_avatar_big_size"
|
||||
coilContactBig="@{viewModel}"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<TextView
|
||||
android:text="@{viewModel.contact.name ?? viewModel.displayName}"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
|
@ -83,14 +81,14 @@
|
|||
android:layout_toLeftOf="@id/right"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
coilContact="@{viewModel}"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:gravity="center"
|
||||
app:data="@{viewModel}"
|
||||
tools:layout="@layout/contact_avatar" />
|
||||
android:layout_marginRight="10dp"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
glideRoundPath="@{viewModel.defaultAccountAvatar}"
|
||||
coilRounded="@{viewModel.defaultAccountAvatar}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
|
|
|
@ -57,19 +57,20 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/incoming_call_title" />
|
||||
|
||||
<include
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
layout="@layout/voip_contact_avatar_alt"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
app:data="@{callsViewModel.currentCallData}"
|
||||
android:contentDescription="@null"
|
||||
coilVoipContactAlt="@{callsViewModel.currentCallData}"
|
||||
app:layout_constraintBottom_toTopOf="@id/caller_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_height"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_size"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/incoming_call_timer"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintWidth_max="@dimen/voip_contact_avatar_max_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/caller_name"
|
||||
|
|
|
@ -52,20 +52,37 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/outgoing_call_title" />
|
||||
|
||||
<include
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
layout="@layout/voip_contact_avatar_alt"
|
||||
coilVoipContactAlt="@{callsViewModel.currentCallData}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
app:data="@{callsViewModel.currentCallData}"
|
||||
app:isConferenceCall="@{callsViewModel.currentCallData.remoteConferenceSubject.length > 0}"
|
||||
app:layout_constraintBottom_toTopOf="@id/callee_name"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="@{callsViewModel.currentCallData.remoteConferenceSubject.length > 0 ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintBottom_toTopOf="@id/conference_avatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_height"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_size"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/outgoing_call_timer"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintWidth_max="@dimen/voip_contact_avatar_max_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/conference_avatar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/icon_multiple_contacts_avatar"
|
||||
android:visibility="@{callsViewModel.currentCallData.remoteConferenceSubject.length > 0 ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toTopOf="@id/callee_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_size"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/avatar"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintWidth_max="@dimen/voip_contact_avatar_max_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/callee_name"
|
||||
|
@ -79,7 +96,7 @@
|
|||
app:layout_constraintBottom_toTopOf="@id/callee_address"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/avatar" />
|
||||
app:layout_constraintTop_toBottomOf="@id/conference_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/callee_address"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
|
@ -27,14 +25,15 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<ImageView
|
||||
android:visibility="@{data.isInRemoteConference ? View.GONE : View.VISIBLE}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:contentDescription="@null"
|
||||
coilContact="@{data}"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:gravity="center"
|
||||
tools:layout="@layout/contact_avatar"
|
||||
app:data="@{data}"/>
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{data.isInRemoteConference ? View.VISIBLE : View.GONE, default=gone}"
|
||||
|
|
|
@ -48,17 +48,18 @@
|
|||
android:background="@drawable/shape_remote_background"
|
||||
android:onClick="@{() -> controlsViewModel.toggleFullScreen()}">
|
||||
|
||||
<include
|
||||
layout="@layout/voip_contact_avatar"
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
app:data="@{conferenceViewModel.speakingParticipant}"
|
||||
android:contentDescription="@null"
|
||||
coilVoipContact="@{conferenceViewModel.speakingParticipant}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_size"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_max="@dimen/voip_contact_avatar_max_size" />
|
||||
|
||||
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||
android:id="@+id/conference_active_speaker_remote_video"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -16,14 +14,15 @@
|
|||
android:layout_margin="5dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/contact_avatar_size"
|
||||
android:layout_height="@dimen/contact_avatar_size"
|
||||
android:contentDescription="@null"
|
||||
coilContact="@{data}"
|
||||
android:layout_marginStart="10dp"
|
||||
android:gravity="center"
|
||||
app:data="@{data}"
|
||||
tools:layout="@layout/contact_avatar"/>
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete"
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
app:layout_alignSelf="flex_end"
|
||||
app:layout_flexShrink="0">
|
||||
|
||||
<include
|
||||
layout="@layout/voip_contact_avatar"
|
||||
<ImageView
|
||||
android:layout_width="@dimen/voip_conference_active_speaker_miniature_avatar_size"
|
||||
android:layout_height="@dimen/voip_conference_active_speaker_miniature_avatar_size"
|
||||
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
|
||||
app:data="@{data}"
|
||||
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE}"
|
||||
android:contentDescription="@null"
|
||||
coilVoipContact="@{data}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -42,14 +42,14 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<include
|
||||
<ImageView
|
||||
android:id="@+id/participant_avatar"
|
||||
layout="@layout/voip_contact_avatar"
|
||||
android:layout_width="@dimen/voip_conference_audio_only_participant_avatar_size"
|
||||
android:layout_height="@dimen/voip_conference_audio_only_participant_avatar_size"
|
||||
android:layout_marginStart="10dp"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="@{data.isInConference ? View.VISIBLE : View.GONE}"
|
||||
app:data="@{data}"
|
||||
coilVoipContact="@{data}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/paused_avatar"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
|
|
|
@ -26,18 +26,19 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<include
|
||||
layout="@layout/voip_contact_avatar"
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="30dp"
|
||||
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
|
||||
app:data="@{data}"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE}"
|
||||
coilVoipContact="@{data}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_size"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_max="@dimen/voip_contact_avatar_max_size" />
|
||||
|
||||
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||
android:id="@+id/participant_video_surface"
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
<?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" />
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.contact.GenericContactData" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/shape_call_contact_avatar_background" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{data.displayInitials ? View.GONE : View.VISIBLE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/icon_single_contact_avatar"/>
|
||||
|
||||
<TextView
|
||||
android:text="@{data.initials, default=`BB`}"
|
||||
android:visibility="@{data.displayInitials ? View.VISIBLE : View.GONE}"
|
||||
style="@style/call_generated_avatar_font"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:gravity="center"
|
||||
android:padding="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:background="?attr/voipParticipantBackgroundColor"
|
||||
app:glideAvatar="@{data.thumbnailUri}" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:background="?attr/voipParticipantBackgroundColor"
|
||||
app:glideAvatar="@{data.pictureUri}" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
|
@ -1,70 +0,0 @@
|
|||
<?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" />
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.contact.GenericContactData" />
|
||||
<variable
|
||||
name="isConferenceCall"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:maxHeight="@dimen/voip_contact_avatar_max_height">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@{isConferenceCall ? @drawable/icon_multiple_contacts_avatar : @drawable/icon_single_contact_avatar}"/>
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{data.displayInitials && !isConferenceCall ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/shape_call_contact_avatar_background_alt" />
|
||||
|
||||
<TextView
|
||||
android:text="@{data.initials, default=`BB`}"
|
||||
android:visibility="@{data.displayInitials && !isConferenceCall ? View.VISIBLE : View.GONE}"
|
||||
style="@style/call_generated_avatar_font"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:gravity="center"
|
||||
android:padding="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:background="?attr/voipBackgroundColor"
|
||||
app:glideAvatar="@{data.thumbnailUri}" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:background="?attr/voipBackgroundColor"
|
||||
app:glideAvatar="@{data.pictureUri}" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
|
@ -108,17 +108,19 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/call_header_barrier" />
|
||||
|
||||
<include
|
||||
layout="@layout/voip_contact_avatar"
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="20dp"
|
||||
app:data="@{callsViewModel.currentCallData}"
|
||||
android:contentDescription="@null"
|
||||
coilVoipContact="@{callsViewModel.currentCallData}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintHeight_max="@dimen/voip_contact_avatar_max_size"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_max="@dimen/voip_contact_avatar_max_size" />
|
||||
|
||||
<TextView
|
||||
style="@style/call_remote_name_font"
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
<dimen name="tabs_fragment_selector_size">5dp</dimen>
|
||||
<dimen name="tabs_fragment_unread_count_bounce_offset">5dp</dimen>
|
||||
<dimen name="contact_avatar_size">35dp</dimen>
|
||||
<dimen name="contact_avatar_text_size">21sp</dimen>
|
||||
<dimen name="contact_avatar_big_size">100dp</dimen>
|
||||
<dimen name="contact_avatar_text_big_size">60sp</dimen>
|
||||
<dimen name="field_button_size">20dp</dimen>
|
||||
<dimen name="field_shape_margin">3dp</dimen>
|
||||
<dimen name="call_overlay_size">60dp</dimen>
|
||||
|
@ -59,7 +62,8 @@
|
|||
<dimen name="voip_conference_participant_mic_muted_icon_size_grid">30dp</dimen>
|
||||
<dimen name="voip_conference_participant_mic_muted_icon_size_active_speaker">25dp</dimen>
|
||||
<dimen name="voip_dialog_button_max_width">137dp</dimen>
|
||||
<dimen name="voip_contact_avatar_max_height">200dp</dimen>
|
||||
<dimen name="voip_contact_avatar_max_size">200dp</dimen>
|
||||
<dimen name="voip_contact_avatar_text_size">80sp</dimen>
|
||||
<dimen name="voip_numpad_button_max_size">60dp</dimen>
|
||||
<dimen name="voip_conference_audio_only_participant_cell_height">80dp</dimen>
|
||||
<dimen name="voip_conference_audio_only_participant_avatar_size">40dp</dimen>
|
||||
|
|
Loading…
Reference in a new issue