Rework to rename classes that weren't real view models to avoid confusion and have a proper cleaning
This commit is contained in:
parent
2215cb4621
commit
1eabce5220
36 changed files with 242 additions and 160 deletions
|
@ -34,9 +34,9 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.main.adapters.SelectionListAdapter
|
||||
import org.linphone.activities.main.chat.viewmodels.ChatMessageViewModel
|
||||
import org.linphone.activities.main.chat.viewmodels.EventViewModel
|
||||
import org.linphone.activities.main.chat.viewmodels.OnContentClickedListener
|
||||
import org.linphone.activities.main.chat.data.ChatMessageData
|
||||
import org.linphone.activities.main.chat.data.EventData
|
||||
import org.linphone.activities.main.chat.data.OnContentClickedListener
|
||||
import org.linphone.activities.main.viewmodels.ListTopBarViewModel
|
||||
import org.linphone.core.ChatMessage
|
||||
import org.linphone.core.ChatRoomCapabilities
|
||||
|
@ -117,6 +117,12 @@ class ChatMessagesListAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
override fun onViewRecycled(holder: RecyclerView.ViewHolder) {
|
||||
when (holder) {
|
||||
is ChatMessageViewHolder -> holder.binding.viewModel?.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
val eventLog = getItem(position)
|
||||
return eventLog.type.toInt()
|
||||
|
@ -127,14 +133,14 @@ class ChatMessagesListAdapter(
|
|||
}
|
||||
|
||||
inner class ChatMessageViewHolder(
|
||||
private val binding: ChatMessageListCellBinding
|
||||
val binding: ChatMessageListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root), PopupMenu.OnMenuItemClickListener {
|
||||
fun bind(eventLog: EventLog) {
|
||||
with(binding) {
|
||||
if (eventLog.type == EventLog.Type.ConferenceChatMessage) {
|
||||
val chatMessage = eventLog.chatMessage
|
||||
chatMessage ?: return
|
||||
val chatMessageViewModel = ChatMessageViewModel(chatMessage, contentClickedListener)
|
||||
val chatMessageViewModel = ChatMessageData(chatMessage, contentClickedListener)
|
||||
viewModel = chatMessageViewModel
|
||||
|
||||
lifecycleOwner = viewLifecycleOwner
|
||||
|
@ -298,7 +304,7 @@ class ChatMessagesListAdapter(
|
|||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(eventLog: EventLog) {
|
||||
with(binding) {
|
||||
val eventViewModel = EventViewModel(eventLog)
|
||||
val eventViewModel = EventData(eventLog)
|
||||
viewModel = eventViewModel
|
||||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
|
|
@ -29,7 +29,7 @@ import androidx.recyclerview.widget.ListAdapter
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.main.chat.viewmodels.ChatRoomCreationContactViewModel
|
||||
import org.linphone.activities.main.chat.data.ChatRoomCreationContactData
|
||||
import org.linphone.core.Address
|
||||
import org.linphone.core.FriendCapability
|
||||
import org.linphone.core.SearchResult
|
||||
|
@ -74,7 +74,7 @@ class ChatRoomCreationContactsAdapter(
|
|||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(searchResult: SearchResult) {
|
||||
with(binding) {
|
||||
val searchResultViewModel = ChatRoomCreationContactViewModel(searchResult)
|
||||
val searchResultViewModel = ChatRoomCreationContactData(searchResult)
|
||||
viewModel = searchResultViewModel
|
||||
|
||||
lifecycleOwner = viewLifecycleOwner
|
||||
|
@ -97,7 +97,7 @@ class ChatRoomCreationContactsAdapter(
|
|||
|
||||
private fun updateSecurity(
|
||||
searchResult: SearchResult,
|
||||
viewModel: ChatRoomCreationContactViewModel,
|
||||
viewModel: ChatRoomCreationContactData,
|
||||
securityEnabled: Boolean
|
||||
) {
|
||||
val searchAddress = searchResult.address
|
||||
|
|
|
@ -29,7 +29,7 @@ import androidx.recyclerview.widget.ListAdapter
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.main.chat.GroupChatRoomMember
|
||||
import org.linphone.activities.main.chat.viewmodels.GroupInfoParticipantViewModel
|
||||
import org.linphone.activities.main.chat.data.GroupInfoParticipantData
|
||||
import org.linphone.databinding.ChatRoomGroupInfoParticipantCellBinding
|
||||
import org.linphone.utils.Event
|
||||
|
||||
|
@ -55,17 +55,21 @@ class GroupInfoParticipantsAdapter(
|
|||
(holder as ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
override fun onViewRecycled(holder: RecyclerView.ViewHolder) {
|
||||
(holder as ViewHolder).binding.viewModel?.destroy()
|
||||
}
|
||||
|
||||
fun showAdminControls(show: Boolean) {
|
||||
showAdmin = show
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
private val binding: ChatRoomGroupInfoParticipantCellBinding
|
||||
val binding: ChatRoomGroupInfoParticipantCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(participant: GroupChatRoomMember) {
|
||||
with(binding) {
|
||||
val participantViewModel = GroupInfoParticipantViewModel(participant)
|
||||
val participantViewModel = GroupInfoParticipantData(participant)
|
||||
participantViewModel.showAdminControls.value = showAdmin
|
||||
viewModel = participantViewModel
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import androidx.recyclerview.widget.DiffUtil
|
|||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.main.chat.viewmodels.ImdnParticipantViewModel
|
||||
import org.linphone.activities.main.chat.data.ImdnParticipantData
|
||||
import org.linphone.core.ChatMessage
|
||||
import org.linphone.core.ParticipantImdnState
|
||||
import org.linphone.databinding.ChatRoomImdnParticipantCellBinding
|
||||
|
@ -51,12 +51,16 @@ class ImdnAdapter(
|
|||
(holder as ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
override fun onViewRecycled(holder: RecyclerView.ViewHolder) {
|
||||
(holder as ViewHolder).binding.viewModel?.destroy()
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
private val binding: ChatRoomImdnParticipantCellBinding
|
||||
val binding: ChatRoomImdnParticipantCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(participantImdnState: ParticipantImdnState) {
|
||||
with(binding) {
|
||||
viewModel = ImdnParticipantViewModel(participantImdnState)
|
||||
viewModel = ImdnParticipantData(participantImdnState)
|
||||
|
||||
lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
|
|
|
@ -17,30 +17,28 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.coroutines.*
|
||||
import org.linphone.utils.FileUtils
|
||||
import org.linphone.utils.ImageUtils
|
||||
|
||||
class ChatMessageAttachmentViewModel(
|
||||
class ChatMessageAttachmentData(
|
||||
val path: String,
|
||||
private val deleteCallback: (attachment: ChatMessageAttachmentViewModel) -> Unit
|
||||
) : ViewModel() {
|
||||
private val deleteCallback: (attachment: ChatMessageAttachmentData) -> Unit
|
||||
) {
|
||||
val fileName: String = FileUtils.getNameFromFilePath(path)
|
||||
val isImage: Boolean = FileUtils.isExtensionImage(path)
|
||||
val isVideo: Boolean = FileUtils.isExtensionVideo(path)
|
||||
val videoPreview = MutableLiveData<Bitmap>()
|
||||
|
||||
private val scope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
|
||||
init {
|
||||
if (isVideo) {
|
||||
viewModelScope.launch {
|
||||
scope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
videoPreview.postValue(ImageUtils.getVideoPreview(path))
|
||||
}
|
||||
|
@ -48,6 +46,10 @@ class ChatMessageAttachmentViewModel(
|
|||
}
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
scope.cancel()
|
||||
}
|
||||
|
||||
fun delete() {
|
||||
deleteCallback(this)
|
||||
}
|
|
@ -17,15 +17,11 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.coroutines.*
|
||||
import org.linphone.core.ChatMessage
|
||||
import org.linphone.core.ChatMessageListenerStub
|
||||
import org.linphone.core.Content
|
||||
|
@ -34,11 +30,11 @@ import org.linphone.utils.AppUtils
|
|||
import org.linphone.utils.FileUtils
|
||||
import org.linphone.utils.ImageUtils
|
||||
|
||||
class ChatMessageContentViewModel(
|
||||
class ChatMessageContentData(
|
||||
val content: Content,
|
||||
private val chatMessage: ChatMessage,
|
||||
private val listener: OnContentClickedListener?
|
||||
) : ViewModel() {
|
||||
) {
|
||||
val isImage = MutableLiveData<Boolean>()
|
||||
val isVideo = MutableLiveData<Boolean>()
|
||||
val isAudio = MutableLiveData<Boolean>()
|
||||
|
@ -89,6 +85,8 @@ class ChatMessageContentViewModel(
|
|||
}
|
||||
}
|
||||
|
||||
private val scope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
|
||||
init {
|
||||
filePath.value = ""
|
||||
fileName.value = if (content.name.isNullOrEmpty() && !content.filePath.isNullOrEmpty()) {
|
||||
|
@ -110,7 +108,7 @@ class ChatMessageContentViewModel(
|
|||
isAudio.value = FileUtils.isExtensionAudio(path)
|
||||
|
||||
if (isVideo.value == true) {
|
||||
viewModelScope.launch {
|
||||
scope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
videoPreview.postValue(ImageUtils.getVideoPreview(path))
|
||||
}
|
||||
|
@ -134,15 +132,15 @@ class ChatMessageContentViewModel(
|
|||
chatMessage.addListener(chatMessageListener)
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
fun destroy() {
|
||||
scope.cancel()
|
||||
|
||||
val path = filePath.value.orEmpty()
|
||||
if (content.isFileEncrypted && path.isNotEmpty()) {
|
||||
Log.i("[Content] Deleting file used for preview: $path")
|
||||
FileUtils.deleteFile(path)
|
||||
filePath.value = ""
|
||||
}
|
||||
|
||||
super.onCleared()
|
||||
}
|
||||
|
||||
fun download() {
|
|
@ -17,20 +17,18 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import android.os.CountDownTimer
|
||||
import android.text.Spannable
|
||||
import android.text.util.Linkify
|
||||
import androidx.core.text.util.LinkifyCompat
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.*
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.compatibility.Compatibility
|
||||
import org.linphone.contact.GenericContactViewModel
|
||||
import org.linphone.contact.GenericContactData
|
||||
import org.linphone.core.ChatMessage
|
||||
import org.linphone.core.ChatMessageListenerStub
|
||||
import org.linphone.core.Content
|
||||
|
@ -40,10 +38,10 @@ import org.linphone.utils.AppUtils
|
|||
import org.linphone.utils.PermissionHelper
|
||||
import org.linphone.utils.TimestampUtils
|
||||
|
||||
class ChatMessageViewModel(
|
||||
class ChatMessageData(
|
||||
val chatMessage: ChatMessage,
|
||||
private var contentListener: OnContentClickedListener? = null
|
||||
) : GenericContactViewModel(chatMessage.fromAddress) {
|
||||
) : GenericContactData(chatMessage.fromAddress) {
|
||||
val sendInProgress = MutableLiveData<Boolean>()
|
||||
|
||||
val transferInProgress = MutableLiveData<Boolean>()
|
||||
|
@ -58,7 +56,7 @@ class ChatMessageViewModel(
|
|||
|
||||
val hideTime = MutableLiveData<Boolean>()
|
||||
|
||||
val contents = MutableLiveData<ArrayList<ChatMessageContentViewModel>>()
|
||||
val contents = MutableLiveData<ArrayList<ChatMessageContentData>>()
|
||||
|
||||
val time = MutableLiveData<String>()
|
||||
|
||||
|
@ -76,6 +74,7 @@ class ChatMessageViewModel(
|
|||
// TODO FIXME : find a way to refresh outgoing message downloaded
|
||||
if (state == ChatMessage.State.FileTransferDone && !message.isOutgoing) {
|
||||
Log.i("[Chat Message] File transfer done")
|
||||
contents.value.orEmpty().forEach(ChatMessageContentData::destroy)
|
||||
updateContentsList()
|
||||
|
||||
if (!message.isEphemeral && corePreferences.makePublicMediaFilesDownloaded) {
|
||||
|
@ -109,11 +108,12 @@ class ChatMessageViewModel(
|
|||
updateContentsList()
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
override fun destroy() {
|
||||
super.destroy()
|
||||
|
||||
contents.value.orEmpty().forEach(ChatMessageContentData::destroy)
|
||||
chatMessage.removeListener(listener)
|
||||
contentListener = null
|
||||
|
||||
super.onCleared()
|
||||
}
|
||||
|
||||
fun updateBubbleBackground(hasPrevious: Boolean, hasNext: Boolean) {
|
||||
|
@ -164,16 +164,19 @@ class ChatMessageViewModel(
|
|||
}
|
||||
|
||||
private fun updateContentsList() {
|
||||
val list = arrayListOf<ChatMessageContentViewModel>()
|
||||
contents.value.orEmpty().forEach(ChatMessageContentData::destroy)
|
||||
|
||||
val list = arrayListOf<ChatMessageContentData>()
|
||||
for (content in chatMessage.contents) {
|
||||
if (content.isFileTransfer || content.isFile) {
|
||||
list.add(ChatMessageContentViewModel(content, chatMessage, contentListener))
|
||||
list.add(ChatMessageContentData(content, chatMessage, contentListener))
|
||||
} else if (content.isText) {
|
||||
val spannable = Spannable.Factory.getInstance().newSpannable(content.utf8Text)
|
||||
LinkifyCompat.addLinks(spannable, Linkify.WEB_URLS)
|
||||
text.value = spannable
|
||||
}
|
||||
}
|
||||
|
||||
contents.value = list
|
||||
}
|
||||
|
||||
|
@ -210,33 +213,6 @@ class ChatMessageViewModel(
|
|||
}
|
||||
|
||||
private fun addContentToMediaStore(content: Content) {
|
||||
viewModelScope.launch {
|
||||
when (content.type) {
|
||||
"image" -> {
|
||||
if (Compatibility.addImageToMediaStore(coreContext.context, content)) {
|
||||
Log.i("[Chat Message] Adding image ${content.name} to Media Store terminated")
|
||||
} else {
|
||||
Log.e("[Chat Message] Something went wrong while copying file to Media Store...")
|
||||
}
|
||||
}
|
||||
"video" -> {
|
||||
if (Compatibility.addVideoToMediaStore(coreContext.context, content)) {
|
||||
Log.i("[Chat Message] Adding video ${content.name} to Media Store terminated")
|
||||
} else {
|
||||
Log.e("[Chat Message] Something went wrong while copying file to Media Store...")
|
||||
}
|
||||
}
|
||||
"audio" -> {
|
||||
if (Compatibility.addAudioToMediaStore(coreContext.context, content)) {
|
||||
Log.i("[Chat Message] Adding audio ${content.name} to Media Store terminated")
|
||||
} else {
|
||||
Log.e("[Chat Message] Something went wrong while copying file to Media Store...")
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
Log.w("[Chat Message] File ${content.name} isn't either an image, an audio file or a video, can't add it to the Media Store")
|
||||
}
|
||||
}
|
||||
}
|
||||
coreContext.addContentToMediaStore(content)
|
||||
}
|
||||
}
|
|
@ -17,17 +17,16 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.contact.Contact
|
||||
import org.linphone.contact.ContactViewModelInterface
|
||||
import org.linphone.contact.ContactDataInterface
|
||||
import org.linphone.core.*
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
class ChatRoomCreationContactViewModel(private val searchResult: SearchResult) : ViewModel(), ContactViewModelInterface {
|
||||
class ChatRoomCreationContactData(private val searchResult: SearchResult) : ContactDataInterface {
|
||||
override val contact = MutableLiveData<Contact>()
|
||||
|
||||
override val displayName: String by lazy {
|
||||
|
@ -58,8 +57,6 @@ class ChatRoomCreationContactViewModel(private val searchResult: SearchResult) :
|
|||
val hasLimeX3DHCapability: Boolean
|
||||
get() = searchResult.hasCapability(FriendCapability.LimeX3Dh)
|
||||
|
||||
var listener: ChatRoomCreationContactSelectionListener? = null
|
||||
|
||||
init {
|
||||
isDisabled.value = false
|
||||
isSelected.value = false
|
||||
|
@ -75,7 +72,3 @@ class ChatRoomCreationContactViewModel(private val searchResult: SearchResult) :
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ChatRoomCreationContactSelectionListener {
|
||||
fun onUnSelected(searchResult: SearchResult)
|
||||
}
|
|
@ -17,15 +17,14 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.core.ParticipantDevice
|
||||
|
||||
class DevicesListChildViewModel(private val device: ParticipantDevice) : ViewModel() {
|
||||
class DevicesListChildData(private val device: ParticipantDevice) {
|
||||
val deviceName: String = device.name.orEmpty()
|
||||
|
||||
val securityLevelIcon: Int by lazy {
|
|
@ -17,17 +17,17 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.contact.GenericContactViewModel
|
||||
import org.linphone.contact.GenericContactData
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.core.Participant
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
class DevicesListGroupViewModel(private val participant: Participant) : GenericContactViewModel(participant.address) {
|
||||
class DevicesListGroupData(private val participant: Participant) : GenericContactData(participant.address) {
|
||||
override val securityLevel: ChatRoomSecurityLevel
|
||||
get() = participant.securityLevel
|
||||
|
||||
|
@ -53,14 +53,14 @@ class DevicesListGroupViewModel(private val participant: Participant) : GenericC
|
|||
|
||||
val isExpanded = MutableLiveData<Boolean>()
|
||||
|
||||
val devices = MutableLiveData<ArrayList<DevicesListChildViewModel>>()
|
||||
val devices = MutableLiveData<ArrayList<DevicesListChildData>>()
|
||||
|
||||
init {
|
||||
isExpanded.value = false
|
||||
|
||||
val list = arrayListOf<DevicesListChildViewModel>()
|
||||
val list = arrayListOf<DevicesListChildData>()
|
||||
for (device in participant.devices) {
|
||||
list.add(DevicesListChildViewModel((device)))
|
||||
list.add(DevicesListChildData((device)))
|
||||
}
|
||||
devices.value = list
|
||||
}
|
|
@ -17,16 +17,14 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
||||
class EphemeralDurationViewModel(
|
||||
class EphemeralDurationData(
|
||||
val textResource: Int,
|
||||
selectedDuration: Long,
|
||||
private val duration: Long,
|
||||
private val listener: DurationItemClicked
|
||||
) : ViewModel() {
|
||||
) {
|
||||
val selected: Boolean = selectedDuration == duration
|
||||
|
||||
fun setSelected() {
|
|
@ -17,11 +17,10 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.contact.Contact
|
||||
|
@ -29,7 +28,7 @@ import org.linphone.core.EventLog
|
|||
import org.linphone.core.tools.Log
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
class EventViewModel(private val eventLog: EventLog) : ViewModel() {
|
||||
class EventData(private val eventLog: EventLog) {
|
||||
val text = MutableLiveData<String>()
|
||||
|
||||
val isSecurity: Boolean by lazy {
|
|
@ -17,15 +17,15 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import org.linphone.activities.main.chat.GroupChatRoomMember
|
||||
import org.linphone.contact.GenericContactViewModel
|
||||
import org.linphone.contact.GenericContactData
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
class GroupInfoParticipantViewModel(private val participant: GroupChatRoomMember) : GenericContactViewModel(participant.address) {
|
||||
class GroupInfoParticipantData(private val participant: GroupChatRoomMember) : GenericContactData(participant.address) {
|
||||
override val securityLevel: ChatRoomSecurityLevel
|
||||
get() = participant.securityLevel
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
* 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.activities.main.chat.viewmodels
|
||||
package org.linphone.activities.main.chat.data
|
||||
|
||||
import org.linphone.contact.GenericContactViewModel
|
||||
import org.linphone.contact.GenericContactData
|
||||
import org.linphone.core.ParticipantImdnState
|
||||
import org.linphone.utils.TimestampUtils
|
||||
|
||||
class ImdnParticipantViewModel(imdnState: ParticipantImdnState) : GenericContactViewModel(imdnState.participant.address) {
|
||||
class ImdnParticipantData(imdnState: ParticipantImdnState) : GenericContactData(imdnState.participant.address) {
|
||||
val sipUri: String = imdnState.participant.address.asStringUriOnly()
|
||||
|
||||
val time: String = TimestampUtils.toString(imdnState.stateChangeTime)
|
|
@ -24,6 +24,7 @@ import androidx.lifecycle.ViewModel
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import java.io.File
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.activities.main.chat.data.ChatMessageAttachmentData
|
||||
import org.linphone.core.ChatMessage
|
||||
import org.linphone.core.ChatRoom
|
||||
import org.linphone.core.ChatRoomCapabilities
|
||||
|
@ -42,7 +43,7 @@ class ChatMessageSendingViewModelFactory(private val chatRoom: ChatRoom) :
|
|||
class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
||||
var temporaryFileUploadPath: File? = null
|
||||
|
||||
val attachments = MutableLiveData<ArrayList<ChatMessageAttachmentViewModel>>()
|
||||
val attachments = MutableLiveData<ArrayList<ChatMessageAttachmentData>>()
|
||||
|
||||
val attachFileEnabled = MutableLiveData<Boolean>()
|
||||
|
||||
|
@ -60,6 +61,11 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
|||
isReadOnly.value = chatRoom.hasBeenLeft()
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
attachments.value.orEmpty().forEach(ChatMessageAttachmentData::destroy)
|
||||
super.onCleared()
|
||||
}
|
||||
|
||||
fun onTextToSendChanged(value: String) {
|
||||
sendMessageEnabled.value = value.isNotEmpty() || attachments.value?.isNotEmpty() ?: false
|
||||
if (value.isNotEmpty()) {
|
||||
|
@ -75,9 +81,9 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
|||
}
|
||||
|
||||
fun addAttachment(path: String) {
|
||||
val list = arrayListOf<ChatMessageAttachmentViewModel>()
|
||||
val list = arrayListOf<ChatMessageAttachmentData>()
|
||||
list.addAll(attachments.value.orEmpty())
|
||||
list.add(ChatMessageAttachmentViewModel(path) {
|
||||
list.add(ChatMessageAttachmentData(path) {
|
||||
removeAttachment(it)
|
||||
})
|
||||
attachments.value = list
|
||||
|
@ -88,10 +94,11 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
|||
}
|
||||
}
|
||||
|
||||
private fun removeAttachment(attachment: ChatMessageAttachmentViewModel) {
|
||||
val list = arrayListOf<ChatMessageAttachmentViewModel>()
|
||||
private fun removeAttachment(attachment: ChatMessageAttachmentData) {
|
||||
val list = arrayListOf<ChatMessageAttachmentData>()
|
||||
list.addAll(attachments.value.orEmpty())
|
||||
list.remove(attachment)
|
||||
attachment.destroy()
|
||||
attachments.value = list
|
||||
|
||||
sendMessageEnabled.value = textToSend.value.orEmpty().isNotEmpty() || list.isNotEmpty()
|
||||
|
@ -137,6 +144,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
|||
message.send()
|
||||
}
|
||||
|
||||
attachments.value.orEmpty().forEach(ChatMessageAttachmentData::destroy)
|
||||
attachments.value = arrayListOf()
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import androidx.lifecycle.ViewModelProvider
|
|||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.contact.Contact
|
||||
import org.linphone.contact.ContactViewModelInterface
|
||||
import org.linphone.contact.ContactDataInterface
|
||||
import org.linphone.contact.ContactsUpdatedListenerStub
|
||||
import org.linphone.core.*
|
||||
import org.linphone.core.tools.Log
|
||||
|
@ -42,7 +42,7 @@ class ChatRoomViewModelFactory(private val chatRoom: ChatRoom) :
|
|||
}
|
||||
}
|
||||
|
||||
class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactViewModelInterface {
|
||||
class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterface {
|
||||
override val contact = MutableLiveData<Contact>()
|
||||
|
||||
override val displayName: String
|
||||
|
|
|
@ -22,6 +22,7 @@ package org.linphone.activities.main.chat.viewmodels
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import org.linphone.activities.main.chat.data.DevicesListGroupData
|
||||
import org.linphone.core.ChatRoom
|
||||
import org.linphone.core.ChatRoomListenerStub
|
||||
import org.linphone.core.EventLog
|
||||
|
@ -36,7 +37,7 @@ class DevicesListViewModelFactory(private val chatRoom: ChatRoom) :
|
|||
}
|
||||
|
||||
class DevicesListViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
||||
val participants = MutableLiveData<ArrayList<DevicesListGroupViewModel>>()
|
||||
val participants = MutableLiveData<ArrayList<DevicesListGroupData>>()
|
||||
|
||||
private val listener = object : ChatRoomListenerStub() {
|
||||
override fun onParticipantDeviceAdded(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||
|
@ -62,17 +63,21 @@ class DevicesListViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
|||
}
|
||||
|
||||
override fun onCleared() {
|
||||
participants.value.orEmpty().forEach(DevicesListGroupData::destroy)
|
||||
chatRoom.removeListener(listener)
|
||||
super.onCleared()
|
||||
}
|
||||
|
||||
private fun updateParticipants() {
|
||||
val list = arrayListOf<DevicesListGroupViewModel>()
|
||||
participants.value.orEmpty().forEach(DevicesListGroupData::destroy)
|
||||
|
||||
val list = arrayListOf<DevicesListGroupData>()
|
||||
val me = chatRoom.me
|
||||
if (me != null) list.add(DevicesListGroupViewModel(me))
|
||||
if (me != null) list.add(DevicesListGroupData(me))
|
||||
for (participant in chatRoom.participants) {
|
||||
list.add(DevicesListGroupViewModel(participant))
|
||||
list.add(DevicesListGroupData(participant))
|
||||
}
|
||||
|
||||
participants.value = list
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.main.chat.data.DurationItemClicked
|
||||
import org.linphone.activities.main.chat.data.EphemeralDurationData
|
||||
import org.linphone.core.ChatRoom
|
||||
import org.linphone.core.tools.Log
|
||||
|
||||
|
@ -36,7 +38,7 @@ class EphemeralViewModelFactory(private val chatRoom: ChatRoom) :
|
|||
}
|
||||
|
||||
class EphemeralViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
||||
val durationsList = MutableLiveData<ArrayList<EphemeralDurationViewModel>>()
|
||||
val durationsList = MutableLiveData<ArrayList<EphemeralDurationData>>()
|
||||
|
||||
var currentSelectedDuration: Long = 0
|
||||
|
||||
|
@ -74,13 +76,13 @@ class EphemeralViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
|||
}
|
||||
|
||||
private fun computeEphemeralDurationValues() {
|
||||
val list = arrayListOf<EphemeralDurationViewModel>()
|
||||
list.add(EphemeralDurationViewModel(R.string.chat_room_ephemeral_message_disabled, currentSelectedDuration, 0, listener))
|
||||
list.add(EphemeralDurationViewModel(R.string.chat_room_ephemeral_message_one_minute, currentSelectedDuration, 60, listener))
|
||||
list.add(EphemeralDurationViewModel(R.string.chat_room_ephemeral_message_one_hour, currentSelectedDuration, 3600, listener))
|
||||
list.add(EphemeralDurationViewModel(R.string.chat_room_ephemeral_message_one_day, currentSelectedDuration, 86400, listener))
|
||||
list.add(EphemeralDurationViewModel(R.string.chat_room_ephemeral_message_three_days, currentSelectedDuration, 259200, listener))
|
||||
list.add(EphemeralDurationViewModel(R.string.chat_room_ephemeral_message_one_week, currentSelectedDuration, 604800, listener))
|
||||
val list = arrayListOf<EphemeralDurationData>()
|
||||
list.add(EphemeralDurationData(R.string.chat_room_ephemeral_message_disabled, currentSelectedDuration, 0, listener))
|
||||
list.add(EphemeralDurationData(R.string.chat_room_ephemeral_message_one_minute, currentSelectedDuration, 60, listener))
|
||||
list.add(EphemeralDurationData(R.string.chat_room_ephemeral_message_one_hour, currentSelectedDuration, 3600, listener))
|
||||
list.add(EphemeralDurationData(R.string.chat_room_ephemeral_message_one_day, currentSelectedDuration, 86400, listener))
|
||||
list.add(EphemeralDurationData(R.string.chat_room_ephemeral_message_three_days, currentSelectedDuration, 259200, listener))
|
||||
list.add(EphemeralDurationData(R.string.chat_room_ephemeral_message_one_week, currentSelectedDuration, 604800, listener))
|
||||
durationsList.value = list
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package org.linphone.activities.main.chat.viewmodels
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import org.linphone.activities.main.chat.data.ChatMessageData
|
||||
import org.linphone.core.ChatMessage
|
||||
import org.linphone.core.ChatMessageListenerStub
|
||||
import org.linphone.core.ParticipantImdnState
|
||||
|
@ -38,7 +39,7 @@ class ImdnViewModelFactory(private val chatMessage: ChatMessage) :
|
|||
class ImdnViewModel(private val chatMessage: ChatMessage) : ViewModel() {
|
||||
val participants = MutableLiveData<ArrayList<ParticipantImdnState>>()
|
||||
|
||||
val chatMessageViewModel = ChatMessageViewModel(chatMessage)
|
||||
val chatMessageViewModel = ChatMessageData(chatMessage)
|
||||
|
||||
private val listener = object : ChatMessageListenerStub() {
|
||||
override fun onParticipantImdnStateChanged(
|
||||
|
|
|
@ -43,7 +43,7 @@ class ContactEditorViewModelFactory(private val contact: Contact?) :
|
|||
}
|
||||
}
|
||||
|
||||
class ContactEditorViewModel(val c: Contact?) : ViewModel(), ContactViewModelInterface {
|
||||
class ContactEditorViewModel(val c: Contact?) : ViewModel(), ContactDataInterface {
|
||||
override val contact = MutableLiveData<Contact>()
|
||||
|
||||
override val displayName: String
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.linphone.LinphoneApplication.Companion.corePreferences
|
|||
import org.linphone.R
|
||||
import org.linphone.activities.main.viewmodels.ErrorReportingViewModel
|
||||
import org.linphone.contact.Contact
|
||||
import org.linphone.contact.ContactViewModelInterface
|
||||
import org.linphone.contact.ContactDataInterface
|
||||
import org.linphone.contact.ContactsUpdatedListenerStub
|
||||
import org.linphone.contact.NativeContact
|
||||
import org.linphone.core.*
|
||||
|
@ -46,7 +46,7 @@ class ContactViewModelFactory(private val contact: Contact) :
|
|||
}
|
||||
}
|
||||
|
||||
class ContactViewModel(private val c: Contact) : ErrorReportingViewModel(), ContactViewModelInterface {
|
||||
class ContactViewModel(private val c: Contact) : ErrorReportingViewModel(), ContactDataInterface {
|
||||
override val contact = MutableLiveData<Contact>()
|
||||
|
||||
override val displayName: String by lazy {
|
||||
|
|
|
@ -51,7 +51,7 @@ class BigContactAvatarView : LinearLayout {
|
|||
)
|
||||
}
|
||||
|
||||
fun setViewModel(viewModel: ContactViewModelInterface?) {
|
||||
fun setViewModel(viewModel: ContactDataInterface?) {
|
||||
if (viewModel == null) {
|
||||
binding.root.visibility = View.GONE
|
||||
return
|
||||
|
|
|
@ -51,7 +51,7 @@ class ContactAvatarView : LinearLayout {
|
|||
)
|
||||
}
|
||||
|
||||
fun setViewModel(viewModel: ContactViewModelInterface) {
|
||||
fun setViewModel(viewModel: ContactDataInterface) {
|
||||
val contact: Contact? = viewModel.contact.value
|
||||
val initials = if (contact != null) {
|
||||
AppUtils.getInitials(contact.fullName ?: contact.firstName + " " + contact.lastName)
|
||||
|
|
63
app/src/main/java/org/linphone/contact/GenericContactData.kt
Normal file
63
app/src/main/java/org/linphone/contact/GenericContactData.kt
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2021 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 androidx.lifecycle.MutableLiveData
|
||||
import org.linphone.LinphoneApplication
|
||||
import org.linphone.core.Address
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
interface ContactDataInterface {
|
||||
val contact: MutableLiveData<Contact>
|
||||
|
||||
val displayName: String
|
||||
|
||||
val securityLevel: ChatRoomSecurityLevel
|
||||
get() = ChatRoomSecurityLevel.ClearText
|
||||
|
||||
val showGroupChatAvatar: Boolean
|
||||
get() = false
|
||||
}
|
||||
|
||||
open class GenericContactData(private val sipAddress: Address) : ContactDataInterface {
|
||||
override val displayName: String = LinphoneUtils.getDisplayName(sipAddress)
|
||||
|
||||
override val contact = MutableLiveData<Contact>()
|
||||
|
||||
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
||||
override fun onContactUpdated(contact: Contact) {
|
||||
contactLookup()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
LinphoneApplication.coreContext.contactsManager.addListener(contactsUpdatedListener)
|
||||
contactLookup()
|
||||
}
|
||||
|
||||
open fun destroy() {
|
||||
LinphoneApplication.coreContext.contactsManager.removeListener(contactsUpdatedListener)
|
||||
}
|
||||
|
||||
private fun contactLookup() {
|
||||
contact.value = LinphoneApplication.coreContext.contactsManager.findContactByAddress(sipAddress)
|
||||
}
|
||||
}
|
|
@ -23,22 +23,9 @@ import androidx.lifecycle.MutableLiveData
|
|||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.activities.main.viewmodels.ErrorReportingViewModel
|
||||
import org.linphone.core.Address
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
interface ContactViewModelInterface {
|
||||
val contact: MutableLiveData<Contact>
|
||||
|
||||
val displayName: String
|
||||
|
||||
val securityLevel: ChatRoomSecurityLevel
|
||||
get() = ChatRoomSecurityLevel.ClearText
|
||||
|
||||
val showGroupChatAvatar: Boolean
|
||||
get() = false
|
||||
}
|
||||
|
||||
abstract class GenericContactViewModel(private val sipAddress: Address) : ErrorReportingViewModel(), ContactViewModelInterface {
|
||||
abstract class GenericContactViewModel(private val sipAddress: Address) : ErrorReportingViewModel(), ContactDataInterface {
|
||||
override val displayName: String = LinphoneUtils.getDisplayName(sipAddress)
|
||||
|
||||
override val contact = MutableLiveData<Contact>()
|
||||
|
|
|
@ -49,6 +49,7 @@ import javax.crypto.KeyGenerator
|
|||
import javax.crypto.SecretKey
|
||||
import javax.crypto.spec.GCMParameterSpec
|
||||
import kotlin.math.abs
|
||||
import kotlinx.coroutines.*
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.call.CallActivity
|
||||
|
@ -100,6 +101,8 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
|
||||
private val loggingService = Factory.instance().loggingService
|
||||
|
||||
private val coroutineScope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
|
||||
private var gsmCallActive = false
|
||||
private val phoneStateListener = object : PhoneStateListener() {
|
||||
override fun onCallStateChanged(state: Int, phoneNumber: String?) {
|
||||
|
@ -322,6 +325,7 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
|
||||
fun stop() {
|
||||
Log.i("[Context] Stopping")
|
||||
coroutineScope.cancel()
|
||||
|
||||
val telephonyManager = context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
|
||||
Log.i("[Context] Unregistering phone state listener")
|
||||
|
@ -598,6 +602,39 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Coroutine related */
|
||||
|
||||
fun addContentToMediaStore(content: Content) {
|
||||
coroutineScope.launch {
|
||||
when (content.type) {
|
||||
"image" -> {
|
||||
if (Compatibility.addImageToMediaStore(context, content)) {
|
||||
Log.i("[Context] Adding image ${content.name} to Media Store terminated")
|
||||
} else {
|
||||
Log.e("[Context] Something went wrong while copying file to Media Store...")
|
||||
}
|
||||
}
|
||||
"video" -> {
|
||||
if (Compatibility.addVideoToMediaStore(context, content)) {
|
||||
Log.i("[Context] Adding video ${content.name} to Media Store terminated")
|
||||
} else {
|
||||
Log.e("[Context] Something went wrong while copying file to Media Store...")
|
||||
}
|
||||
}
|
||||
"audio" -> {
|
||||
if (Compatibility.addAudioToMediaStore(context, content)) {
|
||||
Log.i("[Context] Adding audio ${content.name} to Media Store terminated")
|
||||
} else {
|
||||
Log.e("[Context] Something went wrong while copying file to Media Store...")
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
Log.w("[Context] File ${content.name} isn't either an image, an audio file or a video, can't add it to the Media Store")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Start call related activities */
|
||||
|
||||
private fun onIncomingReceived() {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
type="android.view.View.OnClickListener" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.EventViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.EventData" />
|
||||
<variable
|
||||
name="selectionListViewModel"
|
||||
type="org.linphone.activities.main.viewmodels.ListTopBarViewModel" />
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ChatMessageAttachmentViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.ChatMessageAttachmentData" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ChatMessageContentViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.ChatMessageContentData" />
|
||||
<variable
|
||||
name="longClickListener"
|
||||
type="android.view.View.OnLongClickListener"/>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
type="Integer"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ChatMessageViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.ChatMessageData" />
|
||||
<variable
|
||||
name="selectionListViewModel"
|
||||
type="org.linphone.activities.main.viewmodels.ListTopBarViewModel" />
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ChatRoomCreationContactViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.ChatRoomCreationContactData" />
|
||||
</data>
|
||||
|
||||
<FrameLayout
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.activities.main.chat.viewmodels.DevicesListChildViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.DevicesListChildData" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.activities.main.chat.viewmodels.DevicesListGroupViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.DevicesListGroupData" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<import type="android.graphics.Typeface" />
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.activities.main.chat.viewmodels.EphemeralDurationViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.EphemeralDurationData" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.GroupInfoParticipantViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.GroupInfoParticipantData" />
|
||||
<variable
|
||||
name="isEncrypted"
|
||||
type="Boolean" />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ImdnParticipantViewModel" />
|
||||
type="org.linphone.activities.main.chat.data.ImdnParticipantData" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
Loading…
Reference in a new issue