nearby: show placeholder in Nearby SearchView (Fixes #6482) #6523
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.
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)