mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-18 06:08:29 +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 isListFiltered = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
|
val searchInProgress = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
val isDefaultAccountLinphone = MutableLiveData<Boolean>()
|
val isDefaultAccountLinphone = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
val vCardTerminatedEvent: MutableLiveData<Event<Pair<String, File>>> by lazy {
|
val vCardTerminatedEvent: MutableLiveData<Event<Pair<String, File>>> by lazy {
|
||||||
|
|
@ -255,6 +257,7 @@ class ContactsListViewModel
|
||||||
Log.i(
|
Log.i(
|
||||||
"$TAG Asking Magic search for contacts matching filter [$filter], domain [$domain] and in sources Friends/LDAP/CardDAV"
|
"$TAG Asking Magic search for contacts matching filter [$filter], domain [$domain] and in sources Friends/LDAP/CardDAV"
|
||||||
)
|
)
|
||||||
|
searchInProgress.postValue(filter.isNotEmpty())
|
||||||
magicSearch.getContactsListAsync(
|
magicSearch.getContactsListAsync(
|
||||||
filter,
|
filter,
|
||||||
domain,
|
domain,
|
||||||
|
|
@ -324,6 +327,7 @@ class ContactsListViewModel
|
||||||
collator.compare(model1.friend.name, model2.friend.name)
|
collator.compare(model1.friend.name, model2.friend.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
searchInProgress.postValue(false)
|
||||||
favourites.postValue(favouritesList)
|
favourites.postValue(favouritesList)
|
||||||
contactsList.postValue(list)
|
contactsList.postValue(list)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@ abstract class AddressSelectionViewModel
|
||||||
|
|
||||||
val searchFilter = MutableLiveData<String>()
|
val searchFilter = MutableLiveData<String>()
|
||||||
|
|
||||||
|
val searchInProgress = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
val modelsList = MutableLiveData<ArrayList<ConversationContactOrSuggestionModel>>()
|
val modelsList = MutableLiveData<ArrayList<ConversationContactOrSuggestionModel>>()
|
||||||
|
|
||||||
val isEmpty = MutableLiveData<Boolean>()
|
val isEmpty = MutableLiveData<Boolean>()
|
||||||
|
|
@ -238,6 +240,7 @@ abstract class AddressSelectionViewModel
|
||||||
Log.i(
|
Log.i(
|
||||||
"$TAG Asking Magic search for contacts matching filter [$filter], domain [$domain] and in sources [$sources]"
|
"$TAG Asking Magic search for contacts matching filter [$filter], domain [$domain] and in sources [$sources]"
|
||||||
)
|
)
|
||||||
|
searchInProgress.postValue(filter.isNotEmpty())
|
||||||
magicSearch.getContactsListAsync(
|
magicSearch.getContactsListAsync(
|
||||||
filter,
|
filter,
|
||||||
domain,
|
domain,
|
||||||
|
|
@ -322,6 +325,8 @@ abstract class AddressSelectionViewModel
|
||||||
list.addAll(favoritesList)
|
list.addAll(favoritesList)
|
||||||
list.addAll(contactsList)
|
list.addAll(contactsList)
|
||||||
list.addAll(suggestionsList)
|
list.addAll(suggestionsList)
|
||||||
|
|
||||||
|
searchInProgress.postValue(false)
|
||||||
modelsList.postValue(list)
|
modelsList.postValue(list)
|
||||||
isEmpty.postValue(list.isEmpty())
|
isEmpty.postValue(list.isEmpty())
|
||||||
Log.i(
|
Log.i(
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
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:indicatorColor="?attr/color_main1_500"
|
||||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,18 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||||
app:layout_constraintBottom_toBottomOf="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>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,18 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="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>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
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:indicatorColor="?attr/color_main1_500"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,18 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||||
app:layout_constraintBottom_toBottomOf="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" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/add_participants"
|
android:id="@+id/add_participants"
|
||||||
android:onClick="@{() -> viewModel.addParticipants()}"
|
android:onClick="@{() -> viewModel.addParticipants()}"
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,18 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/group_call_icon"
|
app:layout_constraintTop_toBottomOf="@id/group_call_icon"
|
||||||
app:layout_constraintBottom_toBottomOf="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/group_call_icon"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/create_group"
|
android:id="@+id/create_group"
|
||||||
android:onClick="@{askForGroupCallSubjectClickListener}"
|
android:onClick="@{askForGroupCallSubjectClickListener}"
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,18 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/group_chat_icon"
|
app:layout_constraintTop_toBottomOf="@id/group_chat_icon"
|
||||||
app:layout_constraintBottom_toBottomOf="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/group_chat_icon"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/create_group"
|
android:id="@+id/create_group"
|
||||||
android:onClick="@{askForGroupConversationSubjectClickListener}"
|
android:onClick="@{askForGroupConversationSubjectClickListener}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue