mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Show operation in progress during contact search
This commit is contained in:
parent
99870eced2
commit
533957ae8a
9 changed files with 71 additions and 2 deletions
|
|
@ -61,6 +61,8 @@ class ContactsListViewModel
|
|||
|
||||
val isListFiltered = MutableLiveData<Boolean>()
|
||||
|
||||
val searchInProgress = MutableLiveData<Boolean>()
|
||||
|
||||
val isDefaultAccountLinphone = MutableLiveData<Boolean>()
|
||||
|
||||
val vCardTerminatedEvent: MutableLiveData<Event<Pair<String, File>>> by lazy {
|
||||
|
|
@ -255,6 +257,7 @@ class ContactsListViewModel
|
|||
Log.i(
|
||||
"$TAG Asking Magic search for contacts matching filter [$filter], domain [$domain] and in sources Friends/LDAP/CardDAV"
|
||||
)
|
||||
searchInProgress.postValue(filter.isNotEmpty())
|
||||
magicSearch.getContactsListAsync(
|
||||
filter,
|
||||
domain,
|
||||
|
|
@ -324,6 +327,7 @@ class ContactsListViewModel
|
|||
collator.compare(model1.friend.name, model2.friend.name)
|
||||
}
|
||||
|
||||
searchInProgress.postValue(false)
|
||||
favourites.postValue(favouritesList)
|
||||
contactsList.postValue(list)
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ abstract class AddressSelectionViewModel
|
|||
|
||||
val searchFilter = MutableLiveData<String>()
|
||||
|
||||
val searchInProgress = MutableLiveData<Boolean>()
|
||||
|
||||
val modelsList = MutableLiveData<ArrayList<ConversationContactOrSuggestionModel>>()
|
||||
|
||||
val isEmpty = MutableLiveData<Boolean>()
|
||||
|
|
@ -238,6 +240,7 @@ abstract class AddressSelectionViewModel
|
|||
Log.i(
|
||||
"$TAG Asking Magic search for contacts matching filter [$filter], domain [$domain] and in sources [$sources]"
|
||||
)
|
||||
searchInProgress.postValue(filter.isNotEmpty())
|
||||
magicSearch.getContactsListAsync(
|
||||
filter,
|
||||
domain,
|
||||
|
|
@ -322,6 +325,8 @@ abstract class AddressSelectionViewModel
|
|||
list.addAll(favoritesList)
|
||||
list.addAll(contactsList)
|
||||
list.addAll(suggestionsList)
|
||||
|
||||
searchInProgress.postValue(false)
|
||||
modelsList.postValue(list)
|
||||
isEmpty.postValue(list.isEmpty())
|
||||
Log.i(
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="@{viewModel.fetchInProgress ? View.VISIBLE : View.GONE}"
|
||||
android:visibility="@{viewModel.fetchInProgress || viewModel.searchInProgress ? View.VISIBLE : View.GONE}"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
|||
|
|
@ -202,6 +202,18 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/fetch_in_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="@{viewModel.searchInProgress ? View.VISIBLE : View.GONE}"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
|
|
|
|||
|
|
@ -109,6 +109,18 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/fetch_in_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="@{viewModel.searchInProgress ? View.VISIBLE : View.GONE}"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="@{viewModel.fetchInProgress ? View.VISIBLE : View.GONE}"
|
||||
android:visibility="@{viewModel.fetchInProgress || viewModel.searchInProgress ? View.VISIBLE : View.GONE}"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
|||
|
|
@ -166,6 +166,18 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/fetch_in_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="@{viewModel.searchInProgress ? View.VISIBLE : View.GONE}"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/add_participants"
|
||||
android:onClick="@{() -> viewModel.addParticipants()}"
|
||||
|
|
|
|||
|
|
@ -251,6 +251,18 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/group_call_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/fetch_in_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="@{viewModel.searchInProgress ? View.VISIBLE : View.GONE}"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/group_call_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/create_group"
|
||||
android:onClick="@{askForGroupCallSubjectClickListener}"
|
||||
|
|
|
|||
|
|
@ -233,6 +233,18 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/group_chat_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/fetch_in_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="@{viewModel.searchInProgress ? View.VISIBLE : View.GONE}"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/group_chat_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/create_group"
|
||||
android:onClick="@{askForGroupConversationSubjectClickListener}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue