mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Merge 7d162b6f57 into aae9d4a387
This commit is contained in:
commit
2af3cb8274
3 changed files with 18 additions and 5 deletions
|
|
@ -31,6 +31,7 @@ import android.view.ViewGroup
|
||||||
import android.view.animation.Animation
|
import android.view.animation.Animation
|
||||||
import android.view.animation.AnimationUtils
|
import android.view.animation.AnimationUtils
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
|
import android.widget.EditText
|
||||||
import androidx.activity.result.ActivityResult
|
import androidx.activity.result.ActivityResult
|
||||||
import androidx.activity.result.ActivityResultLauncher
|
import androidx.activity.result.ActivityResultLauncher
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
|
@ -881,11 +882,18 @@ class NearbyParentFragment : CommonsDaggerSupportFragment(),
|
||||||
fun initNearbyFilter() {
|
fun initNearbyFilter() {
|
||||||
binding!!.nearbyFilterList.root.visibility = View.GONE
|
binding!!.nearbyFilterList.root.visibility = View.GONE
|
||||||
hideBottomSheet()
|
hideBottomSheet()
|
||||||
binding!!.nearbyFilter.searchViewLayout.searchView.apply {
|
// Force set the hint text and ensure it's visible
|
||||||
setIconifiedByDefault(false)
|
binding!!.nearbyFilter.searchViewLayout.searchView.queryHint = getString(R.string.nearby_search_hint)
|
||||||
isIconified = false
|
binding!!.nearbyFilter.searchViewLayout.searchView.setIconifiedByDefault(false)
|
||||||
setQuery("", false)
|
binding!!.nearbyFilter.searchViewLayout.searchView.clearFocus()
|
||||||
clearFocus()
|
|
||||||
|
// Try to access the internal EditText and set hint directly
|
||||||
|
try {
|
||||||
|
val searchEditText = binding!!.nearbyFilter.searchViewLayout.searchView.findViewById<EditText>(androidx.appcompat.R.id.search_src_text)
|
||||||
|
searchEditText?.hint = getString(R.string.nearby_search_hint)
|
||||||
|
searchEditText?.setHintTextColor(ContextCompat.getColor(requireContext(), R.color.white))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Timber.e(e, "Failed to set hint on SearchView EditText")
|
||||||
}
|
}
|
||||||
binding!!.nearbyFilter.searchViewLayout.searchView.setOnQueryTextFocusChangeListener { v, hasFocus ->
|
binding!!.nearbyFilter.searchViewLayout.searchView.setOnQueryTextFocusChangeListener { v, hasFocus ->
|
||||||
setLayoutHeightAlignedToWidth(
|
setLayoutHeightAlignedToWidth(
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,12 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:tint="@color/white"
|
android:tint="@color/white"
|
||||||
|
android:textColorHint="@color/white"
|
||||||
android:queryHint="@string/nearby_search_hint"
|
android:queryHint="@string/nearby_search_hint"
|
||||||
android:searchIcon="@drawable/ic_search_white_24dp"
|
android:searchIcon="@drawable/ic_search_white_24dp"
|
||||||
|
android:iconifiedByDefault="false"
|
||||||
|
android:queryBackground="@android:color/transparent"
|
||||||
|
app:searchIcon="@drawable/ic_search_white_24dp"
|
||||||
app:theme="@style/WhiteSearchBarTheme"/>
|
app:theme="@style/WhiteSearchBarTheme"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -148,6 +148,7 @@
|
||||||
|
|
||||||
<style name="WhiteSearchBarTheme" parent="DarkAppTheme">
|
<style name="WhiteSearchBarTheme" parent="DarkAppTheme">
|
||||||
<item name="colorControlActivated">@android:color/white</item>
|
<item name="colorControlActivated">@android:color/white</item>
|
||||||
|
<item name="colorControlNormal">@android:color/white</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DarkSpinnerTheme" parent="DarkAppTheme">
|
<style name="DarkSpinnerTheme" parent="DarkAppTheme">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue