mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-21 12:08:29 +00:00
Prevent schedule meeting button being pressed multiple times
This commit is contained in:
parent
e4570f167d
commit
4b99bb15ed
3 changed files with 7 additions and 3 deletions
|
|
@ -373,11 +373,13 @@ class ScheduleMeetingViewModel
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
fun schedule() {
|
fun schedule() {
|
||||||
|
operationInProgress.value = true
|
||||||
if (subject.value.orEmpty().isEmpty() || participants.value.orEmpty().isEmpty()) {
|
if (subject.value.orEmpty().isEmpty() || participants.value.orEmpty().isEmpty()) {
|
||||||
Log.e(
|
Log.e(
|
||||||
"$TAG Either no subject was set or no participant was selected, can't schedule meeting."
|
"$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)
|
showRedToast(R.string.meeting_schedule_mandatory_field_not_filled_toast, R.drawable.warning_circle)
|
||||||
|
operationInProgress.value = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -385,7 +387,6 @@ class ScheduleMeetingViewModel
|
||||||
Log.i(
|
Log.i(
|
||||||
"$TAG Scheduling ${if (isBroadcastSelected.value == true) "broadcast" else "meeting"}"
|
"$TAG Scheduling ${if (isBroadcastSelected.value == true) "broadcast" else "meeting"}"
|
||||||
)
|
)
|
||||||
operationInProgress.postValue(true)
|
|
||||||
|
|
||||||
val localAccount = core.defaultAccount
|
val localAccount = core.defaultAccount
|
||||||
val localAddress = localAccount?.params?.identityAddress
|
val localAddress = localAccount?.params?.identityAddress
|
||||||
|
|
@ -452,17 +453,18 @@ class ScheduleMeetingViewModel
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
fun update() {
|
fun update() {
|
||||||
|
operationInProgress.value = true
|
||||||
|
|
||||||
coreContext.postOnCoreThread { core ->
|
coreContext.postOnCoreThread { core ->
|
||||||
Log.i(
|
Log.i(
|
||||||
"$TAG Updating ${if (isBroadcastSelected.value == true) "broadcast" else "meeting"}"
|
"$TAG Updating ${if (isBroadcastSelected.value == true) "broadcast" else "meeting"}"
|
||||||
)
|
)
|
||||||
if (!::conferenceInfo.isInitialized) {
|
if (!::conferenceInfo.isInitialized) {
|
||||||
Log.e("No conference info to edit found!")
|
Log.e("No conference info to edit found!")
|
||||||
|
operationInProgress.postValue(false)
|
||||||
return@postOnCoreThread
|
return@postOnCoreThread
|
||||||
}
|
}
|
||||||
|
|
||||||
operationInProgress.postValue(true)
|
|
||||||
|
|
||||||
conferenceInfo.subject = subject.value
|
conferenceInfo.subject = subject.value
|
||||||
conferenceInfo.description = description.value
|
conferenceInfo.description = description.value
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -397,6 +397,7 @@
|
||||||
android:layout_gravity="end|bottom"
|
android:layout_gravity="end|bottom"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:src="@drawable/check"
|
android:src="@drawable/check"
|
||||||
|
android:enabled="@{!viewModel.operationInProgress}"
|
||||||
android:contentDescription="@string/content_description_meeting_schedule"
|
android:contentDescription="@string/content_description_meeting_schedule"
|
||||||
app:tint="?attr/color_on_main"
|
app:tint="?attr/color_on_main"
|
||||||
app:backgroundTint="?attr/color_main1_500"
|
app:backgroundTint="?attr/color_main1_500"
|
||||||
|
|
|
||||||
|
|
@ -543,6 +543,7 @@
|
||||||
android:layout_gravity="end|bottom"
|
android:layout_gravity="end|bottom"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:src="@drawable/check"
|
android:src="@drawable/check"
|
||||||
|
android:enabled="@{!viewModel.operationInProgress}"
|
||||||
android:contentDescription="@string/content_description_meeting_schedule"
|
android:contentDescription="@string/content_description_meeting_schedule"
|
||||||
app:tint="?attr/color_on_main"
|
app:tint="?attr/color_on_main"
|
||||||
app:backgroundTint="?attr/color_main1_500"
|
app:backgroundTint="?attr/color_main1_500"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue