I've implemented MaterialSearchView in a fragment and it works fine. Now I want to make the first letter of each word capital. This is what I have tried:
<com.miguelcatalan.materialsearchview.MaterialSearchView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/material_search_view"
android:inputType="textCapWords"/> //Doesn't work
But for some reason, it doesn't work. Please help me with that. Thanks!
Try to override the attr
of the EditText
of MaterialSeachView
like this:
MaterialSearchView searchView = findViewById(R.id.search_view); //inflate with your MaterialSeachView ID
final EditText editText = searchView.findViewById(com.miguelcatalan.materialsearchview.R.id.searchTextView);
editText.setInputType(InputType.REQUIRED_TYPE); // replace REQUIRED_TYPE with your needed inputType