Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search file manager #967

Merged
merged 9 commits into from
Oct 15, 2024
Merged

Conversation

makeevrserg
Copy link
Collaborator

Background

This PR add functional search into new file manager sample

Changes

  • Add search into file manager
  • Fix internal visibility for ComposableSearchBar

Test plan

  • Open some folder with sample
  • Try press search button
  • See search elements with cool animations

Comment on lines 135 to 149
featureState
.onEach { status ->
when (status) {
FFeatureStatus.NotFound -> _state.emit(State.Unsupported)
FFeatureStatus.Retrieving -> _state.emit(State.Loading)
FFeatureStatus.Unsupported -> _state.emit(State.Unsupported)
is FFeatureStatus.Supported -> trySearch()
}
}.launchIn(viewModelScope)
// drop initial element
_searchState
.drop(count = 1)
.debounce(timeout = 400.milliseconds)
.onEach { trySearch() }
.launchIn(viewModelScope)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can combine featureState and searchState in one flow and not use blocking operation. Please, do it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@makeevrserg makeevrserg added this pull request to the merge queue Oct 15, 2024
Merged via the queue into flipperdevices:dev with commit 7229ee6 Oct 15, 2024
11 checks passed
@makeevrserg makeevrserg deleted the search-file-manager branch October 15, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants