forked from shihaam/thijooree
auto select all tab in contact picker on search bar selection
This commit is contained in:
@@ -122,6 +122,12 @@ class ContactPickerSheetFragment : BottomSheetDialogFragment() {
|
|||||||
attachMediator(initialPages)
|
attachMediator(initialPages)
|
||||||
|
|
||||||
binding.etSheetSearch.addTextChangedListener { pagerAdapter.rebuildAll() }
|
binding.etSheetSearch.addTextChangedListener { pagerAdapter.rebuildAll() }
|
||||||
|
binding.etSheetSearch.setOnFocusChangeListener { _, hasFocus ->
|
||||||
|
if (hasFocus) {
|
||||||
|
val allIndex = pagerAdapter.pages.indexOfFirst { it.tag == null }
|
||||||
|
if (allIndex >= 0) binding.viewPager.setCurrentItem(allIndex, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.contactCategories.observe(viewLifecycleOwner) { cats ->
|
viewModel.contactCategories.observe(viewLifecycleOwner) { cats ->
|
||||||
val pages = buildList {
|
val pages = buildList {
|
||||||
|
|||||||
Reference in New Issue
Block a user