mirror of
https://github.com/twofas/2fas-android.git
synced 2024-11-22 02:09:58 +01:00
Fix search focus when switching between tabs
This commit is contained in:
parent
072b5f1d5e
commit
4fafd68950
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user