Show organizer in conference history details
This commit is contained in:
parent
f4c89fbb2c
commit
0aca41b927
6 changed files with 83 additions and 44 deletions
|
@ -25,7 +25,8 @@ import org.linphone.utils.LinphoneUtils
|
|||
|
||||
class ConferenceSchedulingParticipantData(
|
||||
private val sipAddress: Address,
|
||||
val showLimeBadge: Boolean
|
||||
val showLimeBadge: Boolean = false,
|
||||
val showDivider: Boolean = true
|
||||
) :
|
||||
GenericContactData(sipAddress) {
|
||||
val sipUri: String get() = LinphoneUtils.getDisplayableAddress(sipAddress)
|
||||
|
|
|
@ -116,6 +116,7 @@ class CallLogViewModel(val callLog: CallLog, private val isRelated: Boolean = fa
|
|||
|
||||
val conferenceSubject = callLog.conferenceInfo?.subject
|
||||
val conferenceParticipantsData = MutableLiveData<ArrayList<ConferenceSchedulingParticipantData>>()
|
||||
val organizerParticipantData = MutableLiveData<ConferenceSchedulingParticipantData>()
|
||||
val conferenceTime = MutableLiveData<String>()
|
||||
val conferenceDate = MutableLiveData<String>()
|
||||
|
||||
|
@ -152,9 +153,14 @@ class CallLogViewModel(val callLog: CallLog, private val isRelated: Boolean = fa
|
|||
hideYear = false
|
||||
)
|
||||
}
|
||||
val organizer = conferenceInfo.organizer
|
||||
if (organizer != null) {
|
||||
organizerParticipantData.value =
|
||||
ConferenceSchedulingParticipantData(organizer, showLimeBadge = false, showDivider = false)
|
||||
}
|
||||
val list = arrayListOf<ConferenceSchedulingParticipantData>()
|
||||
for (participant in conferenceInfo.participants) {
|
||||
list.add(ConferenceSchedulingParticipantData(participant, false))
|
||||
list.add(ConferenceSchedulingParticipantData(participant, showLimeBadge = false, showDivider = true))
|
||||
}
|
||||
conferenceParticipantsData.value = list
|
||||
}
|
||||
|
@ -169,6 +175,7 @@ class CallLogViewModel(val callLog: CallLog, private val isRelated: Boolean = fa
|
|||
fun destroy() {
|
||||
if (!isRelated) {
|
||||
relatedCallLogs.value.orEmpty().forEach(CallLogViewModel::destroy)
|
||||
organizerParticipantData.value?.destroy()
|
||||
conferenceParticipantsData.value.orEmpty()
|
||||
.forEach(ConferenceSchedulingParticipantData::destroy)
|
||||
}
|
||||
|
|
|
@ -107,6 +107,7 @@ class ConferenceParticipantDeviceData(
|
|||
|
||||
activeSpeaker.value = false
|
||||
micMuted.value = participantDevice.isMuted
|
||||
|
||||
videoAvailable.value = participantDevice.getStreamAvailability(StreamType.Video)
|
||||
val videoCapability = participantDevice.getStreamCapability(StreamType.Video)
|
||||
videoSendReceive.value = videoCapability == MediaDirection.SendRecv
|
||||
|
@ -120,7 +121,7 @@ class ConferenceParticipantDeviceData(
|
|||
videoEnabled.value = isVideoAvailableAndSendReceive()
|
||||
}
|
||||
|
||||
Log.i("[Conference Participant Device] Participant [${participantDevice.address.asStringUriOnly()}], is in conf? ${isInConference.value}, is video available? ${videoAvailable.value} ($videoCapability)")
|
||||
Log.i("[Conference Participant Device] Participant [${participantDevice.address.asStringUriOnly()}], is in conf? ${isInConference.value}, is video available? ${videoAvailable.value} ($videoCapability), is mic muted? ${micMuted.value}")
|
||||
}
|
||||
|
||||
override fun destroy() {
|
||||
|
|
|
@ -4,10 +4,13 @@
|
|||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="data"
|
||||
type="org.linphone.activities.main.conference.data.ConferenceSchedulingParticipantData" />
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -18,17 +21,17 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp">
|
||||
android:layout_marginRight="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.linphone.contact.ContactAvatarView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
tools:layout="@layout/contact_avatar"
|
||||
app:data="@{data}"
|
||||
app:showLimeCapability="@{data.showLimeBadge}"
|
||||
app:data="@{data}"/>
|
||||
tools:layout="@layout/contact_avatar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
|
@ -38,21 +41,21 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:text="@{data.contact.fullName ?? data.displayName}"
|
||||
style="@style/contact_name_list_cell_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|left"
|
||||
android:lines="1" />
|
||||
android:lines="1"
|
||||
android:text="@{data.contact.fullName ?? data.displayName}" />
|
||||
|
||||
<TextView
|
||||
android:text="@{data.sipUri}"
|
||||
style="@style/conference_scheduling_participant_sip_uri_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="bottom|left"
|
||||
android:lines="1" />
|
||||
android:lines="1"
|
||||
android:text="@{data.sipUri}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -61,8 +64,9 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/dividerColor"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
android:visibility="@{data.showDivider ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -3,19 +3,25 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="backClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<variable
|
||||
name="newContactClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<variable
|
||||
name="contactClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.history.viewmodels.CallLogViewModel" />
|
||||
|
||||
<variable
|
||||
name="sharedMainViewModel"
|
||||
type="org.linphone.activities.main.viewmodels.SharedMainViewModel" />
|
||||
|
@ -35,23 +41,23 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:onClick="@{backClickListener}"
|
||||
android:visibility="@{sharedMainViewModel.isSlidingPaneSlideable ? View.VISIBLE : View.GONE}"
|
||||
android:contentDescription="@string/content_description_go_back"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:contentDescription="@string/content_description_go_back"
|
||||
android:onClick="@{backClickListener}"
|
||||
android:padding="18dp"
|
||||
android:src="@drawable/back" />
|
||||
android:src="@drawable/back"
|
||||
android:visibility="@{sharedMainViewModel.isSlidingPaneSlideable ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<TextView
|
||||
style="@style/calls_list_header_font"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
style="@style/calls_list_header_font"
|
||||
android:text="@{viewModel.conferenceSubject, default=`Conference subject`}"/>
|
||||
android:text="@{viewModel.conferenceSubject, default=`Conference subject`}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -66,30 +72,30 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/conference_scheduling_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/conference_scheduling_font"
|
||||
android:text="@string/conference_schedule_date"/>
|
||||
android:text="@string/conference_schedule_date" />
|
||||
|
||||
<TextView
|
||||
style="@style/conference_scheduling_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
style="@style/conference_scheduling_font"
|
||||
android:background="?attr/voipFormDisabledFieldBackgroundColor"
|
||||
android:padding="10dp"
|
||||
android:text="@{viewModel.conferenceDate}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -97,23 +103,23 @@
|
|||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/conference_scheduling_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/conference_scheduling_font"
|
||||
android:text="@string/conference_schedule_time"/>
|
||||
android:text="@string/conference_schedule_time" />
|
||||
|
||||
<TextView
|
||||
style="@style/conference_scheduling_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
style="@style/conference_scheduling_font"
|
||||
android:background="?attr/voipFormDisabledFieldBackgroundColor"
|
||||
android:padding="10dp"
|
||||
android:text="@{viewModel.conferenceTime}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -127,12 +133,31 @@
|
|||
android:background="?attr/voipFormBackgroundColor">
|
||||
|
||||
<TextView
|
||||
style="@style/calls_list_header_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:padding="5dp"
|
||||
android:text="@string/conference_organizer" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/conference_scheduling_participant_cell"
|
||||
app:data="@{viewModel.organizerParticipantData}" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/voipFormBackgroundColor">
|
||||
|
||||
<TextView
|
||||
style="@style/calls_list_header_font"
|
||||
android:text="@string/conference_schedule_participants_list"/>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:padding="5dp"
|
||||
android:text="@string/conference_schedule_participants_list" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -151,19 +176,19 @@
|
|||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
style="@style/big_orange_button_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/shape_rect_orange_button"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/shape_rect_orange_button"
|
||||
android:text="@string/conference_go_to_chat"
|
||||
style="@style/big_orange_button_font"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -252,6 +252,7 @@
|
|||
<string name="conference_schedule_encryption">Would you like to encrypt the conference?</string>
|
||||
<string name="conference_schedule_send_invite_chat_summary">Invite will be sent out from my &appName; account</string>
|
||||
<string name="conference_schedule_participants_list">Participants list</string>
|
||||
<string name="conference_organizer">Organizer</string>
|
||||
<string name="conference_schedule_summary">Conference info</string>
|
||||
<string name="conference_schedule_create">Create conference</string>
|
||||
<string name="conference_schedule">Schedule conference</string>
|
||||
|
|
Loading…
Reference in a new issue