File tree 1 file changed +6
-9
lines changed
app/src/main/java/com/infomaniak/mail/ui/newMessage
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class ContactAdapter(
43
43
) : Adapter<ContactViewHolder>() {
44
44
45
45
private var allContacts: List <MergedContact > = emptyList()
46
- private var matchedContacts = mutableListOf <MatchedContact >()
46
+ private var matchedContacts = listOf <MatchedContact >()
47
47
48
48
private var displayAddUnknownContactButton = true
49
49
private var searchQuery = " "
@@ -99,12 +99,13 @@ class ContactAdapter(
99
99
}
100
100
101
101
fun clear () {
102
- matchedContacts.clear ()
102
+ matchedContacts = listOf ()
103
103
notifyDataSetChanged()
104
104
}
105
105
106
106
fun searchContacts (text : CharSequence ) {
107
- fun performFiltering (constraint : CharSequence ): MutableList <MatchedContact > {
107
+
108
+ fun performFiltering (constraint : CharSequence ): List <MatchedContact > {
108
109
val searchTerm = constraint.standardize()
109
110
110
111
val finalUserList = mutableListOf<MatchedContact >()
@@ -126,13 +127,9 @@ class ContactAdapter(
126
127
return finalUserList
127
128
}
128
129
129
- fun publishResults (results : MutableList <MatchedContact >) {
130
- matchedContacts = results
131
- notifyDataSetChanged()
132
- }
133
-
134
130
searchQuery = text.toString()
135
- publishResults(performFiltering(text))
131
+ matchedContacts = performFiltering(text)
132
+ notifyDataSetChanged()
136
133
}
137
134
138
135
fun removeUsedEmail (email : String ): Boolean {
You can’t perform that action at this time.
0 commit comments