Moved click to add participants label in meeting edit fragment to top of participants list + prepend newly added participants in picker

This commit is contained in:
Sylvain Berfini 2024-04-29 16:37:28 +02:00
parent b4baddcc5b
commit b4d25b0e6e
5 changed files with 23 additions and 20 deletions

View file

@ -198,6 +198,7 @@ class ConversationInfoFragment : SlidingPaneChildFragment() {
sharedViewModel.listOfSelectedSipUrisEvent.observe(viewLifecycleOwner) {
it.consume { list ->
Log.i("$TAG Found [${list.size}] new participants to add to the group, let's do it")
// TODO FIXME: instead of adding them, replace current list with new one
viewModel.addParticipants(list)
}
}

View file

@ -190,6 +190,7 @@ class EditMeetingFragment : SlidingPaneChildFragment() {
Log.i(
"$TAG Found [${list.size}] new participants to add to the meeting, let's do it"
)
// TODO FIXME: instead of adding them, replace current list with new one
viewModel.addParticipants(list)
}
}

View file

@ -191,6 +191,7 @@ class ScheduleMeetingFragment : GenericFragment() {
Log.i(
"$TAG Found [${list.size}] new participants to add to the meeting, let's do it"
)
// TODO FIXME: instead of adding them, replace current list with new one
viewModel.addParticipants(list)
}
}

View file

@ -137,8 +137,8 @@ abstract class AddressSelectionViewModel @UiThread constructor() : DefaultAccoun
Log.i("$TAG Adding [${model.address.asStringUriOnly()}] address to selection")
val list = arrayListOf<SelectedAddressModel>()
list.addAll(actual)
list.add(model)
list.addAll(actual)
selectionCount.postValue(
AppUtils.getStringWithPlural(

View file

@ -332,23 +332,7 @@
android:src="@drawable/users"
android:visibility="@{viewModel.participants.size() > 0 ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/participants_list" />
<LinearLayout
android:id="@+id/participants_list"
android:onClick="@{pickParticipantsClickListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="16dp"
android:visibility="@{viewModel.participants.size() > 0 ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintTop_toBottomOf="@id/participants"
app:layout_constraintStart_toEndOf="@id/participants_list_icon"
app:layout_constraintEnd_toEndOf="parent"
entries="@{viewModel.participants}"
layout="@{@layout/meeting_schedule_participant_list_cell}"/>
app:layout_constraintTop_toTopOf="@id/add_more_participants" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_300"
@ -360,9 +344,25 @@
android:layout_marginTop="10dp"
android:text="@string/meeting_schedule_add_more_participants_title"
android:visibility="@{viewModel.participants.size() > 0 ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintTop_toBottomOf="@id/participants_list"
app:layout_constraintTop_toBottomOf="@id/participants"
app:layout_constraintStart_toEndOf="@id/participants_list_icon" />
<LinearLayout
android:id="@+id/participants_list"
android:onClick="@{pickParticipantsClickListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="16dp"
android:visibility="@{viewModel.participants.size() > 0 ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintTop_toBottomOf="@id/add_more_participants"
app:layout_constraintStart_toEndOf="@id/participants_list_icon"
app:layout_constraintEnd_toEndOf="parent"
entries="@{viewModel.participants}"
layout="@{@layout/meeting_schedule_participant_list_cell}"/>
<View
android:id="@+id/separator_5"
android:layout_width="0dp"
@ -370,7 +370,7 @@
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/add_more_participants"
app:layout_constraintTop_toBottomOf="@id/participants_list"
android:background="?attr/color_main2_200" />
<com.google.android.material.materialswitch.MaterialSwitch