Feature/third search screen#87
Merged
Merged
Conversation
- Moved modifier to be the first optional parameter in composables - Cleaned up unused code - Applied animateColorAsState for smoother transitions - Used shape radius from DesignSystem for consistency
This commit introduces the UI components and logic for displaying and managing recent searches. Key changes: - Added `RecentSearchHeader.kt` for the header section with a "Clear All" option. - Added `RecentSearchItem.kt` to display individual recent search terms with a remove icon. - Added `RecentSearchList.kt` to display a list of recent search items. - Implemented `RecentSearchSyncWorker.kt` to handle clearing all recent searches in the background. - Added necessary string resources for "Recent Search", "Clear All", and "Remove". - Updated `libs.versions.toml` and `build.gradle.kts` to include the `work-runtime-ktx` dependency. - Made minor adjustments to `MovioText.kt`.
…on" suffix for better organization within the `searchScreen` package. Specifically: - `RecentSearchHeader.kt` is now `RecentSearchHeaderSection.kt` - `RecentSearchItem.kt` is now `RecentSearchItemSection.kt` - `RecentSearchList.kt` is now `RecentSearchListSection.kt` A new composable `searchListScreen.kt` has been added to the `searchScreen` package to display the recent search UI.
The `SearchScreen` Composable function and its content `SearchScreenContent` have been removed. This component was responsible for displaying the search interface, including a search bar, recent search list, and handling search-related actions.
… feature/recently-searched
This commit introduces recent search functionality to the SearchScreen.
Key changes include:
- **SearchViewModel:**
- Manages recent search data using `RecentSearchUseCase`.
- Implements `refreshRecentSearches` to load recent searches.
- Adds `clearRecentSearchesWithWorker` to clear recent searches using a `RecentSearchSyncWorker`.
- Handles search query changes and item clicks/removals for recent searches.
- **SearchUiState:**
- Adds `recentSearches` list to store recent search queries.
- **searchListScreen:**
- Updates `RecentSearchScreen` to use `SearchViewModel` for state management and actions.
- Connects UI elements to corresponding ViewModel functions for search query input, clearing searches, and interacting with recent search items.
This commit introduces recent search functionality to the SearchScreen.
Key changes include:
- **SearchViewModel:**
- Manages recent search data using `RecentSearchUseCase`.
- Implements `refreshRecentSearches` to load recent searches.
- Adds `clearRecentSearchesWithWorker` to clear recent searches using a `RecentSearchSyncWorker`.
- Handles search query changes and item clicks/removals for recent searches.
- **SearchUiState:**
- Adds `recentSearches` list to store recent search queries.
- **searchListScreen:**
- Updates `RecentSearchScreen` to use `SearchViewModel` for state management and actions.
- Connects UI elements to corresponding ViewModel functions for search query input, clearing searches, and interacting with recent search items.
The androidContext method is no longer needed in Koin as of version 3.2.0. This commit removes the unnecessary call to androidContext during Koin initialization in the MovioApp class.
…ently-searched # Conflicts: # app/src/main/java/com/madrid/movio/app.kt # gradle/libs.versions.toml # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/SearchViewModel.kt # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/features/recentSearchLayout/RecentSearchLayout.kt # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/features/recentSearchLayout/RecentSearchLayoutViewModel.kt
This commit introduces Koin for dependency injection of `SearchViewModel` and updates related dependencies. Key changes include: - Modified `RecentSearchScreen` to use `koinViewModel()` for `SearchViewModel` instantiation. - Updated `SearchViewModel` interaction within `RecentSearchScreen` to align with the new state management approach. - Added `androidx-work-runtime-ktx` to `libs.versions.toml`. - Implemented `removeRecentSearch` function in `SearchViewModel`. - Removed unused `wxwx` data class from `SearchScreenState.kt`. - Updated `appModule` in `app.kt` to use Koin for providing `SearchViewModel` and its dependencies, including new use cases.
The application context is now provided to Koin during initialization. This allows Koin to correctly inject dependencies that require a context.
This commit introduces several improvements to the search functionality within the `SearchViewModel` and related UI components.
Key changes:
- **SearchViewModel:**
- Manages search query state using `MutableStateFlow` and `StateFlow`.
- Implements `onSearchQueryChange` to update the query.
- Adds `onSearchSubmit` to handle search submission, including adding the query to recent searches and clearing the input.
- Modifies `removeRecentSearch` to update the UI state directly by removing the item from the current list.
- Introduces `addToRecentSearches` to manage adding new search terms to the recent searches list, ensuring no duplicates and limiting the list size.
- **searchListScreen.kt:**
- Binds the `searchQuery` to `SearchViewModel.searchQuery`.
- Updates `BasicTextInputField`'s `onValueChange` and `onClickEndIcon` to use `SearchViewModel` methods.
- Implements keyboard actions for "Done" to trigger search submission and hide the keyboard.
- Simplifies `onRemove` and `onItemClick` in `RecentSearchList` to directly pass the item string.
- **RecentSearchListSection.kt:**
- Updates `onRemove` and `onItemClick` lambda signatures to accept the `String` item directly, instead of an index.
- **BasicTextInputField.kt:**
- Adds `keyboardOptions` and `keyboardActions` parameters to allow customization of keyboard behavior.
… feature/third-search-screen # Conflicts: # .idea/deploymentTargetSelector.xml
This commit introduces several improvements to the recent search feature: - Implemented text highlighting for search queries within recent search items. - Introduced `HighlightedText` composable for displaying text with highlighted search terms. - Added `MovioTextHighlight` composable to the design system for styled highlighted text. - Ensured that when a search query is empty, the full list of recent searches is displayed. - Removed the "No results" message when the filtered recent search list is empty. - Added functionality to clear all recent searches in the `SearchViewModel`, updating the UI accordingly.
# Conflicts: # app/src/main/java/com/madrid/movio/app.kt # presentation/src/main/java/com/example/presentation/viewModel/base/SearchViewModel.kt # presentation/src/main/java/com/madrid/presentation/base/UiMapper.kt
- Moved `SearchViewModel` to `presentation/screens/searchScreen`. - Implemented `addToRecentSearches` and `removeRecentSearch` methods in `SearchViewModel`. - Updated `BaseViewModel` to include `searchQuery`, `recentSearchUseCase`, and search-related methods. - Modified `MainActivity` to use `RecentSearchScreen`. - Updated `searchListScreen.kt` to import `SearchViewModel` from its new location.
This commit removes the `RecentSearchSyncWorker` class. Additionally, the message displayed when there are no recent search results has been removed from `RecentSearchListSection.kt`, resulting in an empty display in that scenario.
This commit introduces the `RecentSearchDao` for managing recent search entries in the local database, along with the `RecentSearchEntity` data class. Additionally, a new `RecentSearchSyncWorker` is added to periodically clear recent searches. The `SearchViewModel` is updated to include a static method for clearing recent searches, enhancing the overall search functionality.
This commit introduces a new composable `RecentSearchHeader` for displaying "Recent search" text and a "Clear all" button. Additionally, `RecentSearchSyncWorker` now uses an injected `RecentSearchUseCase` dependency instead of retrieving it from the global Koin context.
# Conflicts: # app/src/main/java/com/madrid/movio/MainActivity.kt # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/SearchViewModel.kt
…rch-screen # Conflicts: # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/SearchScreenState.kt # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/viewModel/SearchViewModel.kt # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/viewModel/base/BaseViewModel.kt # presentation/src/main/res/values-ar/string.xml # presentation/src/main/res/values/string.xml
…o feature/third-search-screen # Conflicts: # presentation/src/main/java/com/madrid/presentation/screens/searchScreen/FillteredSearchScreen.kt
# Conflicts: # app/src/main/java/com/madrid/movio/app.kt
yousef-osama11
approved these changes
Jul 16, 2025
ahmedhgabr
approved these changes
Jul 16, 2025
Alaakhaled101
approved these changes
Jul 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
init the search screen run ok