Add a history search UI for history page#13511
Conversation
…arge). - The sort button is in the History page. - The TextView inside sortButton was using 'match_parent' width, which caused the parent layout to expand to full width, making the entire row clickable. - Changed to 'wrap_content' to limit the clickable area to actual content.
… page - Added a 'search button' next to the 'sort button' in the same row on the History page - Ensured that the blank space between 'sort button' and 'search button', as well as the 'search button' itself, is not part of the sort button's clickable area (wrapped buttons in a parent RelativeLayout; sort button width set to wrap_content) - Added new string "search_history" for search button contentDescription (blind-friendly hint) 1) Avoid reusing "enable_search_history_title" (intended for settings toggle) 2) Did not reuse "search" since it is too generic and lacks context. - Kept playlist control (three buttons in one line) in its original position below the two buttons
- Added a search button to the History page (already implemented in previous commits), next to the sort button
- This search button mimics the search button on home page (main page): clicking it shows a search input overlay
- Overlay covers the leftmost sort button
- Overlay includes:
* 1dp View as underline to mimic the search bar on home page (main page)
* Text input for search
* Search input has watermark text "Search history" above the underline
* Clear (X) button on the right end above the underline to exit search
- Uses FrameLayout to overlay the search bar without pushing playlist control down,
otherwise the underline and (X) button would wrap to a new line, pushing playlist control down
- Soft keyboard automatically shows when search is activated
UI behavior:
- Tap search icon → overlay appears, covering the sort button
- Tap clear (X) → overlay disappears, input cleared, original UI restored
- No layout shift occurs
Prevent crash on Enter key in search input
- Added OnEditorActionListener to history search input to intercept
IME search button and Enter key presses
- Hides soft keyboard when these keys are pressed, preventing crashes
- Does not trigger any search yet; just handles keyboard and avoids crash
Make cursor color follow textColor
- Set textCursorDrawable to null so cursor follows textColor
- Keeps behavior consistent with themed colors (no hardcoded values)
- cursor color on home page (main page) is white color, too.
- Added TextWatcher to search input to filter history in real time - Introduced 'allHistoryEntries' to keep unfiltered dataset - Implemented filterHistory() to match query against stream 'title' and 'uploader' names. 1) 'uploader' also means channel, for example: BBC Earth. 2) Extract a helper method matchesHistoryEntry() from filterHistory() - Filtering is case-insensitive and updates UI instantly as user types
…etter spacing - Add 12dp start padding to align with existing UI spacing - Improves visual alignment of search input and avoids text touching screen edge
- Limit search underline and input area to the left side of the clear (X) button - Add a small start margin to the underline for better visual balance - Improves spacing consistency and avoids the underline visually touching screen edges
…playback - Reapply current search query when history entries are reloaded - Keep search results consistent after returning from video playback
|
Detailed description for current PR OverviewAdd a local history search UI to the history page. Features:
UI NotesThe history search UI follows the existing search button behavior on main page (home page):
The search input temporarily covers the sort button while active. String resourcesAdded: <string name="search_history">Search history</string>Only the default Filtering behavior
Currently unsupported:
About commit: Restore filtered results after returning from video playbackReproduction steps:
Previously, the search query was still visible in the input field, Reason: Fix:
Since TestedTested with:
|
Cursor thicknessNote: The cursor is thinner than the one in the main search bar. If a thicker cursor is preferred, a custom cursor drawable can be introduced, and this PR can directly add a commit to do it. Here is two screenshots showing the difference between the two cursors. Image 2: cursor in the history search bar (new) |


What is it?
refactorbranchDescription of the changes in your PR
Adds a history search UI for history page, and users can search some history entries by clicking the search button and entering keywords in stream titles or uploader names.
Detailed description is provided in the comments below.
Before/After Screenshots/Screen Record
history_search_UI_actions-reduce_size.mp4
Fixes the following issue(s)
Due diligence