MiguelCatalan / MaterialSearchView

Cute library to implement SearchView in a Material Design Approach
http://miguelcatalan.info/2015/09/23/MaterialSearchView/
Apache License 2.0
3.83k stars 616 forks source link

Custom fonts #210

Open amzer-n opened 6 years ago

amzer-n commented 6 years ago

Is there any way to change the font of the input text and hint? I tried using styles but it did not work.

imdBhargav commented 4 years ago

Try this code. I am able to change the font via this code

val resourceId = resources.getIdentifier("searchTextView", "id",
            Objects.requireNonNull(context)?.packageName)

val etSearch = binding.searchView.findViewById<AppCompatEditText>(resourceId)
val typeface = ResourcesCompat.getFont(context!!, R.font.poppins_regular)
etSearch.typeface = typeface