Skip to content
Snippets Groups Projects
Commit de8ec561 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

contact search: fix selection glitch

GitLab: #1221
Change-Id: I4279891bde91c0d97bec3ed1058b401571f85728
parent 7f8bab96
Branches
Tags
No related merge requests found
/* /*
* Copyright (C) 2004-2022 Savoir-faire Linux Inc. * Copyright (C) 2004-2023 Savoir-faire Linux Inc.
*
* Author: Michel Schmit <michel.schmit@savoirfairelinux.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -58,16 +56,10 @@ class ContactSearchFragment : BaseSearchFragment<ContactSearchPresenter>(), ...@@ -58,16 +56,10 @@ class ContactSearchFragment : BaseSearchFragment<ContactSearchPresenter>(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
mTextEditor = view.findViewById(R.id.lb_search_text_editor) mTextEditor = view.findViewById(R.id.lb_search_text_editor)
}
override fun onResume() {
super.onResume()
mTextEditor?.requestFocus() mTextEditor?.requestFocus()
} }
override fun getResultsAdapter(): ObjectAdapter { override fun getResultsAdapter(): ObjectAdapter = mRowsAdapter
return mRowsAdapter
}
override fun onQueryTextChange(newQuery: String): Boolean { override fun onQueryTextChange(newQuery: String): Boolean {
presenter.queryTextChanged(newQuery) presenter.queryTextChanged(newQuery)
...@@ -125,12 +117,6 @@ class ContactSearchFragment : BaseSearchFragment<ContactSearchPresenter>(), ...@@ -125,12 +117,6 @@ class ContactSearchFragment : BaseSearchFragment<ContactSearchPresenter>(),
contacts.conversations.map { item -> ContactCard(item, Card.Type.CONTACT_ONLINE) }, diff) contacts.conversations.map { item -> ContactCard(item, Card.Type.CONTACT_ONLINE) }, diff)
} }
} }
if (scrollToTop) {
rowsSupportFragment.view?.postDelayed({
rowsSupportFragment.verticalGridView.smoothScrollToPosition(0)
mTextEditor?.requestFocus()
}, 300)
}
} }
override fun clearSearch() { override fun clearSearch() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment