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
|
package org.linphone.activities.main.chat.data
|
||||||
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import org.linphone.R
|
||||||
import org.linphone.activities.main.chat.GroupChatRoomMember
|
import org.linphone.activities.main.chat.GroupChatRoomMember
|
||||||
import org.linphone.contact.GenericContactData
|
import org.linphone.contact.GenericContactData
|
||||||
|
import org.linphone.core.ChatRoomSecurityLevel
|
||||||
import org.linphone.utils.LinphoneUtils
|
import org.linphone.utils.LinphoneUtils
|
||||||
|
|
||||||
class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericContactData(participant.address) {
|
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
|
// 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 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 {
|
init {
|
||||||
securityLevel.value = participant.securityLevel
|
securityLevel.value = participant.securityLevel
|
||||||
isAdmin.value = participant.isAdmin
|
isAdmin.value = participant.isAdmin
|
||||||
|
@ -41,10 +59,6 @@ class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericCo
|
||||||
canBeSetAdmin.value = participant.canBeSetAdmin
|
canBeSetAdmin.value = participant.canBeSetAdmin
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun destroy() {
|
|
||||||
super.destroy()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setAdmin() {
|
fun setAdmin() {
|
||||||
isAdmin.value = true
|
isAdmin.value = true
|
||||||
participant.isAdmin = 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
|
val showGroupChatAvatar: Boolean
|
||||||
get() = false
|
get() = false
|
||||||
|
|
||||||
|
val thumbnailUri: Uri?
|
||||||
|
get() = contact.value?.getThumbnailUri()
|
||||||
|
|
||||||
|
val pictureUri: Uri?
|
||||||
|
get() = contact.value?.getPictureUri()
|
||||||
}
|
}
|
||||||
|
|
||||||
open class GenericContactData(private val sipAddress: Address) : ContactDataInterface {
|
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 initials = MutableLiveData<String>()
|
||||||
val displayInitials = MutableLiveData<Boolean>()
|
val displayInitials = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
val thumbnailUri: Uri?
|
|
||||||
get() = contact.value?.getThumbnailUri()
|
|
||||||
|
|
||||||
val pictureUri: Uri?
|
|
||||||
get() = contact.value?.getPictureUri()
|
|
||||||
|
|
||||||
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
||||||
override fun onContactUpdated(friend: Friend) {
|
override fun onContactUpdated(friend: Friend) {
|
||||||
contactLookup()
|
contactLookup()
|
||||||
|
@ -90,12 +90,6 @@ abstract class GenericContactViewModel(private val sipAddress: Address) : Messag
|
||||||
final override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
final override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
final override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
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() {
|
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
||||||
override fun onContactUpdated(friend: Friend) {
|
override fun onContactUpdated(friend: Friend) {
|
||||||
contactLookup()
|
contactLookup()
|
||||||
|
|
|
@ -402,18 +402,9 @@ class CorePreferences constructor(private val context: Context) {
|
||||||
|
|
||||||
/* UI related */
|
/* UI related */
|
||||||
|
|
||||||
val hideContactsWithoutPresence: Boolean
|
|
||||||
get() = config.getBool("app", "hide_contacts_without_presence", false)
|
|
||||||
|
|
||||||
val contactOrganizationVisible: Boolean
|
val contactOrganizationVisible: Boolean
|
||||||
get() = config.getBool("app", "display_contact_organization", true)
|
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
|
private val darkModeAllowed: Boolean
|
||||||
get() = config.getBool("app", "dark_mode_allowed", true)
|
get() = config.getBool("app", "dark_mode_allowed", true)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.net.Uri
|
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.util.Patterns
|
import android.util.Patterns
|
||||||
|
@ -44,13 +43,15 @@ import coil.request.videoFrameMillis
|
||||||
import coil.transform.CircleCropTransformation
|
import coil.transform.CircleCropTransformation
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial
|
import com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
import org.linphone.BR
|
import org.linphone.BR
|
||||||
|
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.activities.GenericActivity
|
import org.linphone.activities.GenericActivity
|
||||||
import org.linphone.activities.main.settings.SettingListener
|
import org.linphone.activities.main.settings.SettingListener
|
||||||
import org.linphone.activities.voip.data.ConferenceParticipantDeviceData
|
import org.linphone.activities.voip.data.ConferenceParticipantDeviceData
|
||||||
import org.linphone.activities.voip.views.HorizontalScrollDotsView
|
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.core.tools.Log
|
||||||
import org.linphone.views.VoiceRecordProgressBar
|
import org.linphone.views.VoiceRecordProgressBar
|
||||||
|
|
||||||
|
@ -305,19 +306,19 @@ fun setImageViewScaleType(imageView: ImageView, scaleType: ImageView.ScaleType)
|
||||||
imageView.scaleType = scaleType
|
imageView.scaleType = scaleType
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindingAdapter("glideRoundPath")
|
@BindingAdapter("coilRounded")
|
||||||
fun loadRoundImageWithGlide(imageView: ImageView, path: String?) {
|
fun loadRoundImageWithCoil(imageView: ImageView, path: String?) {
|
||||||
if (path != null && path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
if (path != null && path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
||||||
imageView.load(path) {
|
imageView.load(path) {
|
||||||
transformations(CircleCropTransformation())
|
transformations(CircleCropTransformation())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.w("[Data Binding] [Glide] Can't load $path")
|
Log.w("[Data Binding] [Coil] Can't load $path")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindingAdapter("glidePath")
|
@BindingAdapter("coil")
|
||||||
fun loadImageWithGlide(imageView: ImageView, path: String?) {
|
fun loadImageWithCoil(imageView: ImageView, path: String?) {
|
||||||
if (path != null && path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
if (path != null && path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
||||||
if (corePreferences.vfsEnabled && path.endsWith(FileUtils.VFS_PLAIN_FILE_EXTENSION)) {
|
if (corePreferences.vfsEnabled && path.endsWith(FileUtils.VFS_PLAIN_FILE_EXTENSION)) {
|
||||||
imageView.load(path) {
|
imageView.load(path) {
|
||||||
|
@ -327,17 +328,86 @@ fun loadImageWithGlide(imageView: ImageView, path: String?) {
|
||||||
imageView.load(path)
|
imageView.load(path)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.w("[Data Binding] [Glide] Can't load $path")
|
Log.w("[Data Binding] [Coil] Can't load $path")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindingAdapter("glideAvatar")
|
private fun loadContactPictureWithCoil(
|
||||||
fun loadAvatarWithGlide(imageView: ImageView, path: Uri?) {
|
imageView: ImageView,
|
||||||
loadAvatarWithGlide(imageView, path?.toString())
|
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")
|
@BindingAdapter("coilContact")
|
||||||
fun loadAvatarWithGlide(imageView: ImageView, path: String?) {
|
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) {
|
if (path != null) {
|
||||||
imageView.visibility = View.VISIBLE
|
imageView.visibility = View.VISIBLE
|
||||||
imageView.load(path) {
|
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")
|
@BindingAdapter("assistantPhoneNumberValidation")
|
||||||
fun addPhoneNumberEditTextValidation(editText: EditText, enabled: Boolean) {
|
fun addPhoneNumberEditTextValidation(editText: EditText, enabled: Boolean) {
|
||||||
if (!enabled) return
|
if (!enabled) return
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:glidePath="@{data.path}"/>
|
coil="@{data.path}"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
android:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:coilVideoPreview="@{data.path}"/>
|
coilVideoPreview="@{data.path}"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:visibility="@{data.video ? View.VISIBLE : View.GONE, default=gone}"
|
android:visibility="@{data.video ? View.VISIBLE : View.GONE, default=gone}"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxHeight="@dimen/chat_message_bubble_image_height_big"
|
android:maxHeight="@dimen/chat_message_bubble_image_height_big"
|
||||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_bubble_file_size}"
|
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:visibility="@{!data.downloadable && data.image ? View.VISIBLE : View.GONE}"
|
||||||
android:scaleType="@{data.alone ? ScaleType.FIT_CENTER : ScaleType.CENTER_CROP}"
|
android:scaleType="@{data.alone ? ScaleType.FIT_CENTER : ScaleType.CENTER_CROP}"
|
||||||
android:adjustViewBounds="true" />
|
android:adjustViewBounds="true" />
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxHeight="@dimen/chat_message_bubble_image_height_big"
|
android:maxHeight="@dimen/chat_message_bubble_image_height_big"
|
||||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_bubble_file_size}"
|
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:visibility="@{!data.downloadable && data.video ? View.VISIBLE : View.GONE}"
|
||||||
android:scaleType="@{data.alone ? ScaleType.FIT_CENTER : ScaleType.CENTER_CROP}"
|
android:scaleType="@{data.alone ? ScaleType.FIT_CENTER : ScaleType.CENTER_CROP}"
|
||||||
android:adjustViewBounds="true" />
|
android:adjustViewBounds="true" />
|
||||||
|
|
|
@ -60,17 +60,18 @@
|
||||||
android:src="@{data.imdnIcon, default=@drawable/chat_delivered}"
|
android:src="@{data.imdnIcon, default=@drawable/chat_delivered}"
|
||||||
android:visibility="@{data.chatMessage.outgoing ? (data.showImdn ? View.VISIBLE : View.INVISIBLE) : View.INVISIBLE}" />
|
android:visibility="@{data.chatMessage.outgoing ? (data.showImdn ? View.VISIBLE : View.INVISIBLE) : View.INVISIBLE}" />
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/contact_avatar_size"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/contact_avatar_size"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
coilContact="@{data}"
|
||||||
android:layout_below="@id/time"
|
android:layout_below="@id/time"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="@{data.chatMessage.outgoing || selectionListViewModel.isEditionEnabled ? View.GONE : (data.hideAvatar ? View.INVISIBLE : View.VISIBLE)}"
|
android:visibility="@{data.chatMessage.outgoing || selectionListViewModel.isEditionEnabled ? View.GONE : (data.hideAvatar ? View.INVISIBLE : View.VISIBLE)}" />
|
||||||
app:data="@{data}"
|
|
||||||
tools:layout="@layout/contact_avatar" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/background"
|
android:id="@+id/background"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxHeight="@dimen/chat_message_bubble_image_height_small"
|
android:maxHeight="@dimen/chat_message_bubble_image_height_small"
|
||||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_small_bubble_file_size}"
|
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:visibility="@{data.image ? View.VISIBLE : View.GONE}"
|
||||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||||
android:adjustViewBounds="true" />
|
android:adjustViewBounds="true" />
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxHeight="@dimen/chat_message_bubble_image_height_small"
|
android:maxHeight="@dimen/chat_message_bubble_image_height_small"
|
||||||
android:layout_size="@{data.alone ? 0f : @dimen/chat_message_small_bubble_file_size}"
|
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:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
||||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||||
android:adjustViewBounds="true" />
|
android:adjustViewBounds="true" />
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
android:layout_width="@dimen/chat_message_small_bubble_file_size"
|
android:layout_width="@dimen/chat_message_small_bubble_file_size"
|
||||||
android:layout_height="@dimen/chat_message_small_bubble_file_size"
|
android:layout_height="@dimen/chat_message_small_bubble_file_size"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
app:glidePath="@{data.filePath}"
|
coil="@{data.filePath}"
|
||||||
android:visibility="@{data.image ? View.VISIBLE : View.GONE}"
|
android:visibility="@{data.image ? View.VISIBLE : View.GONE}"
|
||||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||||
android:adjustViewBounds="true" />
|
android:adjustViewBounds="true" />
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
android:layout_width="@dimen/chat_message_small_bubble_file_size"
|
android:layout_width="@dimen/chat_message_small_bubble_file_size"
|
||||||
android:layout_height="@dimen/chat_message_small_bubble_file_size"
|
android:layout_height="@dimen/chat_message_small_bubble_file_size"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
app:coilVideoPreview="@{data.filePath}"
|
coilVideoPreview="@{data.filePath}"
|
||||||
android:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
android:visibility="@{data.video ? View.VISIBLE : View.GONE}"
|
||||||
android:scaleType="@{ScaleType.CENTER_CROP}"
|
android:scaleType="@{ScaleType.CENTER_CROP}"
|
||||||
android:adjustViewBounds="true" />
|
android:adjustViewBounds="true" />
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -23,16 +22,29 @@
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<RelativeLayout
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="45dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_centerVertical="true">
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:gravity="center"
|
<ImageView
|
||||||
app:showSecurityLevel="@{true}"
|
coilContact="@{data}"
|
||||||
app:data="@{data}"
|
android:layout_width="@dimen/contact_avatar_size"
|
||||||
tools:layout="@layout/contact_avatar" />
|
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
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -20,18 +18,41 @@
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp">
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<RelativeLayout
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="45dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_centerVertical="true">
|
||||||
app:showSecurityLevel="@{isEncrypted && data.securityLevel != ChatRoomSecurityLevel.ClearText}"
|
|
||||||
app:showLimeCapability="@{isEncrypted && data.securityLevel == ChatRoomSecurityLevel.ClearText}"
|
<ImageView
|
||||||
app:data="@{data}"
|
coilContact="@{data}"
|
||||||
tools:layout="@layout/contact_avatar"/>
|
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
|
<ImageView
|
||||||
android:onClick="@{removeClickListener}"
|
android:onClick="@{removeClickListener}"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -16,13 +14,14 @@
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/contact_avatar_size"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/contact_avatar_size"
|
||||||
android:layout_centerVertical="true"
|
android:layout_marginRight="10dp"
|
||||||
tools:layout="@layout/contact_avatar"
|
coilContact="@{data}"
|
||||||
app:data="@{data}"/>
|
android:contentDescription="@null"
|
||||||
|
android:layout_centerVertical="true"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/time"
|
android:id="@+id/time"
|
||||||
|
@ -44,18 +43,18 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<org.linphone.views.MarqueeTextView
|
<org.linphone.views.MarqueeTextView
|
||||||
android:text="@{data.contact.name ?? data.displayName}"
|
|
||||||
style="@style/contact_name_list_cell_font"
|
style="@style/contact_name_list_cell_font"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true" />
|
android:singleLine="true"
|
||||||
|
android:text="@{data.contact.name ?? data.displayName}" />
|
||||||
|
|
||||||
<org.linphone.views.MarqueeTextView
|
<org.linphone.views.MarqueeTextView
|
||||||
android:text="@{data.sipUri}"
|
|
||||||
style="@style/sip_uri_small_font"
|
style="@style/sip_uri_small_font"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true" />
|
android:singleLine="true"
|
||||||
|
android:text="@{data.sipUri}" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -41,27 +39,42 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<RelativeLayout
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="45dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
tools:layout="@layout/contact_avatar"
|
|
||||||
android:layout_centerHorizontal="true"
|
<ImageView
|
||||||
app:showSecurityLevel="@{viewModel.encryptedChatRoom}"
|
coilContact="@{viewModel}"
|
||||||
app:data="@{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
|
<TextView
|
||||||
android:id="@+id/date"
|
android:id="@+id/date"
|
||||||
android:text="@{viewModel.lastUpdate}"
|
|
||||||
android:textColor="?attr/accentColor"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/avatar"
|
android:layout_below="@id/avatar"
|
||||||
android:paddingRight="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_centerHorizontal="true"
|
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>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
@ -69,7 +82,7 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingLeft="10dp">
|
android:paddingLeft="5dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="data"
|
name="data"
|
||||||
type="org.linphone.activities.main.conference.data.ConferenceSchedulingParticipantData" />
|
type="org.linphone.activities.main.conference.data.ConferenceSchedulingParticipantData" />
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
@ -25,13 +20,30 @@
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/avatar"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="45dp"
|
||||||
android:gravity="center"
|
android:layout_height="wrap_content"
|
||||||
app:data="@{data}"
|
android:layout_gravity="center_vertical">
|
||||||
app:showLimeCapability="@{data.showLimeBadge}"
|
|
||||||
tools:layout="@layout/contact_avatar" />
|
<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
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
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:orientation="vertical"
|
||||||
android:paddingTop="20dp">
|
android:paddingTop="20dp">
|
||||||
|
|
||||||
<org.linphone.contact.BigContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="@dimen/contact_avatar_big_size"
|
||||||
android:layout_height="100dp"
|
android:layout_height="@dimen/contact_avatar_big_size"
|
||||||
android:gravity="center"
|
coilContactBig="@{viewModel}"
|
||||||
tools:layout="@layout/contact_avatar_big"
|
android:contentDescription="@null" />
|
||||||
app:viewModel="@{viewModel}"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@{viewModel.contact.name ?? viewModel.displayName}"
|
android:text="@{viewModel.contact.name ?? viewModel.displayName}"
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -75,25 +74,22 @@
|
||||||
android:layout_marginRight="10dp">
|
android:layout_marginRight="10dp">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="@dimen/contact_avatar_big_size"
|
||||||
android:layout_height="100dp">
|
android:layout_height="@dimen/contact_avatar_big_size">
|
||||||
|
|
||||||
<org.linphone.contact.BigContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:onClick="@{avatarClickListener}"
|
android:onClick="@{avatarClickListener}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="100dp"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
coilContactBig="@{viewModel}"
|
||||||
tools:layout="@layout/contact_avatar_big"
|
android:contentDescription="@null" />
|
||||||
app:viewModel="@{viewModel}"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="100dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="100dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:contentDescription="@string/content_description_change_contact_picture"
|
android:contentDescription="@string/content_description_change_contact_picture"
|
||||||
glideAvatar="@{viewModel.tempPicturePath}"/>
|
coilGoneIfError="@{viewModel.tempPicturePath}"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -34,13 +32,14 @@
|
||||||
android:background="?attr/backgroundColor"
|
android:background="?attr/backgroundColor"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/contact_avatar_size"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="@dimen/contact_avatar_size"
|
||||||
android:gravity="center"
|
coilContact="@{viewModel}"
|
||||||
tools:layout="@layout/contact_avatar"
|
android:layout_marginRight="10dp"
|
||||||
app:data="@{viewModel}"/>
|
android:layout_centerVertical="true"
|
||||||
|
android:contentDescription="@null" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/right"
|
android:id="@+id/right"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -26,14 +24,30 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="5dp">
|
android:padding="5dp">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<RelativeLayout
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="45dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_centerVertical="true">
|
||||||
tools:layout="@layout/contact_avatar"
|
|
||||||
app:showLimeCapability="@{data.hasLimeX3DHCapability}"
|
<ImageView
|
||||||
app:data="@{data}"/>
|
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
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -41,27 +55,27 @@
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_toRightOf="@id/avatar"
|
|
||||||
android:layout_toLeftOf="@id/linphone_user"
|
android:layout_toLeftOf="@id/linphone_user"
|
||||||
|
android:layout_toRightOf="@id/avatar"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@{data.contact.name ?? data.displayName}"
|
|
||||||
style="@style/contact_name_list_cell_font"
|
style="@style/contact_name_list_cell_font"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="top|left"
|
android:gravity="top|left"
|
||||||
android:lines="1" />
|
android:lines="1"
|
||||||
|
android:text="@{data.contact.name ?? data.displayName}" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@{data.sipUri}"
|
|
||||||
style="@style/sip_uri_font"
|
style="@style/sip_uri_font"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="bottom|left"
|
android:gravity="bottom|left"
|
||||||
android:lines="1" />
|
android:lines="1"
|
||||||
|
android:text="@{data.sipUri}" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
glidePath="@{viewModel.filePath}"/>
|
coil="@{viewModel.filePath}"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -87,14 +87,13 @@
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingBottom="5dp">
|
android:paddingBottom="5dp">
|
||||||
|
|
||||||
<org.linphone.contact.BigContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="100dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
bind:layout="@layout/contact_avatar_big"
|
android:layout_width="@dimen/contact_avatar_big_size"
|
||||||
app:viewModel="@{viewModel}"/>
|
android:layout_height="@dimen/contact_avatar_big_size"
|
||||||
|
coilContactBig="@{viewModel}"
|
||||||
|
android:contentDescription="@null" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@{viewModel.contact.name ?? viewModel.displayName}"
|
android:text="@{viewModel.contact.name ?? viewModel.displayName}"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
|
@ -83,14 +81,14 @@
|
||||||
android:layout_toLeftOf="@id/right"
|
android:layout_toLeftOf="@id/right"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
coilContact="@{viewModel}"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="@dimen/contact_avatar_size"
|
||||||
|
android:layout_height="@dimen/contact_avatar_size"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:gravity="center"
|
android:layout_marginRight="10dp"
|
||||||
app:data="@{viewModel}"
|
android:contentDescription="@null" />
|
||||||
tools:layout="@layout/contact_avatar" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/icon"
|
android:id="@+id/icon"
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
glideRoundPath="@{viewModel.defaultAccountAvatar}"
|
coilRounded="@{viewModel.defaultAccountAvatar}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
|
|
|
@ -57,19 +57,20 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/incoming_call_title" />
|
app:layout_constraintTop_toBottomOf="@id/incoming_call_title" />
|
||||||
|
|
||||||
<include
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
layout="@layout/voip_contact_avatar_alt"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:data="@{callsViewModel.currentCallData}"
|
android:contentDescription="@null"
|
||||||
|
coilVoipContactAlt="@{callsViewModel.currentCallData}"
|
||||||
app:layout_constraintBottom_toTopOf="@id/caller_name"
|
app:layout_constraintBottom_toTopOf="@id/caller_name"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
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_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/incoming_call_timer"
|
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
|
<TextView
|
||||||
android:id="@+id/caller_name"
|
android:id="@+id/caller_name"
|
||||||
|
|
|
@ -52,20 +52,37 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/outgoing_call_title" />
|
app:layout_constraintTop_toBottomOf="@id/outgoing_call_title" />
|
||||||
|
|
||||||
<include
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
layout="@layout/voip_contact_avatar_alt"
|
coilVoipContactAlt="@{callsViewModel.currentCallData}"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:data="@{callsViewModel.currentCallData}"
|
android:contentDescription="@null"
|
||||||
app:isConferenceCall="@{callsViewModel.currentCallData.remoteConferenceSubject.length > 0}"
|
android:visibility="@{callsViewModel.currentCallData.remoteConferenceSubject.length > 0 ? View.GONE : View.VISIBLE}"
|
||||||
app:layout_constraintBottom_toTopOf="@id/callee_name"
|
app:layout_constraintBottom_toTopOf="@id/conference_avatar"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
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_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/outgoing_call_timer"
|
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
|
<TextView
|
||||||
android:id="@+id/callee_name"
|
android:id="@+id/callee_name"
|
||||||
|
@ -79,7 +96,7 @@
|
||||||
app:layout_constraintBottom_toTopOf="@id/callee_address"
|
app:layout_constraintBottom_toTopOf="@id/callee_address"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/avatar" />
|
app:layout_constraintTop_toBottomOf="@id/conference_avatar" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/callee_address"
|
android:id="@+id/callee_address"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
@ -27,14 +25,15 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="10dp">
|
android:layout_marginRight="10dp">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<ImageView
|
||||||
android:visibility="@{data.isInRemoteConference ? View.GONE : View.VISIBLE}"
|
android:visibility="@{data.isInRemoteConference ? View.GONE : View.VISIBLE}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/contact_avatar_size"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="@dimen/contact_avatar_size"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
coilContact="@{data}"
|
||||||
android:layout_marginLeft="40dp"
|
android:layout_marginLeft="40dp"
|
||||||
android:gravity="center"
|
android:layout_marginRight="10dp"
|
||||||
tools:layout="@layout/contact_avatar"
|
android:layout_centerVertical="true"/>
|
||||||
app:data="@{data}"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:visibility="@{data.isInRemoteConference ? View.VISIBLE : View.GONE, default=gone}"
|
android:visibility="@{data.isInRemoteConference ? View.VISIBLE : View.GONE, default=gone}"
|
||||||
|
|
|
@ -48,17 +48,18 @@
|
||||||
android:background="@drawable/shape_remote_background"
|
android:background="@drawable/shape_remote_background"
|
||||||
android:onClick="@{() -> controlsViewModel.toggleFullScreen()}">
|
android:onClick="@{() -> controlsViewModel.toggleFullScreen()}">
|
||||||
|
|
||||||
<include
|
<ImageView
|
||||||
layout="@layout/voip_contact_avatar"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:data="@{conferenceViewModel.speakingParticipant}"
|
android:contentDescription="@null"
|
||||||
|
coilVoipContact="@{conferenceViewModel.speakingParticipant}"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="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_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
|
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||||
android:id="@+id/conference_active_speaker_remote_video"
|
android:id="@+id/conference_active_speaker_remote_video"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
|
@ -16,14 +14,15 @@
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<org.linphone.contact.ContactAvatarView
|
<ImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/contact_avatar_size"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="@dimen/contact_avatar_size"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
coilContact="@{data}"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:gravity="center"
|
android:layout_marginEnd="10dp"
|
||||||
app:data="@{data}"
|
android:layout_centerVertical="true"/>
|
||||||
tools:layout="@layout/contact_avatar"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/delete"
|
android:id="@+id/delete"
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
app:layout_alignSelf="flex_end"
|
app:layout_alignSelf="flex_end"
|
||||||
app:layout_flexShrink="0">
|
app:layout_flexShrink="0">
|
||||||
|
|
||||||
<include
|
<ImageView
|
||||||
layout="@layout/voip_contact_avatar"
|
|
||||||
android:layout_width="@dimen/voip_conference_active_speaker_miniature_avatar_size"
|
android:layout_width="@dimen/voip_conference_active_speaker_miniature_avatar_size"
|
||||||
android:layout_height="@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}"
|
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE}"
|
||||||
app:data="@{data}"
|
android:contentDescription="@null"
|
||||||
|
coilVoipContact="@{data}"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
@ -42,14 +42,14 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<include
|
<ImageView
|
||||||
android:id="@+id/participant_avatar"
|
android:id="@+id/participant_avatar"
|
||||||
layout="@layout/voip_contact_avatar"
|
|
||||||
android:layout_width="@dimen/voip_conference_audio_only_participant_avatar_size"
|
android:layout_width="@dimen/voip_conference_audio_only_participant_avatar_size"
|
||||||
android:layout_height="@dimen/voip_conference_audio_only_participant_avatar_size"
|
android:layout_height="@dimen/voip_conference_audio_only_participant_avatar_size"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:visibility="@{data.isInConference ? View.VISIBLE : View.GONE}"
|
android:visibility="@{data.isInConference ? View.VISIBLE : View.GONE}"
|
||||||
app:data="@{data}"
|
coilVoipContact="@{data}"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/paused_avatar"
|
app:layout_constraintEnd_toStartOf="@+id/paused_avatar"
|
||||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||||
|
|
|
@ -26,18 +26,19 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<include
|
<ImageView
|
||||||
layout="@layout/voip_contact_avatar"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="30dp"
|
android:layout_margin="30dp"
|
||||||
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
|
android:contentDescription="@null"
|
||||||
app:data="@{data}"
|
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE}"
|
||||||
|
coilVoipContact="@{data}"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="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_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
|
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||||
android:id="@+id/participant_video_surface"
|
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_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/call_header_barrier" />
|
app:layout_constraintTop_toBottomOf="@id/call_header_barrier" />
|
||||||
|
|
||||||
<include
|
<ImageView
|
||||||
layout="@layout/voip_contact_avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="20dp"
|
android:layout_margin="20dp"
|
||||||
app:data="@{callsViewModel.currentCallData}"
|
android:contentDescription="@null"
|
||||||
|
coilVoipContact="@{callsViewModel.currentCallData}"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="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_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintWidth_max="@dimen/voip_contact_avatar_max_size" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/call_remote_name_font"
|
style="@style/call_remote_name_font"
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
<dimen name="tabs_fragment_selector_size">5dp</dimen>
|
<dimen name="tabs_fragment_selector_size">5dp</dimen>
|
||||||
<dimen name="tabs_fragment_unread_count_bounce_offset">5dp</dimen>
|
<dimen name="tabs_fragment_unread_count_bounce_offset">5dp</dimen>
|
||||||
<dimen name="contact_avatar_size">35dp</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_button_size">20dp</dimen>
|
||||||
<dimen name="field_shape_margin">3dp</dimen>
|
<dimen name="field_shape_margin">3dp</dimen>
|
||||||
<dimen name="call_overlay_size">60dp</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_grid">30dp</dimen>
|
||||||
<dimen name="voip_conference_participant_mic_muted_icon_size_active_speaker">25dp</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_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_numpad_button_max_size">60dp</dimen>
|
||||||
<dimen name="voip_conference_audio_only_participant_cell_height">80dp</dimen>
|
<dimen name="voip_conference_audio_only_participant_cell_height">80dp</dimen>
|
||||||
<dimen name="voip_conference_audio_only_participant_avatar_size">40dp</dimen>
|
<dimen name="voip_conference_audio_only_participant_avatar_size">40dp</dimen>
|
||||||
|
|
Loading…
Reference in a new issue