From 303768e2bf19c67c24908567bc97f497bf0d3e44 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 5 Sep 2022 16:30:55 +0200 Subject: [PATCH] Also added slide to delete conference info --- CHANGELOG.md | 4 +- .../fragments/ScheduledConferencesFragment.kt | 62 ++++++++++++++++--- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e34c5b7..9c6ac3258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ Group changes to describe their impact on the project, as follows: - Improved how contact avatars are generated - 3-dots menu even for basic chat rooms with more options - Phone numbers & email addresses are now clickable links in chat messages -- Go to call activity when there is at least one active call and you click on launcher icon +- Go to call activity when you click on launcher icon if there is at least one active call ### Fixed - Multiple file download attempt from the same chat bubble at the same time needed app restart to properly download each file @@ -46,6 +46,8 @@ Group changes to describe their impact on the project, as follows: - Trying to keep the preferred driver (OpenSLES / AAudio) when switching device - Issues when storing presence in native contacts + potentially duplicated SIP addresses in contact details - Chat room scroll position lost when going into sub-view +- No longer makes requests to our LIME server (end-to-end encryption keys server) for non sip.linphone.org accounts +- Fixed incoming call/notification not ringing if Do not Disturb mode is enabled except for favorite contacts ## [4.6.13] - 2022-08-25 diff --git a/app/src/main/java/org/linphone/activities/main/conference/fragments/ScheduledConferencesFragment.kt b/app/src/main/java/org/linphone/activities/main/conference/fragments/ScheduledConferencesFragment.kt index 3ebc5dd26..59c4c46f3 100644 --- a/app/src/main/java/org/linphone/activities/main/conference/fragments/ScheduledConferencesFragment.kt +++ b/app/src/main/java/org/linphone/activities/main/conference/fragments/ScheduledConferencesFragment.kt @@ -25,8 +25,11 @@ import android.content.ClipboardManager import android.content.Context import android.os.Bundle import android.view.View +import androidx.core.content.ContextCompat import androidx.lifecycle.ViewModelProvider +import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import org.linphone.R import org.linphone.activities.main.MainActivity import org.linphone.activities.main.conference.adapters.ScheduledConferencesAdapter @@ -36,15 +39,13 @@ import org.linphone.activities.main.fragments.MasterFragment import org.linphone.activities.main.viewmodels.DialogViewModel import org.linphone.activities.navigateToConferenceScheduling import org.linphone.activities.navigateToConferenceWaitingRoom +import org.linphone.core.tools.Log import org.linphone.databinding.ConferencesScheduledFragmentBinding -import org.linphone.utils.AppUtils -import org.linphone.utils.DialogUtils -import org.linphone.utils.Event -import org.linphone.utils.RecyclerViewHeaderDecoration +import org.linphone.utils.* class ScheduledConferencesFragment : MasterFragment() { override val dialogConfirmationMessageBeforeRemoval = R.plurals.conference_scheduled_delete_dialog - private lateinit var viewModel: ScheduledConferencesViewModel + private lateinit var listViewModel: ScheduledConferencesViewModel override fun getLayoutId(): Int = R.layout.conferences_scheduled_fragment @@ -55,10 +56,10 @@ class ScheduledConferencesFragment : MasterFragment= adapter.currentList.size) { + Log.e("[Scheduled Conferences] Index is out of bound, can't delete conference info") + } else { + viewModel.showCancelButton { + adapter.notifyItemChanged(index) + dialog.dismiss() + } + + viewModel.showDeleteButton( + { + val deletedConfInfo = adapter.currentList[index] + listViewModel.deleteConferenceInfo(deletedConfInfo) + dialog.dismiss() + }, + getString(R.string.dialog_delete) + ) + } + + dialog.show() + } + } + RecyclerViewSwipeUtils(ItemTouchHelper.LEFT, swipeConfiguration, swipeListener) + .attachToRecyclerView(binding.conferenceInfoList) + // Displays date header val headerItemDecoration = RecyclerViewHeaderDecoration(requireContext(), adapter) binding.conferenceInfoList.addItemDecoration(headerItemDecoration) - viewModel.conferences.observe( + listViewModel.conferences.observe( viewLifecycleOwner ) { adapter.submitList(it) @@ -124,7 +166,7 @@ class ScheduledConferencesFragment : MasterFragment