Add option to hide the voice search button#1423
Conversation
Adds a toggle to SearchPreferences (`show_voice_search_button`, default true) and a new entry in the search page's view options dialog. When disabled, the voice search button is hidden from the search row. For existing users, an entry in AppUpgradeHandler sets the value to true so the button stays visible after upgrade.
damontecres
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Left a couple minor comments
Switch the voice search button toggle to AnimatedVisibility with a horizontal expand/shrink from the start, matching the pattern used elsewhere (NavDrawer now-playing). Rename show_voice_search_button_on/off to visible_ui/hidden_ui so the labels can be reused by other toggles.
…us/Wholphin into fea/voice-search-toggle
|
Thanks for the suggestions. Is this what you had in mind? @damontecres |
|
Thanks! I'm new to Kotlin and Android development. This project has amazed me in it's quality and prompted me to switch from Plex to Jellyfin. I'm a tech lead by day (web dev, CI/CD), so I felt obligated to do my part and try to help out. Thanks for the patience and acceptance. |
|
I'm glad you like it! And super happy you're making it even better! Since you're new to kotlin & android, let me elaborate on the changes I made. First, I just think the fade and shrinking towards End looks better. Second, moving the padding to the individual row elements instead using the Finally, the focus issue happened when opening the search page if you have the voice button hidden, focus might jump to the nav drawer. This is because initially the button is always shown (the initial value was true) and then it's updated, so it focused on the button which then disappears so the focus is lost. Instead, it can use the initial value from the Hopefully all that makes sense |
|
Thanks for the explanations! Funny how quickly you managed to find and fix a bug like that. |
Description
Adds a "Show voice search button" toggle to the search page's view options dialog, alongside the existing "Combined search results" toggle. When disabled, the voice search button is hidden from the search row, taking it out of the D-pad focus path.
The new field
show_voice_search_buttonis added toSearchPreferences(defaulttrue). The serializer applies the default for new installs, and a new entry inAppUpgradeHandlersets it totruefor users upgrading from earlier versions so existing behaviour is preserved.Related issues
Discussion: #1419
Testing
Tested on an Android TV (1080p) AVD running API 34:
version.current.nameto an older value in SharedPreferences and force-restarting the app; afterneedUpgrade()fired, the toggle was on as expected.The upgrade-handler entry currently uses
0.6.4-8-g0(based on currentmainHEAD); happy to bump this if you'd prefer a different target version on merge.Screenshots
AI or LLM usage
I used Claude to scaffold the proto/serializer/upgrade-handler/dialog changes, mirroring the existing
combined_search_resultspattern. I reviewed each diff before committing and tested the toggle manually on the emulator, including the upgrade-handler simulation.