Added a setting to show past meetings (now hidden by default)

This commit is contained in:
Sylvain Berfini 2026-03-04 11:21:29 +01:00
parent c747bc76c1
commit e14365be17
8 changed files with 74 additions and 1 deletions

View file

@ -32,6 +32,7 @@ Group changes to describe their impact on the project, as follows:
- one to hide contacts that have neither a SIP address nor a phone number
- one to let app auto-answer call with video sending already enabled
- one to let edit native contacts Linphone copy in-app instead of opening native addressbook third party app
- one to show past meetings (they are now hidden by default)
- Added a vu meter for recording & playback volumes (must be enabled in developer settings)
- Added support for HDMI audio devices
- Added video preview during in-call conversation

View file

@ -230,6 +230,13 @@ class CorePreferences
config.setBool("app", "create_e2e_encrypted_conferences", value)
}
@get:AnyThread @set:WorkerThread
var showPastMeetings: Boolean
get() = config.getBool("ui", "show_past_meetings", false)
set(value) {
config.setBool("ui", "show_past_meetings", value)
}
// Contacts related
@get:AnyThread @set:WorkerThread

View file

@ -23,6 +23,7 @@ import androidx.annotation.UiThread
import androidx.annotation.WorkerThread
import androidx.lifecycle.MutableLiveData
import org.linphone.LinphoneApplication.Companion.coreContext
import org.linphone.LinphoneApplication.Companion.corePreferences
import org.linphone.core.Account
import org.linphone.core.AccountListenerStub
import org.linphone.core.ConferenceInfo
@ -114,6 +115,9 @@ class MeetingsListViewModel
fetchInProgress.postValue(true)
}
val showPastMeetings = corePreferences.showPastMeetings
val nowInSecs = System.currentTimeMillis() / 1000
val sortedSource = source.toList().sortedBy {
it.dateTime
}
@ -135,6 +139,14 @@ class MeetingsListViewModel
)
continue
} // This isn't a scheduled conference, don't display it
if (!showPastMeetings && (info.dateTime + (info.duration * 60) < nowInSecs)) {
Log.d(
"$TAG Skipping conference info [${info.subject}] with uri [${info.uri?.asStringUriOnly()}] because it's in the past"
)
continue
}
val add = if (filter.isNotEmpty()) {
val organizerCheck = info.organizer?.asStringUriOnly()?.contains(
filter,

View file

@ -325,6 +325,12 @@ class SettingsFragment : GenericMainFragment() {
binding.tunnelSettings.tunnelModeSpinner.setSelection(index)
}
viewModel.forceRefreshMeetingsListEvent.observe(viewLifecycleOwner) {
it.consume {
sharedViewModel.forceRefreshMeetingsListEvent.postValue(Event(true))
}
}
binding.setTurnOnVfsClickListener {
showConfirmVfsDialog()
}

View file

@ -140,6 +140,11 @@ class SettingsViewModel
// Meetings settings
val showMeetingsSettings = MutableLiveData<Boolean>()
val showPastMeetings = MutableLiveData<Boolean>()
val forceRefreshMeetingsListEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
val defaultLayout = MutableLiveData<Int>()
val availableLayoutsNames = arrayListOf(
AppUtils.getString(R.string.settings_meetings_layout_active_speaker_label),
@ -348,6 +353,7 @@ class SettingsViewModel
hideEmptyContacts.postValue(corePreferences.hideContactsWithoutPhoneNumberOrSipAddress)
presenceSubscribe.postValue(core.isFriendListSubscriptionEnabled)
showPastMeetings.postValue(corePreferences.showPastMeetings)
defaultLayout.postValue(core.defaultConferenceLayout.toInt())
autoShowDialpad.postValue(corePreferences.automaticallyShowDialpad)
@ -663,6 +669,16 @@ class SettingsViewModel
expandMeetings.value = expandMeetings.value == false
}
@UiThread
fun toggleShowPastMeetings() {
val newValue = showPastMeetings.value == false
coreContext.postOnCoreThread {
corePreferences.showPastMeetings = newValue
showPastMeetings.postValue(newValue)
forceRefreshMeetingsListEvent.postValue(Event(true))
}
}
@UiThread
fun setDefaultLayout(layoutValue: Int) {
coreContext.postOnCoreThread { core ->

View file

@ -16,6 +16,35 @@
android:paddingBottom="20dp"
android:background="@drawable/shape_squircle_white_background">
<androidx.appcompat.widget.AppCompatTextView
style="@style/settings_title_style"
android:onClick="@{() -> viewModel.toggleShowPastMeetings()}"
android:id="@+id/show_past_meetings_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="10dp"
android:text="@string/settings_meetings_show_past_meetings_title"
android:maxLines="2"
android:ellipsize="end"
android:labelFor="@id/show_past_meetings_switch"
app:layout_constraintTop_toTopOf="@id/show_past_meetings_switch"
app:layout_constraintBottom_toBottomOf="@id/show_past_meetings_switch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/show_past_meetings_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/show_past_meetings_switch"
android:onClick="@{() -> viewModel.toggleShowPastMeetings()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
android:checked="@{viewModel.showPastMeetings}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/settings_title_padding_style"
android:id="@+id/layout_title"
@ -28,7 +57,7 @@
android:maxLines="2"
android:ellipsize="end"
android:labelFor="@id/layout_spinner"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@id/show_past_meetings_switch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

View file

@ -265,6 +265,7 @@
<string name="settings_contacts_ldap_error_toast">Une erreur s\'est produite, la configuration LDAP n\'a pas été sauvegardée !</string>
<string name="settings_contacts_ldap_empty_field_error_toast">Tous les champs doivent être remplis</string>
<string name="settings_meetings_title">Réunions</string>
<string name="settings_meetings_show_past_meetings_title">Afficher les réunions passées</string>
<string name="settings_meetings_default_layout_title">Disposition par défaut</string>
<string name="settings_meetings_layout_active_speaker_label">Intervenant actif</string>
<string name="settings_meetings_layout_mosaic_label">Mosaïque</string>

View file

@ -307,6 +307,7 @@
<string name="settings_contacts_ldap_error_toast">A error occurred, LDAP server not saved!</string>
<string name="settings_contacts_ldap_empty_field_error_toast">All fields must be filled</string>
<string name="settings_meetings_title">Meetings</string>
<string name="settings_meetings_show_past_meetings_title">Show past meetings</string>
<string name="settings_meetings_default_layout_title">Default layout</string>
<string name="settings_meetings_layout_active_speaker_label">Active speaker</string>
<string name="settings_meetings_layout_mosaic_label">Mosaic</string>