nearby: show placeholder in Nearby SearchView (Fixes #6482)#6523
nearby: show placeholder in Nearby SearchView (Fixes #6482)#6523XinyuYangYXY wants to merge 1 commit intocommons-app:mainfrom
Conversation
|
✅ Generated APK variants! |
|
Thanks a lot, your screenshot is very informative to get an idea of how it would look. I can't help but think that the UI is more confusing with that string in that state. Especially on small screen, it would not be obvious whether Bridge and Museum are selected. In view of that, and given the facts that it is not a real search bar, I would personally say that the UI is better without showing the "Bridge, museum, hotel, etc.". What do you think? Thanks a lot! |
|
I understand. It's okay. |
Description (required)
Fixes #6482
What changes did you make and why?
Problem
On the Nearby screen, the placeholder from
nearby_search_hint("Bridge, museum, hotel") was not visible in the SearchView.Approach
Runtime enforcement in
NearbyParentFragment.initNearbyFilter()queryHint = getString(R.string.nearby_search_hint).setIconifiedByDefault(false),clearFocus()).EditText(androidx.appcompat.R.id.search_src_text) and set the hint + hint text color as a fallback for OEM differences:searchEditText.hint = getString(R.string.nearby_search_hint)searchEditText.setHintTextColor(ContextCompat.getColor(requireContext(), R.color.white))try/catch+Timber.efor graceful degradation if internals differ.Layout
filter_search_view_layout.xml: keepandroid:queryHint="@string/nearby_search_hint",android:iconifiedByDefault="false",app:theme="@style/WhiteSearchBarTheme", and search icon setup to improve consistency across devices.styles.xml: addWhiteSearchBarTheme(inheritsDarkAppTheme) with white controls to guarantee hint contrast on dark backgrounds.Repository hygiene
mainbefore making changes.Result
The placeholder “Bridge, museum, hotel” reliably appears when the field is empty, improving first-use discoverability in Nearby.
Tests performed (required)
debug-main(Commons app6.0.2-debug-main~4ed9ad508)Manual scenarios
Screenshots (for UI changes only)