mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
Add debounce/minimum length for add user search (#387)
This functionality was already implemented, it just didn't have the right parameters configured for the user list presenter. Closes #109
This commit is contained in:
+5
-1
@@ -35,7 +35,11 @@ class AddPeoplePresenter @Inject constructor(
|
|||||||
|
|
||||||
private val userListPresenter by lazy {
|
private val userListPresenter by lazy {
|
||||||
userListPresenterFactory.create(
|
userListPresenterFactory.create(
|
||||||
UserListPresenterArgs(selectionMode = SelectionMode.Multiple),
|
UserListPresenterArgs(
|
||||||
|
selectionMode = SelectionMode.Multiple,
|
||||||
|
minimumSearchLength = 3,
|
||||||
|
searchDebouncePeriodMillis = UserListPresenterArgs.DEFAULT_DEBOUNCE
|
||||||
|
),
|
||||||
userListDataSource,
|
userListDataSource,
|
||||||
dataStore.selectedUserListDataStore,
|
dataStore.selectedUserListDataStore,
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ class CreateRoomRootPresenter @Inject constructor(
|
|||||||
UserListPresenterArgs(
|
UserListPresenterArgs(
|
||||||
selectionMode = SelectionMode.Single,
|
selectionMode = SelectionMode.Single,
|
||||||
minimumSearchLength = 3,
|
minimumSearchLength = 3,
|
||||||
searchDebouncePeriodMillis = 500,
|
searchDebouncePeriodMillis = UserListPresenterArgs.DEFAULT_DEBOUNCE,
|
||||||
),
|
),
|
||||||
userListDataSource,
|
userListDataSource,
|
||||||
userListDataStore,
|
userListDataStore,
|
||||||
|
|||||||
+7
-2
@@ -19,8 +19,13 @@ package io.element.android.features.userlist.api
|
|||||||
data class UserListPresenterArgs(
|
data class UserListPresenterArgs(
|
||||||
val selectionMode: SelectionMode,
|
val selectionMode: SelectionMode,
|
||||||
val minimumSearchLength: Int = 1,
|
val minimumSearchLength: Int = 1,
|
||||||
val searchDebouncePeriodMillis: Long = 0,
|
val searchDebouncePeriodMillis: Long = NO_DEBOUNCE,
|
||||||
)
|
) {
|
||||||
|
companion object {
|
||||||
|
const val NO_DEBOUNCE = 0L
|
||||||
|
const val DEFAULT_DEBOUNCE = 500L
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enum class SelectionMode {
|
enum class SelectionMode {
|
||||||
Single,
|
Single,
|
||||||
|
|||||||
Reference in New Issue
Block a user