-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract adapter creation from ContactSearchMediator.
- Loading branch information
1 parent
13f969b
commit 8f49323
Showing
3 changed files
with
76 additions
and
30 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.thoughtcrime.securesms.contacts.paged | ||
|
||
import android.view.View | ||
import org.thoughtcrime.securesms.util.adapter.mapping.PagingMappingAdapter | ||
|
||
/** | ||
* Default contact search adapter, using the models defined in `ContactSearchItems` | ||
*/ | ||
class ContactSearchAdapter( | ||
displayCheckBox: Boolean, | ||
displaySmsTag: ContactSearchItems.DisplaySmsTag, | ||
recipientListener: (View, ContactSearchData.KnownRecipient, Boolean) -> Unit, | ||
storyListener: (View, ContactSearchData.Story, Boolean) -> Unit, | ||
storyContextMenuCallbacks: ContactSearchItems.StoryContextMenuCallbacks, | ||
expandListener: (ContactSearchData.Expand) -> Unit | ||
) : PagingMappingAdapter<ContactSearchKey>() { | ||
init { | ||
ContactSearchItems.registerStoryItems(this, displayCheckBox, storyListener, storyContextMenuCallbacks) | ||
ContactSearchItems.registerKnownRecipientItems(this, displayCheckBox, displaySmsTag, recipientListener) | ||
ContactSearchItems.registerHeaders(this) | ||
ContactSearchItems.registerExpands(this, expandListener) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters