diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2019-03-03 23:30:27 +0300 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2019-03-03 23:30:27 +0300 |
commit | b3970f21efed165b7498b4006c944b5962f24bbb (patch) | |
tree | 10fdf6da68a1c22e788a8d53b547104287631452 | |
parent | 0be72e8b44e27864fc78b91c24c0d9a4929c9c8b (diff) |
wrap with only if changed
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java index e95659c3e..dfd9284be 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java @@ -30,6 +30,7 @@ import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.SupportUtil; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.util.LiveDataHelper; public class UserAutoCompleteAdapter extends BaseAdapter implements Filterable { private Context context; @@ -97,7 +98,9 @@ public class UserAutoCompleteAdapter extends BaseAdapter implements Filterable { protected FilterResults performFiltering(CharSequence constraint) { FilterResults filterResults = new FilterResults(); if (constraint != null) { - syncManager.searchUserByUidOrDisplayName(accountId, constraint.toString()) + LiveDataHelper.onlyIfChanged( + syncManager.searchUserByUidOrDisplayName(accountId, constraint.toString()) + ) .observe(owner, (List<User> users) -> { if (users != null) { filterResults.values = users; |