Skip to content

Commit 44bf294

Browse files
Set the color of text and hint of SearchView
1 parent f32dec9 commit 44bf294

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/src/main/java/ir/fallahpoor/releasetracker/libraries/view/LibrariesFragment.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import android.net.Uri
55
import android.os.Build
66
import android.os.Bundle
77
import android.view.*
8+
import android.widget.TextView
89
import androidx.appcompat.app.AppCompatActivity
910
import androidx.appcompat.view.ActionMode
1011
import androidx.appcompat.widget.SearchView
12+
import androidx.core.content.ContextCompat
1113
import androidx.core.view.isVisible
1214
import androidx.fragment.app.DialogFragment
1315
import androidx.fragment.app.Fragment
@@ -276,6 +278,15 @@ class LibrariesFragment : Fragment() {
276278
}
277279

278280
private fun setupSearchView(searchView: SearchView) {
281+
val searchTextView =
282+
searchView.findViewById<TextView>(androidx.appcompat.R.id.search_src_text)
283+
searchTextView.setTextColor(ContextCompat.getColor(requireContext(), android.R.color.white))
284+
searchTextView.setHintTextColor(
285+
ContextCompat.getColor(
286+
requireContext(),
287+
android.R.color.darker_gray
288+
)
289+
)
279290
searchView.queryHint = getString(R.string.hint_search)
280291
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
281292
override fun onQueryTextSubmit(query: String): Boolean {

0 commit comments

Comments
 (0)