mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Using recyclerview for call log details to improve performances
This commit is contained in:
parent
5af3a490d4
commit
91b049e3a7
14 changed files with 280 additions and 216 deletions
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2023 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.ui.main.calls.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.linphone.R
|
||||
import org.linphone.databinding.CallHistoryListCellBinding
|
||||
import org.linphone.ui.main.calls.model.CallLogHistoryModel
|
||||
|
||||
class CallHistoryListAdapter(
|
||||
private val viewLifecycleOwner: LifecycleOwner
|
||||
) : ListAdapter<CallLogHistoryModel, RecyclerView.ViewHolder>(CallHistoryDiffCallback()) {
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
val binding: CallHistoryListCellBinding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
R.layout.call_history_list_cell,
|
||||
parent,
|
||||
false
|
||||
)
|
||||
return ViewHolder(binding)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
(holder as CallHistoryListAdapter.ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
val binding: CallHistoryListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
fun bind(callLogHistoryModel: CallLogHistoryModel) {
|
||||
with(binding) {
|
||||
model = callLogHistoryModel
|
||||
|
||||
lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
executePendingBindings()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CallHistoryDiffCallback : DiffUtil.ItemCallback<CallLogHistoryModel>() {
|
||||
override fun areItemsTheSame(oldItem: CallLogHistoryModel, newItem: CallLogHistoryModel): Boolean {
|
||||
return oldItem.id == newItem.id
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: CallLogHistoryModel, newItem: CallLogHistoryModel): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -86,14 +86,14 @@ class CallsListAdapter(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CallLogDiffCallback : DiffUtil.ItemCallback<CallLogModel>() {
|
||||
override fun areItemsTheSame(oldItem: CallLogModel, newItem: CallLogModel): Boolean {
|
||||
return oldItem.id == newItem.id
|
||||
}
|
||||
private class CallLogDiffCallback : DiffUtil.ItemCallback<CallLogModel>() {
|
||||
override fun areItemsTheSame(oldItem: CallLogModel, newItem: CallLogModel): Boolean {
|
||||
return oldItem.id == newItem.id
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: CallLogModel, newItem: CallLogModel): Boolean {
|
||||
return oldItem.avatarModel.id == newItem.avatarModel.id
|
||||
override fun areContentsTheSame(oldItem: CallLogModel, newItem: CallLogModel): Boolean {
|
||||
return oldItem.avatarModel.id == newItem.avatarModel.id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ class SuggestionsListAdapter(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class SuggestionDiffCallback : DiffUtil.ItemCallback<ContactAvatarModel>() {
|
||||
override fun areItemsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return oldItem.friend == newItem.friend
|
||||
}
|
||||
private class SuggestionDiffCallback : DiffUtil.ItemCallback<ContactAvatarModel>() {
|
||||
override fun areItemsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return oldItem.friend == newItem.friend
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return false
|
||||
override fun areContentsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,11 +34,13 @@ import androidx.databinding.DataBindingUtil
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import org.linphone.R
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.CallFragmentBinding
|
||||
import org.linphone.databinding.CallPopupMenuBinding
|
||||
import org.linphone.ui.main.MainActivity
|
||||
import org.linphone.ui.main.calls.adapter.CallHistoryListAdapter
|
||||
import org.linphone.ui.main.calls.viewmodel.CallLogViewModel
|
||||
import org.linphone.ui.main.fragment.GenericFragment
|
||||
import org.linphone.utils.Event
|
||||
|
|
@ -50,8 +52,8 @@ class CallFragment : GenericFragment() {
|
|||
}
|
||||
|
||||
private lateinit var binding: CallFragmentBinding
|
||||
|
||||
private lateinit var viewModel: CallLogViewModel
|
||||
private lateinit var adapter: CallHistoryListAdapter
|
||||
|
||||
private val args: CallFragmentArgs by navArgs()
|
||||
|
||||
|
|
@ -84,6 +86,13 @@ class CallFragment : GenericFragment() {
|
|||
Log.i("$TAG Looking up for call log with call id [$callId]")
|
||||
viewModel.findCallLogByCallId(callId)
|
||||
|
||||
adapter = CallHistoryListAdapter(viewLifecycleOwner)
|
||||
binding.callHistory.setHasFixedSize(true)
|
||||
binding.callHistory.adapter = adapter
|
||||
|
||||
val layoutManager = LinearLayoutManager(requireContext())
|
||||
binding.callHistory.layoutManager = layoutManager
|
||||
|
||||
binding.setBackClickListener {
|
||||
goBack()
|
||||
}
|
||||
|
|
@ -96,13 +105,12 @@ class CallFragment : GenericFragment() {
|
|||
viewModel.showBackButton.value = slideable
|
||||
}
|
||||
|
||||
viewModel.callLogFoundEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.i("$TAG Call log has been found, start postponed enter transition")
|
||||
viewModel.historyCallLogs.observe(viewLifecycleOwner) {
|
||||
Log.i("$TAG Call history list ready with [${it.size}] items")
|
||||
adapter.submitList(it)
|
||||
|
||||
(view.parent as? ViewGroup)?.doOnPreDraw {
|
||||
startPostponedEnterTransition()
|
||||
}
|
||||
(view.parent as? ViewGroup)?.doOnPreDraw {
|
||||
startPostponedEnterTransition()
|
||||
sharedViewModel.openSlidingPaneEvent.value = Event(true)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import org.linphone.utils.LinphoneUtils
|
|||
import org.linphone.utils.TimestampUtils
|
||||
|
||||
class CallLogHistoryModel @WorkerThread constructor(val callLog: CallLog) {
|
||||
val id = callLog.callId ?: callLog.refKey
|
||||
|
||||
val isOutgoing = MutableLiveData<Boolean>()
|
||||
|
||||
val isSuccessful = MutableLiveData<Boolean>()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import org.linphone.utils.TimestampUtils
|
|||
class CallLogModel @WorkerThread constructor(private val callLog: CallLog) {
|
||||
val id = callLog.callId ?: callLog.refKey
|
||||
|
||||
val address = if (callLog.dir == Dir.Outgoing) callLog.remoteAddress else callLog.fromAddress
|
||||
val address = if (callLog.dir == Dir.Outgoing) callLog.toAddress else callLog.fromAddress
|
||||
|
||||
val displayedAddress = address.asStringUriOnly()
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ class CallLogViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
val historyCallLogs = MutableLiveData<ArrayList<CallLogHistoryModel>>()
|
||||
|
||||
val callLogFoundEvent = MutableLiveData<Event<Boolean>>()
|
||||
|
||||
val historyDeletedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
@ -31,6 +29,7 @@ class CallLogViewModel @UiThread constructor() : ViewModel() {
|
|||
val callLog = core.findCallLogFromCallId(callId)
|
||||
if (callLog != null) {
|
||||
val model = CallLogModel(callLog)
|
||||
address = model.address
|
||||
callLogModel.postValue(model)
|
||||
|
||||
val localAddress = if (callLog.dir == Call.Dir.Outgoing) callLog.fromAddress else callLog.toAddress
|
||||
|
|
@ -41,9 +40,6 @@ class CallLogViewModel @UiThread constructor() : ViewModel() {
|
|||
history.add(historyModel)
|
||||
}
|
||||
historyCallLogs.postValue(history)
|
||||
|
||||
address = model.address
|
||||
callLogFoundEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,15 +120,15 @@ class ContactsListAdapter(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ContactDiffCallback : DiffUtil.ItemCallback<ContactAvatarModel>() {
|
||||
override fun areItemsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return oldItem.id == newItem.id
|
||||
}
|
||||
private class ContactDiffCallback : DiffUtil.ItemCallback<ContactAvatarModel>() {
|
||||
override fun areItemsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return oldItem.id == newItem.id
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return oldItem.firstContactStartingByThatLetter.value == newItem.firstContactStartingByThatLetter.value &&
|
||||
oldItem.presenceStatus.value == newItem.presenceStatus.value
|
||||
override fun areContentsTheSame(oldItem: ContactAvatarModel, newItem: ContactAvatarModel): Boolean {
|
||||
return oldItem.firstContactStartingByThatLetter.value == newItem.firstContactStartingByThatLetter.value &&
|
||||
oldItem.presenceStatus.value == newItem.presenceStatus.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ class ContactFragment : GenericFragment() {
|
|||
Log.i("$TAG Contact has been found, start postponed enter transition")
|
||||
(view.parent as? ViewGroup)?.doOnPreDraw {
|
||||
startPostponedEnterTransition()
|
||||
sharedViewModel.openSlidingPaneEvent.value = Event(true)
|
||||
}
|
||||
sharedViewModel.openSlidingPaneEvent.value = Event(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
android:onClick="@{menuClickListener}"
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:src="@drawable/dots_three_vertical"
|
||||
app:tint="@color/white"
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@
|
|||
android:onClick="@{() -> model.openMenu(menu)}"
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/dots_three_vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
|||
|
|
@ -25,11 +25,10 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:onClick="@{backClickListener}"
|
||||
android:visibility="@{viewModel.showBackButton ? View.VISIBLE : View.GONE}"
|
||||
android:src="@drawable/caret_left"
|
||||
|
|
@ -57,203 +56,187 @@
|
|||
android:id="@+id/menu"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:src="@drawable/dots_three_vertical"
|
||||
app:tint="@color/primary_color"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
<View
|
||||
android:id="@+id/background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/gray_7"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/menu"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<io.getstream.avatarview.AvatarView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/avatar_big_size"
|
||||
android:layout_height="@dimen/avatar_big_size"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/shape_avatar_background"
|
||||
contactAvatar="@{viewModel.callLogModel.avatarModel}"
|
||||
app:avatarViewInitialsBackgroundColor="@color/blue_outgoing_message"
|
||||
app:avatarViewInitialsTextColor="@color/gray_9"
|
||||
app:avatarViewInitialsTextSize="21sp"
|
||||
app:avatarViewInitialsTextStyle="bold"
|
||||
app:avatarViewPlaceholder="@drawable/contact_avatar"
|
||||
app:avatarViewShape="circle"
|
||||
app:avatarViewBorderWidth="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/menu" />
|
||||
|
||||
<io.getstream.avatarview.AvatarView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/avatar_big_size"
|
||||
android:layout_height="@dimen/avatar_big_size"
|
||||
android:layout_marginTop="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/shape_avatar_background"
|
||||
contactAvatar="@{viewModel.callLogModel.avatarModel}"
|
||||
app:avatarViewInitialsBackgroundColor="@color/blue_outgoing_message"
|
||||
app:avatarViewInitialsTextColor="@color/gray_9"
|
||||
app:avatarViewInitialsTextSize="21sp"
|
||||
app:avatarViewInitialsTextStyle="bold"
|
||||
app:avatarViewPlaceholder="@drawable/contact_avatar"
|
||||
app:avatarViewShape="circle"
|
||||
app:avatarViewBorderWidth="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<ImageView
|
||||
android:id="@+id/presence_badge"
|
||||
android:layout_width="@dimen/avatar_presence_badge_big_size"
|
||||
android:layout_height="@dimen/avatar_presence_badge_big_size"
|
||||
android:layout_marginEnd="@dimen/avatar_presence_badge_big_end_margin"
|
||||
android:background="@drawable/led_background"
|
||||
android:padding="@dimen/avatar_presence_badge_big_padding"
|
||||
app:presenceIcon="@{viewModel.callLogModel.avatarModel.presenceStatus}"
|
||||
android:visibility="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintEnd_toEndOf="@id/avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/presence_badge"
|
||||
android:layout_width="@dimen/avatar_presence_badge_big_size"
|
||||
android:layout_height="@dimen/avatar_presence_badge_big_size"
|
||||
android:layout_marginEnd="@dimen/avatar_presence_badge_big_end_margin"
|
||||
android:background="@drawable/led_background"
|
||||
android:padding="@dimen/avatar_presence_badge_big_padding"
|
||||
app:presenceIcon="@{viewModel.callLogModel.avatarModel.presenceStatus}"
|
||||
android:visibility="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintEnd_toEndOf="@id/avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@{viewModel.callLogModel.avatarModel.name, default=`John Doe`}"
|
||||
android:textColor="@color/gray_8"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/avatar" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@{viewModel.callLogModel.avatarModel.name, default=`John Doe`}"
|
||||
android:textColor="@color/gray_8"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/avatar" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.callLogModel.displayedAddress, default=`+33601020304`}"
|
||||
android:textColor="@color/gray_8"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/name" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.callLogModel.displayedAddress, default=`+33601020304`}"
|
||||
android:textColor="@color/gray_8"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/name" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/status"
|
||||
android:visibility="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Online ? `En ligne` : `Absent`, default=`En ligne`}"
|
||||
android:textColor="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Online ? @color/green_online : @color/orange_away, default=@color/green_online}"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/address" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/status"
|
||||
android:visibility="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Offline ? View.GONE : View.VISIBLE}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Online ? `En ligne` : `Absent`, default=`En ligne`}"
|
||||
android:textColor="@{viewModel.callLogModel.avatarModel.presenceStatus == ConsolidatedPresence.Online ? @color/green_online : @color/orange_away, default=@color/green_online}"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/address" />
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startAudioCall()}"
|
||||
android:id="@+id/call"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/call_chat_button_background"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/phone"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintEnd_toStartOf="@id/chat"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/status" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startAudioCall()}"
|
||||
android:id="@+id/call"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/call_chat_button_background"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/phone"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintEnd_toStartOf="@id/chat"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/status" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:onClick="@{() -> viewModel.startAudioCall()}"
|
||||
android:id="@+id/call_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Call"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/call"
|
||||
app:layout_constraintStart_toStartOf="@id/call"
|
||||
app:layout_constraintEnd_toEndOf="@id/call"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:onClick="@{() -> viewModel.startAudioCall()}"
|
||||
android:id="@+id/call_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Call"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/call"
|
||||
app:layout_constraintStart_toStartOf="@id/call"
|
||||
app:layout_constraintEnd_toEndOf="@id/call"/>
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.sendMessage()}"
|
||||
android:id="@+id/chat"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/call_chat_button_background"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/chat_dots"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintEnd_toStartOf="@id/video_call"
|
||||
app:layout_constraintStart_toEndOf="@id/call"
|
||||
app:layout_constraintTop_toBottomOf="@id/status" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.sendMessage()}"
|
||||
android:id="@+id/chat"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/call_chat_button_background"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/chat_dots"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintEnd_toStartOf="@id/video_call"
|
||||
app:layout_constraintStart_toEndOf="@id/call"
|
||||
app:layout_constraintTop_toBottomOf="@id/status" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:onClick="@{() -> viewModel.sendMessage()}"
|
||||
android:id="@+id/chat_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Message"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/chat"
|
||||
app:layout_constraintStart_toStartOf="@id/chat"
|
||||
app:layout_constraintEnd_toEndOf="@id/chat"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:onClick="@{() -> viewModel.sendMessage()}"
|
||||
android:id="@+id/chat_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Message"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/chat"
|
||||
app:layout_constraintStart_toStartOf="@id/chat"
|
||||
app:layout_constraintEnd_toEndOf="@id/chat"/>
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startVideoCall()}"
|
||||
android:id="@+id/video_call"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/call_chat_button_background"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/video_camera"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintStart_toEndOf="@id/chat"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/status" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startVideoCall()}"
|
||||
android:id="@+id/video_call"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/call_chat_button_background"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/video_camera"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintStart_toEndOf="@id/chat"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/status" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:onClick="@{() -> viewModel.startVideoCall()}"
|
||||
android:id="@+id/video_call_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Video Call"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/video_call"
|
||||
app:layout_constraintStart_toStartOf="@id/video_call"
|
||||
app:layout_constraintEnd_toEndOf="@id/video_call"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:onClick="@{() -> viewModel.startVideoCall()}"
|
||||
android:id="@+id/video_call_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Video Call"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/video_call"
|
||||
app:layout_constraintStart_toStartOf="@id/video_call"
|
||||
app:layout_constraintEnd_toEndOf="@id/video_call"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/call_history"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:background="@drawable/shape_round_white_background"
|
||||
android:orientation="vertical"
|
||||
entries="@{viewModel.historyCallLogs}"
|
||||
layout="@{@layout/call_history_list_cell}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/call_label"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</ScrollView>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/call_history"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:background="@drawable/shape_round_white_background"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/call_label"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginEnd="17dp">
|
||||
|
||||
|
|
@ -22,7 +21,7 @@
|
|||
android:id="@+id/call_status"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:src="@{model.iconResId, default=@drawable/outgoing_call}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -74,6 +73,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:background="@color/blue_outgoing_message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
android:onClick="@{menuClickListener}"
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:src="@drawable/dots_three_vertical"
|
||||
app:tint="@color/white"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue