mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-17 12:58:28 +00:00
Show call transfer icon in calls list shown during call transfer instead of call state
This commit is contained in:
parent
e2db7fe114
commit
4ba4254e46
3 changed files with 9 additions and 3 deletions
|
|
@ -28,12 +28,13 @@ import androidx.lifecycle.findViewTreeLifecycleOwner
|
|||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.linphone.BR.showTransferIcon
|
||||
import org.linphone.R
|
||||
import org.linphone.databinding.CallListCellBinding
|
||||
import org.linphone.ui.call.model.CallModel
|
||||
import org.linphone.utils.Event
|
||||
|
||||
class CallsListAdapter :
|
||||
class CallsListAdapter(private val showTransferIconInsteadOfCallState: Boolean = false) :
|
||||
ListAdapter<CallModel, RecyclerView.ViewHolder>(CallDiffCallback()) {
|
||||
var selectedAdapterPosition = -1
|
||||
|
||||
|
|
@ -55,6 +56,7 @@ class CallsListAdapter :
|
|||
val viewHolder = ViewHolder(binding)
|
||||
binding.apply {
|
||||
lifecycleOwner = parent.findViewTreeLifecycleOwner()
|
||||
showTransferIcon = showTransferIconInsteadOfCallState
|
||||
|
||||
setOnClickListener {
|
||||
callClickedEvent.value = Event(model!!)
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class TransferCallFragment : GenericCallFragment() {
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
callsAdapter = CallsListAdapter()
|
||||
callsAdapter = CallsListAdapter(showTransferIconInsteadOfCallState = true)
|
||||
contactsAdapter = ConversationsContactsAndSuggestionsListAdapter()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
<variable
|
||||
name="model"
|
||||
type="org.linphone.ui.call.model.CallModel" />
|
||||
<variable
|
||||
name="showTransferIcon"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
@ -55,7 +58,7 @@
|
|||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@{model.isPaused ? @drawable/phone_pause : @drawable/phone_call, default=@drawable/phone_pause}"
|
||||
android:src="@{showTransferIcon ? @drawable/phone_transfer : model.isPaused ? @drawable/phone_pause : @drawable/phone_call, default=@drawable/phone_pause}"
|
||||
app:tint="?attr/color_main2_500"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
@ -70,6 +73,7 @@
|
|||
android:text="@{model.state, default=`Paused`}"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:visibility="@{showTransferIcon ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintStart_toEndOf="@id/name"
|
||||
app:layout_constraintEnd_toStartOf="@id/call_state_icon"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue