mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-29 23:26:25 +00:00
Show cancelled meetings in list + fixed scroll to today
This commit is contained in:
parent
5c77b58154
commit
4d190cabdd
7 changed files with 40 additions and 5 deletions
|
|
@ -128,12 +128,16 @@ class MeetingsListFragment : AbstractMainFragment() {
|
||||||
|
|
||||||
adapter.meetingClickedEvent.observe(viewLifecycleOwner) {
|
adapter.meetingClickedEvent.observe(viewLifecycleOwner) {
|
||||||
it.consume { model ->
|
it.consume { model ->
|
||||||
Log.i("$TAG Show conversation with ID [${model.id}]")
|
if (model.isCancelled) {
|
||||||
|
Log.w("$TAG Meeting with ID [${model.id}] is cancelled, can't show the details")
|
||||||
|
} else {
|
||||||
|
Log.i("$TAG Show meeting with ID [${model.id}]")
|
||||||
sharedViewModel.displayedMeeting = model.conferenceInfo
|
sharedViewModel.displayedMeeting = model.conferenceInfo
|
||||||
val action = MeetingFragmentDirections.actionGlobalMeetingFragment(model.id)
|
val action = MeetingFragmentDirections.actionGlobalMeetingFragment(model.id)
|
||||||
binding.meetingsNavContainer.findNavController().navigate(action)
|
binding.meetingsNavContainer.findNavController().navigate(action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
listViewModel.meetings.observe(viewLifecycleOwner) {
|
listViewModel.meetings.observe(viewLifecycleOwner) {
|
||||||
val currentCount = adapter.itemCount
|
val currentCount = adapter.itemCount
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class MeetingListItemModel @WorkerThread constructor(
|
||||||
meetingModel: MeetingModel?,
|
meetingModel: MeetingModel?,
|
||||||
val firstMeetingOfTheWeek: Boolean
|
val firstMeetingOfTheWeek: Boolean
|
||||||
) {
|
) {
|
||||||
val isToday = meetingModel == null
|
val isToday = meetingModel == null || meetingModel.isToday
|
||||||
|
|
||||||
val month = meetingModel?.month ?: TimestampUtils.month(System.currentTimeMillis(), false)
|
val month = meetingModel?.month ?: TimestampUtils.month(System.currentTimeMillis(), false)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@ class MeetingModel @WorkerThread constructor(val conferenceInfo: ConferenceInfo)
|
||||||
|
|
||||||
val firstMeetingOfTheWeek = MutableLiveData<Boolean>()
|
val firstMeetingOfTheWeek = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
|
val isCancelled = conferenceInfo.state == ConferenceInfo.State.Cancelled
|
||||||
|
|
||||||
init {
|
init {
|
||||||
subject.postValue(conferenceInfo.subject)
|
subject.postValue(conferenceInfo.subject)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@ class MeetingViewModel @UiThread constructor() : GenericViewModel() {
|
||||||
|
|
||||||
val participants = MutableLiveData<ArrayList<ParticipantModel>>()
|
val participants = MutableLiveData<ArrayList<ParticipantModel>>()
|
||||||
|
|
||||||
|
val isCancelled = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
val conferenceInfoFoundEvent = MutableLiveData<Event<Boolean>>()
|
val conferenceInfoFoundEvent = MutableLiveData<Event<Boolean>>()
|
||||||
|
|
||||||
val startTimeStamp = MutableLiveData<Long>()
|
val startTimeStamp = MutableLiveData<Long>()
|
||||||
|
|
@ -212,6 +214,10 @@ class MeetingViewModel @UiThread constructor() : GenericViewModel() {
|
||||||
sipUri.postValue(conferenceInfo.uri?.asStringUriOnly() ?: "")
|
sipUri.postValue(conferenceInfo.uri?.asStringUriOnly() ?: "")
|
||||||
description.postValue(conferenceInfo.description)
|
description.postValue(conferenceInfo.description)
|
||||||
|
|
||||||
|
val state = conferenceInfo.state
|
||||||
|
Log.i("$TAG Conference info is in state [$state]")
|
||||||
|
isCancelled.postValue(state == ConferenceInfo.State.Cancelled)
|
||||||
|
|
||||||
val timestamp = conferenceInfo.dateTime
|
val timestamp = conferenceInfo.dateTime
|
||||||
val duration = conferenceInfo.duration
|
val duration = conferenceInfo.duration
|
||||||
val date = TimestampUtils.toString(
|
val date = TimestampUtils.toString(
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,27 @@
|
||||||
android:textColor="?attr/color_main2_500"
|
android:textColor="?attr/color_main2_500"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:visibility="@{model.isCancelled ? View.GONE : View.VISIBLE}"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/default_text_style_600"
|
||||||
|
android:id="@+id/cancelled"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:text="@string/meeting_info_cancelled"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="?attr/color_danger_500"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="@{model.isCancelled ? View.VISIBLE : View.GONE, default=gone}"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/title"
|
app:layout_constraintTop_toBottomOf="@id/title"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|
|
||||||
|
|
@ -535,6 +535,7 @@
|
||||||
<string name="meeting_info_created_toast">La réunion a été créée</string>
|
<string name="meeting_info_created_toast">La réunion a été créée</string>
|
||||||
<string name="meeting_info_updated_toast">La réunion a été mise à jour</string>
|
<string name="meeting_info_updated_toast">La réunion a été mise à jour</string>
|
||||||
<string name="meeting_info_cancelled_toast">La réunion a été annulée</string>
|
<string name="meeting_info_cancelled_toast">La réunion a été annulée</string>
|
||||||
|
<string name="meeting_info_cancelled">Réunion annulée</string>
|
||||||
<string name="meeting_failed_to_schedule_toast">Échec de la création de la réunion !</string>
|
<string name="meeting_failed_to_schedule_toast">Échec de la création de la réunion !</string>
|
||||||
<string name="meeting_schedule_mandatory_field_not_filled_toast">Au moins un champ obligatoire n\'a pas été rempli</string>
|
<string name="meeting_schedule_mandatory_field_not_filled_toast">Au moins un champ obligatoire n\'a pas été rempli</string>
|
||||||
<string name="meeting_failed_to_send_invites_toast">Échec de l\'envoi des invitations à la réunion !</string>
|
<string name="meeting_failed_to_send_invites_toast">Échec de l\'envoi des invitations à la réunion !</string>
|
||||||
|
|
|
||||||
|
|
@ -573,6 +573,7 @@
|
||||||
<string name="meeting_info_created_toast">Meeting has been created</string>
|
<string name="meeting_info_created_toast">Meeting has been created</string>
|
||||||
<string name="meeting_info_updated_toast">Meeting has been updated</string>
|
<string name="meeting_info_updated_toast">Meeting has been updated</string>
|
||||||
<string name="meeting_info_cancelled_toast">Meeting has been cancelled</string>
|
<string name="meeting_info_cancelled_toast">Meeting has been cancelled</string>
|
||||||
|
<string name="meeting_info_cancelled">Meeting cancelled</string>
|
||||||
<string name="meeting_failed_to_schedule_toast">Failed to schedule meeting!</string>
|
<string name="meeting_failed_to_schedule_toast">Failed to schedule meeting!</string>
|
||||||
<string name="meeting_schedule_mandatory_field_not_filled_toast">A least a mandatory field wasn\'t filled</string>
|
<string name="meeting_schedule_mandatory_field_not_filled_toast">A least a mandatory field wasn\'t filled</string>
|
||||||
<string name="meeting_failed_to_send_invites_toast">Failed to send all invites to meeting!</string>
|
<string name="meeting_failed_to_send_invites_toast">Failed to send all invites to meeting!</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue