diff --git a/feature/home/src/main/java/com/twofasapp/feature/home/ui/bottombar/BottomBar.kt b/feature/home/src/main/java/com/twofasapp/feature/home/ui/bottombar/BottomBar.kt index c9c860bb..56edc90d 100644 --- a/feature/home/src/main/java/com/twofasapp/feature/home/ui/bottombar/BottomBar.kt +++ b/feature/home/src/main/java/com/twofasapp/feature/home/ui/bottombar/BottomBar.kt @@ -33,6 +33,7 @@ interface BottomBarListener { internal fun BottomBar( selectedIndex: Int, listener: BottomBarListener, + onItemClick: () -> Unit = {}, ) { TwNavigationBar { bottomNavItems.forEachIndexed { index, item -> @@ -43,8 +44,14 @@ internal fun BottomBar( showBadge = false, onClick = { when { - index == 0 && selectedIndex != 0 -> listener.openHome() - index == 1 && selectedIndex != 1 -> listener.openSettings() + index == 0 && selectedIndex != 0 -> { + onItemClick() + listener.openHome() + } + index == 1 && selectedIndex != 1 -> { + onItemClick() + listener.openSettings() + } } } ) diff --git a/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/ServicesScreen.kt b/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/ServicesScreen.kt index a67e85c1..8d0705e2 100644 --- a/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/ServicesScreen.kt +++ b/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/ServicesScreen.kt @@ -262,7 +262,17 @@ private fun ServicesScreen( } Scaffold( - bottomBar = { BottomBar(0, bottomBarListener) }, + bottomBar = { + BottomBar( + selectedIndex = 0, + listener = bottomBarListener, + onItemClick = { + if (uiState.searchFocused) { + onSearchFocusChange(false) + } + } + ) + }, topBar = { ServicesAppBar( query = uiState.searchQuery,