-
Notifications
You must be signed in to change notification settings - Fork 1.3k
nearby: show placeholder in Nearby SearchView (Fixes #6482) #6523
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
nearby: show placeholder in Nearby SearchView (Fixes #6482) #6523
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?
If you agree, would you mind simply removing the string from app/src/main/res/values/strings.xml ?
I apologize for reverting my answer after I gave an answer at your confirmation question at #6482 (comment) , I know you put a lot of effort into this pull request, but seeing it live, I can't help but think that it would be more confusing than helpful.
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)
- Before: empty field with no placeholder
c8e5e7e9877907f3001b4ab975533fa3- After: empty field showing "Bridge, museum, hotel"
ea92e2d5b87dff52562090a5dd2d68a3