Skip to content

Commit

Permalink
fix: input is hiding when searching and scrolling [WPB-271] (#2826)
Browse files Browse the repository at this point in the history
  • Loading branch information
saleniuk authored Mar 27, 2024
1 parent 0676fb6 commit de629ad
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions app/src/main/kotlin/com/wire/android/ui/home/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ fun HomeContent(
)
}
},
isSwipeable = !searchBarState.isSearchActive,
content = {
/**
* This "if" is a workaround, otherwise it can crash because of the SubcomposeLayout's nature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ fun SearchUsersAndServicesScreen(
}
}
},
isSwipeable = !searchBarState.isSearchActive,
content = {
Crossfade(
targetState = searchBarState.isSearchActive, label = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package com.wire.android.ui.home.conversations.search.messages

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand All @@ -31,8 +32,8 @@ import com.wire.android.navigation.BackStackMode
import com.wire.android.navigation.NavigationCommand
import com.wire.android.navigation.Navigator
import com.wire.android.navigation.style.PopUpNavigationAnimation
import com.wire.android.ui.common.CollapsingTopBarScaffold
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.common.scaffold.WireScaffold
import com.wire.android.ui.common.topappbar.search.SearchTopBar
import com.wire.android.ui.destinations.ConversationScreenDestination
import com.wire.android.ui.home.conversations.ConversationNavArgs
Expand All @@ -50,9 +51,8 @@ fun SearchConversationMessagesScreen(
searchConversationMessagesViewModel: SearchConversationMessagesViewModel = hiltViewModel()
) {
with(searchConversationMessagesViewModel.searchConversationMessagesState) {
CollapsingTopBarScaffold(
topBarHeader = { },
topBarCollapsing = {
WireScaffold(
topBar = {
SearchTopBar(
isSearchActive = true, // we want the search to be always active and back arrow visible on this particular screen
searchBarHint = stringResource(id = R.string.label_search_messages),
Expand All @@ -63,28 +63,27 @@ fun SearchConversationMessagesScreen(
isLoading = isLoading
)
},
content = {
SearchConversationMessagesResultContent(
searchQuery = searchQuery.text,
searchResult = searchResult,
onMessageClick = { messageId ->
navigator.navigate(
NavigationCommand(
ConversationScreenDestination(
navArgs = ConversationNavArgs(
conversationId = conversationId,
searchedMessageId = messageId
)
),
BackStackMode.UPDATE_EXISTED
content = { internalPadding ->
Column(modifier = Modifier.padding(internalPadding)) {
SearchConversationMessagesResultContent(
searchQuery = searchQuery.text,
searchResult = searchResult,
onMessageClick = { messageId ->
navigator.navigate(
NavigationCommand(
ConversationScreenDestination(
navArgs = ConversationNavArgs(
conversationId = conversationId,
searchedMessageId = messageId
)
),
BackStackMode.UPDATE_EXISTED
)
)
)
}
)
},
bottomBar = { },
snapOnFling = false,
keepElevationWhenCollapsed = true
}
)
}
}
)
}
}
Expand Down

0 comments on commit de629ad

Please sign in to comment.