diff --git a/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/ScheduleMeetingViewModel.kt b/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/ScheduleMeetingViewModel.kt index 160ffd51a..1302689fc 100644 --- a/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/ScheduleMeetingViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/ScheduleMeetingViewModel.kt @@ -373,11 +373,13 @@ class ScheduleMeetingViewModel @UiThread fun schedule() { + operationInProgress.value = true if (subject.value.orEmpty().isEmpty() || participants.value.orEmpty().isEmpty()) { Log.e( "$TAG Either no subject was set or no participant was selected, can't schedule meeting." ) showRedToast(R.string.meeting_schedule_mandatory_field_not_filled_toast, R.drawable.warning_circle) + operationInProgress.value = false return } @@ -385,7 +387,6 @@ class ScheduleMeetingViewModel Log.i( "$TAG Scheduling ${if (isBroadcastSelected.value == true) "broadcast" else "meeting"}" ) - operationInProgress.postValue(true) val localAccount = core.defaultAccount val localAddress = localAccount?.params?.identityAddress @@ -452,17 +453,18 @@ class ScheduleMeetingViewModel @UiThread fun update() { + operationInProgress.value = true + coreContext.postOnCoreThread { core -> Log.i( "$TAG Updating ${if (isBroadcastSelected.value == true) "broadcast" else "meeting"}" ) if (!::conferenceInfo.isInitialized) { Log.e("No conference info to edit found!") + operationInProgress.postValue(false) return@postOnCoreThread } - operationInProgress.postValue(true) - conferenceInfo.subject = subject.value conferenceInfo.description = description.value diff --git a/app/src/main/res/layout/meeting_edit_fragment.xml b/app/src/main/res/layout/meeting_edit_fragment.xml index 972fc5b51..21800ace3 100644 --- a/app/src/main/res/layout/meeting_edit_fragment.xml +++ b/app/src/main/res/layout/meeting_edit_fragment.xml @@ -397,6 +397,7 @@ android:layout_gravity="end|bottom" android:layout_margin="16dp" android:src="@drawable/check" + android:enabled="@{!viewModel.operationInProgress}" android:contentDescription="@string/content_description_meeting_schedule" app:tint="?attr/color_on_main" app:backgroundTint="?attr/color_main1_500" diff --git a/app/src/main/res/layout/meeting_schedule_fragment.xml b/app/src/main/res/layout/meeting_schedule_fragment.xml index 09edb393f..55b8b3573 100644 --- a/app/src/main/res/layout/meeting_schedule_fragment.xml +++ b/app/src/main/res/layout/meeting_schedule_fragment.xml @@ -543,6 +543,7 @@ android:layout_gravity="end|bottom" android:layout_margin="16dp" android:src="@drawable/check" + android:enabled="@{!viewModel.operationInProgress}" android:contentDescription="@string/content_description_meeting_schedule" app:tint="?attr/color_on_main" app:backgroundTint="?attr/color_main1_500"